Splashery
Word Vectors, a still.

No. 040 of 460 · AI and Computing · Built from a recipe

Word Vectors

Word vectors turn each word into a list of numbers, a point in a space with many directions, so that words used in similar ways land near each other.

Play it in the Playground

Shelf
AI and Computing
Kind
Built from a recipe
Your own
Your own words
Sound
Yes
Licenses
PDDL

How to play

Tap it to work out king − man + woman. Type your own words in the Splash tab.

Its controls

ControlKindRangeStart
A − B + CTap
AddButton

About it

Word vectors turn each word into a list of numbers, a point in a space with many directions, so that words used in similar ways land near each other. These have 50 numbers per word, learned from a huge amount of text. Directions in the space can carry meaning: the step from man to woman is much like the step from king to queen.

Tap it: an arrow runs out to KING, the step from MAN to WOMAN is added on from there, and it lands right next to QUEEN, which lights up. Type your own A − B + C in the Splash tab, with any of 24,000 common words, and it finds the nearest of the 10,000 most common words, with the runner-up in gray. A text file containing A − B + C works too. These relationships are approximate and can reflect biases in the training text.

Details

Splats
Opens at 200,000 at Mid Detail, 60,000 at Low, and up to 600,000 at Max
Your own files
.txt

Is it right?

The asset is a quantized subset of Stanford’s 50-dimensional GloVe vectors. The analogy calculation really uses all 50 dimensions and finds queen for king − man + woman. The nearest-word score approximates cosine similarity, and the 3D picture preserves the arrows rather than all distances.

  1. Correct

    These are named, real 50-dimensional word vectors.1

    Rebuilding the asset from the first 40,000 rows of Stanford’s official GloVe 6B 50D release gives identical bytes. Four original source vectors are also checked directly.

  2. Correct

    A − B + C is computed over all 50 dimensions.1

    Independent dot-product rankings match queen/throne, rome/milan, large/one, and swimming/diving for four analogies. The input vocabulary has 24,000 entries and the answer search uses 10,000.

  3. Close

    The nearest-word score approximates cosine similarity.1

    Only the query is normalized after loading. Quantized candidate lengths range from 0.99153 to 1.00849, so their dot products can differ from cosine by less than 0.009.

  4. Correct

    The 3D arrows preserve the analogy parallelogram.1

    The linear projection gives sum = A − B + C in the displayed coordinates for all four checked queries.

  5. Simplified

    Word relationships are approximate rather than universal truths.1

    The retained vocabulary and training corpus determine the answers; queen is the nearest example, not an exact equality or a rule for all words.

  1. 1GloVe: Global Vectors for Word Representation, Stanford NLP; Pennington, Socher, and Manning
Simplified
The source is filtered to 24,000 lowercase words and quantized to signed bytes. Answers search only the first 10,000 retained words and exclude the three inputs. The 3D projection rescales axes; it is not a map of every high-dimensional distance.

Sources and credits

Share it

This link opens it in the Playground. To put it on your own page, add the element and one script tag. Every option.

https://splashery.app/play/?toy=word-vectors<script type="module" src="https://splashery.app/play/src/element.js"></script> <splashery-toy toy="word-vectors"></splashery-toy>

Back to the machineThe AI and Computing machine

Nearby in the collection