From Languages to Information (NLP)
How computers handle human language: search, spam filters, sentiment, and the roots of chatbots.
AI tutor is turned off for this class
Use the CS124 lectures, notes, and assignments below to keep learning.
Big Idea
Natural Interaction
Grade bands
K-2 · 3-5 · 6-8 · 9-12
AI literacy pillar
How AI works · Ethics
Lesson overview
How computers handle human language: search, spam filters, sentiment, and the roots of chatbots. This module climbs from an everyday intuition to the real mechanism, then names the Stanford course it descends from.
Teacher script · ~45 min
- 0–5
Hook
Computers love numbers and hate words. The first job of language tech is turning messy text (slang, typos, punctuation) into something countable. Once words become numbers, the computer can search them, sort them, and spot patterns like 'this email smells like spam.'
- 5–15
Explore
Students do the activity in pairs: Open your phone's keyboard and keep tapping the middle suggestion. The weird sentence it builds is a baby language model running.
- 15–30
Explain
'You shall know a word by the company it keeps.' Words that appear in similar contexts (cat, dog, hamster) probably mean similar things. Turn each word into a list of numbers placed so that similar words sit near each other, and the computer gets a usable sense of meaning without a dictionary. These are word embeddings.
- 30–40
Connect to the summit
Show students this is the real thing professionals build: CS124, the real thing. How computers handle human language: search, spam filters, sentiment, and the roots of chatbots.
- 40–45
Check
Run the formative check below. Anyone who can explain a key term in their own words has it.
Student activity
Open your phone's keyboard and keep tapping the middle suggestion. The weird sentence it builds is a baby language model running.
Slides
Formative check
- 1.In your own words, what is "Tokenization"? (Looking for: Chopping raw text into the units (words/pieces) a computer can count.)
- 2.In your own words, what is "Language model"? (Looking for: A system that assigns probabilities to word sequences, so it can predict and generate text.)
- 3.In your own words, what is "TF-IDF"? (Looking for: A score for how important a word is to one document versus the whole collection.)
Carry-away concepts
- Tokenization
- Chopping raw text into the units (words/pieces) a computer can count.
- Language model
- A system that assigns probabilities to word sequences, so it can predict and generate text.
- TF-IDF
- A score for how important a word is to one document versus the whole collection.
- Word embedding
- Representing a word as numbers so that similar-meaning words land near each other.
From the summit · the Stanford source
You build the classic NLP toolkit (text processing, language models, classification, information retrieval) that underpins search engines and assistants.
This module descends from CS124 at Stanford. Students who climb the full ladder arrive here.
