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.
Lesson overview
How computers handle human language: search, spam filters, sentiment, and the roots of chatbots.
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. See what sentence it builds.
- 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
Read aloud the "From the summit" section below. Ask students which ideas from today they recognize in it.
- 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. See what sentence it builds.
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 is based on a Stanford course.