Word Math: King Minus Man Plus Woman
Explore analogies and nearest neighbors.
Vectors Have Directions
Because words are now vectors, you can add and subtract them like arrows. This unlocks a playful idea called word math.
The Famous Example
Take king, subtract man, add woman, and the nearest vector is queen. This analogy stunned researchers when it first appeared. 👑
result = emb["king"] - emb["man"] + emb["woman"]
# nearest word -> "queen"All lessons in this course
- From Sparse Counts to Dense Vectors
- How word2vec Learns Meaning
- Loading GloVe Vectors in Python
- Word Math: King Minus Man Plus Woman