Build from nearby words to relationships in a vector space
Word embeddings turn patterns of word use into positions and directions. Work through the panels in order: first similarity, then vector expressions, semantic axes, and a careful bias reflection.
- Find the nearest words to one query.
- Try an expression such as king minus man plus woman.
- Map a word on an axis, then do the related bias reflection.
What Is An Embedding?
A word embedding represents each word as a point in a high-dimensional space. Words used in similar contexts tend to land near each other, and directions through the space can sometimes capture relationships like gender, size, or category. This demo uses Google News Word2Vec.
1. Start With One Word
Start by asking which words are closest to one word. The model compares the query word to every word vector and returns the ten most similar words by cosine similarity.
Nearest Words
| Word | Similarity |
|---|
2. Make A Vector Expression
Vector expressions move through the embedding space. In a classic example, king - man + woman starts near king, subtracts a male direction, adds a female direction, and often lands near queen.
Expression Result
| Word | Similarity |
|---|
3a. Choose A Semantic Axis
A custom axis is the direction from the start word to the end word. The horizontal position shows how much each word projects onto that direction. For this view, the model first looks at a larger nearby pool, then chooses ten words that better span the axis. The vertical direction is the strongest remaining variation among the plotted points after that axis is removed, so it helps spread the points out without naming a second concept.
Axis Map
Axis-Spanning Nearby Words
| Word | Similarity | Axis |
|---|
3b. Bias / Reflection Check
Embeddings learn patterns from text. If a job title leans toward one side of a gender axis, that is evidence about patterns in the training data, not evidence about who belongs in that job.
Bias Axis Map
Axis-Spanning Nearby Words
| Word | Similarity | Axis |
|---|