Skip to main content

Recap and final exam

Ten modules to go from a raw customer review to a served classifier that beats the baseline honestly. Here is the course condensed, and the threads running through it.

The course at a glance

ModuleWhat to retain
1. Cleaning and normalizationNormalize Unicode at entry; keep case, punctuation and negations; lemmatise only if it pays
2. Subword tokenizationBPE, WordPiece and SentencePiece keep vocabularies small and remove <UNK>; token cost varies by language
3. Bag of words and TF-IDFSparse matrix, (1, 2) n-grams, IDF boost for rare words; strong baseline in four lines
4. Word2Vec and GloVeDense vectors placed by co-occurrence; analogies work for a few examples; biases from the corpus travel to the geometry
5. Contextual embeddingsDifferent vector per occurrence; Sentence-BERT for similarity; cosine on unit-normalised vectors
6. Text classificationFine-tune with a small learning rate; macro F1 over accuracy; class weights for imbalance
7. Named entity recognitionBIO tags, subword-to-word alignment, entity-level F1 via seqeval
8. Summarization and QAExtractive guarantees factuality, abstractive hallucinates; ROUGE misses negation flips
9. The Transformers libraryThree levels of abstraction; AutoModelForXxx attaches the right head; pick on the Hub by language, size, licence
10. ProjectCompare three approaches on the same split; decide on F1 gap, traffic and cost, not on hype

The threads running through the course

Every transformation is a decision, and most of them can be defended or torn down. Removing stop words in module 1, adding n-grams in module 3, freezing an encoder in module 6, choosing extractive over abstractive in module 8 — each is a lever with a cost. The course never argued that any of them is right by default. It argued that any of them is right for a corpus and a task you have named. When someone else runs your pipeline on their data, they will re-run these choices; the value you deliver is that you can explain each one.

The tokenizer is not a detail. Modules 2, 6, 7, 8 and 9 all fail in the same way when the tokenizer is off: silent quality loss, no exception, no warning. The pair tokenizer/model is the atomic unit — cross them and nothing works. The Auto* classes exist to prevent this, and you can still bypass them by writing the two names by hand. Whenever a fine-tuned model performs worse than its baseline card, the tokenizer is the first place to look.

Metrics lie unless you pick them for the task. Accuracy on the 5-class review problem hides the minority classes. Token accuracy on NER hides everything. ROUGE on summarization misses negation flips. The macro F1, the per-entity F1, the human read of a sample — these are the metrics that survive contact with production. A score without a metric name is not a score; a metric without a test split is not a metric.

The baseline earns its keep even after it loses. Module 10 kept the TF-IDF baseline in the repo not for accuracy but as a smoke test: if the transformer ever slips within a point of it, a bug has entered the pipeline. Cheap, fast models catch expensive bugs. The best NLP infrastructures have both.

Pretrained models have inherited biases. Module 4 showed static embeddings encoding gender and ethnic stereotypes; module 5 and module 8 showed contextual models keeping them and adding fluency to the harm. For any high-stakes decision (hiring, credit, medicine, moderation), a pretrained model is a starting point that requires audit, mitigation and human oversight — not a drop-in solution.

The final exam

The exam has 40 questions covering all ten modules: Unicode normalization and what stripping accents costs on user-generated text, the mechanics of BPE and the token cost across languages, when TF-IDF is enough to ship and when it is not, the geometry of static embeddings and the biases it inherits, contextual embeddings and the [CLS] trap, class imbalance in fine-tuning, the alignment pitfalls of BIO tagging with subword tokenizers, the failure modes of ROUGE, the Hugging Face API from pipeline to AutoModelForXxx, and the three-way comparison of TF-IDF, sentence embeddings and fine-tuning on cost and latency.

Several questions present situations to diagnose: two visually identical strings that a groupby splits apart, a model that scores 90 % accuracy on a review corpus and predicts nothing but 5 stars, a NER model that reports 95 % token accuracy and misses every entity, a summariser that inverts the polarity of a review, a fine-tuned model that scores worse than its baseline after a tokenizer swap. Judgement is what gets assessed, not memorised API signatures.

On success, your certificate of completion is issued immediately; its number can be verified by any third party on the platform.

Before you start

Go back over the table above and, for each row, ask yourself "what symptom would I see if I got this wrong?". If you can explain why a not in a stop list ruins a sentiment classifier, why the F1 on 3-star reviews is more informative than the overall accuracy, why an English tokenizer costs three times more tokens on Arabic, and why a summariser that reads beautifully can still be catastrophically wrong, you are ready. Good luck!

Final exam

Ready to validate this course?

40 questions drawn at random from the course bank · passing score 70% · verifiable PDF certificate issued immediately on success.

Start the exam

You need to be signed in to your InSkillML account with an active subscription. You can also start the exam from My courses.