Semantic Analysis
Works out what text means, not just how it is spelled.
The idea
Words that appear in similar contexts get similar vectors (embeddings). The meaning of a sentence can then be compared geometrically: "car" lies near "vehicle" and far from "banana". Cosine similarity measures the angle between two vectors.
cos(a, b) = a·b / (‖a‖‖b‖)
Watch it run
This is a real computation, not a drawing. Pause, step, change the settings, or try new random data.
- word
- nearest word
Each word is a point (a vector) placed so that related words sit near each other. Real embeddings have hundreds of dimensions; this map has two: left–right is gender, up–down is royalty.
Positions are hand-set to make the idea visible; real vectors are learned from text.
Step by step
- 1Map each word or sentence to a vector.
- 2Compare vectors with cosine similarity.
- 3Group or rank by similarity, or feed the vectors to a classifier.
- 4Optionally resolve word sense and relations between phrases.
Where it is used
Semantic search, duplicate detection, question answering.
Watch out for
Embeddings capture bias in their training data, and one vector per word cannot separate different senses.