NLP (Natural Language Processing) is the field of AI that lets computers understand and generate human language — chatbots, translation, sentiment analysis. But there's a catch we already know: a neural network only works on vectors. An image was easy (pixels are already numbers). A word like "king" isn't. So how?
Recall Module 1: we flattened a picture into a vector. Words need the same treatment — each word must become a fixed-length, multi-dimensional vector. The breakthrough method was word2vec: it uses a neural network to learn a vector for every word that captures its meaning (its "sentiment" / semantics).
Here's the intuition (simplified). Imagine each slot in a word's vector stands for some property. For the word "king," one dimension might mean Royalness, another Masculine/Feminine, another Plural. The values say how much of each property the word has.
Think of each word's vector as a personality profile made of sliders: how royal, how masculine, how young, how powerful… "King" scores high on royalty and masculinity; "Queen" high on royalty but feminine; "Boy" low royalty, masculine, young. Words with similar profiles end up as neighbours on the map — just like people with similar profiles get matched. The computer learns these sliders automatically from reading tons of text.
In reality the dimensions are not human-readable — a real word2vec vector has hundreds of dimensions, and you usually can't tell which one means "royalness." We label them here only to build intuition. The network discovers whatever properties are useful, even if we can't name them.
Click a word and see its (illustrative) property vector. Notice how King and Queen share high "Royalness" but flip on "Gender" — that shared structure is exactly what makes word-math work.
Because words are points on a map of meaning, you can do arithmetic with them. Take the vector for King, subtract Man (this removes the "maleness" from the concept of royalty), then add Woman. The point you land on is closest to… Queen.
It's like adjusting a recipe. Start with a beef burger, remove the beef, add chicken → you get a chicken burger. Everything else (the bun, the "burger-ness") stays; you only swapped one ingredient. Word-math does the same with meaning: keep "royalty," swap "male" for "female," and King becomes Queen. The direction from Man→Woman is the same as King→Queen — that parallel is what the network learned.
Pick a classic analogy, press Compute, and watch two arrows appear on the map. The orange arrow is the "difference" you're applying (e.g. Man→Woman = "make it female"). The teal arrow applies that same movement to the other word — landing you on the answer. When both arrows are parallel, the analogy holds.
This is a simplified 2D map (real vectors have hundreds of dimensions), but the principle is exactly right: meaning is direction and distance in vector space, and analogies are parallel arrows.
Next up → Module 5: Predicting the next word. Now that words are vectors, how did early models actually generate text? We'll meet bigrams and trigrams — the first language models — and see exactly why they break.