Guided project
Mood Sorter
Teach a small real AI model to sort school sentences into worried and excited, write the code that scores it honestly, and catch the words it uses as shortcuts.
About 1.5 h ·
4 stages · 12 steps
What you'll make
In 15 minutes: Your own mood sorter, taught in a few seconds on school sentences you labelled, sorting any sentence you type with its chance.
What you'll find out about AI: A model can learn shortcut words instead of the idea.
Make it yours: Pick two new labels from school life, write 20 sentences of each without shortcut words, and see if your held-out score over 3 seeds beats this one.
When you share: I taught a real AI model to read my school mood.
Step by step
Stage 1
Teach it your labels (minutes 0-20)
A real model that sorts your school sentences, taught in seconds, and the first scoring code you wrote.
- Your sentences, your sorter — The model has learned from sentences that include yours, and it sorts a sentence you type.
- A coin toss, then a nudge — You saw the untaught model guess, and you can say what the three training lines do.
- Write accuracy — Your own accuracy function scores the model after every epoch.
Stage 2
The honest score (minutes 20-45)
Your own held-out split, and what the training score hid.
- Hold some out — Your split keeps a quarter of the sentences aside, and the page shows a second, honest score.
- More epochs? — Three runs in your log at 5, 15 and 40 epochs, and what more epochs did to the held-out score.
- One seed is not enough — You know how far the held-out score moves when only the seed changes.
Stage 3
It learns your words (minutes 45-70)
The shortcuts it took, found by you, and a check that can catch a cheat.
- Trick it — You found a sentence it gets wrong and the word you think it leans on.
- Find the words yourself — Your one_label_words lists the shortcut words, and you tried to break one with new sentences.
- Break it on purpose — You know whether the checks catch a leak in the data, and your split now stops it.
Stage 4
Ready to share (minutes 70-90)
Your decision, from your own evidence, and someone else trying to fool it.
- Ready or not? — Your decision: how many epochs it ships with, and whether it is ready for a classmate, backed by your log.
- Ready for a stranger — It works on a phone, every word on it is yours, and it says what it can't do.
- Someone else tries it — Someone tried to fool your sorter without help, and you changed one thing because of it.
Guardrails
- Your sentences are about school life, invented by you, and in English (the model only learned English). No real names and no personal details in them.
- The model learns which words came with which label, not what you mean. It will be wrong sometimes; the page says so, and so do you when you share it.
- You write the ML code; the agent explains and reviews. Ask it to write a line only after you tried, and it will say when it did.
- Nothing is downloaded or installed. One model, bert-tiny, is already in your workspace.