Practical day 2
Hands-on workflows with embeddings and LLMs, plus guidance on the remaining assignments
Open slidesOverview
The second working session, covering the lecture 6–9 toolkit in three workstreams you tackle in any order: embeddings from scratch (the counting route — co-occurrence, PPMI, SVD — run end to end in numpy on two centuries of State of the Union addresses), pre-trained models (Hugging Face pipelines as one-line classifiers, then model embeddings as features for your own classifier), and the generation knobs (temperature and top-k/p swept on a real model — lecture 9’s figure happening in your own output). The second half is a work block on assignments 2–4; presentations are the following Tuesday, so today is the day to get unstuck.
Bring
- A laptop — workstreams run locally; bigger models run on the course server (access details on Itslearning)
- Your group’s assignment 2, 3, or 4 in whatever state it’s in
Materials
- Slides: use the Open slides button above
- Notebook: Embeddings_from_scratch.ipynb — workstream 1. Download sotu.zip (4 MB) and unzip so the
speeches sit in
data/sotu/next to the notebook. Ends with a Kozlowski-style cultural-dimension exercise. - Workstreams 2–3 follow the Hugging Face NLP course chapters 1–3 (the asynchronous work from lecture 9)
Before lecture 11
- Get your assignment pipeline running end to end, however crude
- Lecture 11 closes the theory and includes the course summary and exam pointers — attend even in deep assignment mode