0Pricing
NLP Academy · Lesson

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

  1. From Sparse Counts to Dense Vectors
  2. How word2vec Learns Meaning
  3. Loading GloVe Vectors in Python
  4. Word Math: King Minus Man Plus Woman
← Back to NLP Academy