LLMs & NLP Projects
Text classification, a char-level transformer from scratch, and generation and sentiment with pretrained models.
4 projects · GPU notebook · Premium only
Text Classification with TF-IDF
PROClassic NLP without a neural network: classify forum posts into topics using TF-IDF features and a linear classifier. Fetch a few categories of the 20 Newsgroups dataset, turn raw text into TF-IDF vectors, train a Logistic Regression model, and evaluate with accuracy and a confusion matrix. Variables persist across cells — vectorize once, reuse everywhere.
Text Generation with GPT-2
PROLoad the pretrained GPT-2 language model and its tokenizer from Hugging Face, tokenize a prompt, and generate text with greedy, sampling, and top-k / temperature decoding. See how decoding settings reshape the output, and inspect the model's next-token distribution. The model downloads into the GPU sandbox on first use and stays loaded for the session.
Sentiment Analysis with DistilBERT
PROUse a DistilBERT model fine-tuned on SST-2 to classify the sentiment of sentences. Tokenize text with a WordPiece tokenizer, run batched inference on the GPU, read off positive/negative probabilities, and compare predictions against expected labels. The model downloads into the sandbox on first use and stays loaded for the session.
Mini-GPT: A Char-Level Transformer
PROBuild a tiny GPT-style transformer from scratch — token and positional embeddings, masked multi-head self-attention, and a transformer block — then train it as a character-level language model on a small built-in corpus and generate new text. Small enough to train in seconds on a GPU, complete enough to show how a real LLM works under the hood.