The main NLP tasks, end to end
What you’ll learn
Section titled “What you’ll learn”This is the lesson where the track’s pieces assemble. You have the tools (run, fine-tune, share, wrangle data, understand tokenizers); now you learn to apply them across the common NLP tasks by choosing the right approach for each. The source curriculum is the Hugging Face LLM Course, Chapter 7, freely available and Apache-2.0 licensed at huggingface.co/learn/llm-course/chapter7.
You will see the one loop that underlies every task and the three things that change between them (head, label shape, metric); map each task (sequence and token classification, question answering, masked and causal language modeling, summarization, translation) to its model shape, AutoModelFor<Task> head, and metric; understand why the token-level tasks depend on the fast-tokenizer word IDs and offsets from lesson 6; and learn the extra tools sequence-to-sequence tasks need (Seq2SeqTrainer, generation metrics like ROUGE and BLEU).
Where this fits
Section titled “Where this fits”This is lesson 7 of 12, the third lesson of Phase 2. It is the synthesis lesson: it reuses the Trainer loop (lesson 3), the Datasets library (lesson 5), the tokenizer internals (lesson 6), and the Hub (lesson 4), the chapter where everything comes together. Phase 2 closes with lesson 8, which is what to do when one of these pipelines breaks.
Before you start
Section titled “Before you start”Prerequisites: lesson 3 (the Trainer fine-tuning loop that every task here reuses) and lesson 6 (fast tokenizers, word IDs, and offsets, which the token-level tasks depend on). Lessons 4 and 5 help but are not strictly required. This lesson is more conceptual than code-heavy: the goal is the diagnostic skill, so you can read it without a notebook, though the linked chapter has full runnable scripts per task.
About the math
Section titled “About the math”None. This lesson is about task selection and the shared training pattern, not new computation. Metrics like perplexity, ROUGE, and BLEU are named and explained by what they measure, not derived.
By the end, you’ll be able to
Section titled “By the end, you’ll be able to”The single capability this lesson builds: choose a suitable model and approach for the common NLP tasks. Concretely, you will be able to:
- Describe the one loop shared by all the common NLP tasks
- Map a task to its model shape,
AutoModelFor<Task>head, and metric - Explain why token classification and QA depend on fast-tokenizer word IDs and offsets
- Distinguish masked from causal language modeling and their shared self-supervision
- Identify the extra tools sequence-to-sequence tasks need (
Seq2SeqTrainer, ROUGE/BLEU)
Time and difficulty
Section titled “Time and difficulty”- Read time: about 12 minutes
- Practice time: about 10 minutes (a diagnose-the-task exercise plus flashcards; no required coding)
- Difficulty: standard (broad in scope, but conceptual; the goal is diagnosis, not memorizing seven scripts)