Text as Data: Tokenization and the Messiness of Language
Every machine-learning model you've built so far took numbers as input — pixels, feature vectors, measurements. But language arrives as text: a stream of characters with no inhere…
Natural Language Processing covers: Text as Data, Word Embeddings, The Classical Toolbox, Text Classification, Generation Tasks. Year 4, Quarter 16. Includes 12 exercises and 3 projects.
This course unlocks once you've finished its prerequisite. Open prerequisite →
Every machine-learning model you've built so far took numbers as input — pixels, feature vectors, measurements. But language arrives as text: a stream of characters with no inhere…
You have tokens now (last lesson) — but a token like "king" is just a symbol, an arbitrary integer ID, with no more meaning to a model than "banana" or "42." To a computer, "king"…
Before the transformer, before BERT and GPT, NLP was built on a classical toolbox — and two of its tools are so foundational that modern LLMs are, in a real sense, the same idea s…
Of all the tasks in NLP, one ships more than any other: text classification — assign a category to a piece of text. Is this email spam or not? Is this review positive, negative, o…
The tasks so far have mostly labeled text — classify it, tag it, extract from it. The hardest tasks in NLP generate text — produce new, fluent, correct language as output. Three o…
- [ ] Implement text preprocessing pipeline in Python — Tokenization, lowercasing, stopword removal, stemming, lemmatization - [ ] Train Word2Vec from scratch on a small corpus — …
- [ ] Fine-tune BERT for sentiment analysis — Hugging Face Transformers, IMDB dataset, evaluate accuracy/F1 - [ ] Build a Named Entity Recognition system — Fine-tune BERT for NER …
- [ ] Build a question-answering system — Fine-tune BERT on SQuAD, extract answer spans from context - [ ] Implement semantic search — Sentence transformers, FAISS index, cosine s…
- [ ] Build a document Q&A system in Python — Load PDFs, chunk text, embed with sentence-transformers, store in FAISS, retrieve relevant chunks, generate answers with a local LLM;…
Build a Python NLP toolkit from scratch: tokenizer (word and subword), stopword removal, stemmer (Porter's algorithm), TF-IDF vectorizer, and cosine similarity search. Process a c…
Fine-tune BERT for sentiment analysis on IMDB reviews using Hugging Face Transformers. Implement the full pipeline: data loading, tokenization, model setup, training with Trainer …
- [ ] Milestone 1: Build the knowledge base — ingest Ruby style guide, Rails security guide, RuboCop rules, OWASP guidelines as chunks in a vector store - [ ] Milestone 2: PR diff…
- [ ] What is TF-IDF? How does it rank documents for a search query? - [ ] Explain Word2Vec. What is the difference between CBOW and Skip-gram? - [ ] What are contextual embedding…
13 lessons. Read in order; spiral back when you need to. By the end you'll have used the core ideas twice — once on the abstract, once on something you'll meet at work next week.