Word Embedding Trainer
word2vec turns words into vectors with a simple trick: train a tiny network to predict which words appear near each other. This tool implements skip-gram with negative sampling from scratch and trains it live on whatever text you paste in. Words that share contexts drift together on an animated 2-D PCA projection of the embedding space while training runs; click any word (or pick one from the list) to see its nearest neighbours by cosine similarity, and try the analogy row, which computes vec(a) − vec(b) + vec(c) and finds the closest word. Choose the embedding dimension, the context window and the number of negative samples, and watch the epoch counter and the loss. A few kilobytes of text give rough embeddings, but related words visibly cluster.
Runs 100% in your browser — models are trained and computed locally on your device.
Read the full guide to this tool
Notes
- Skip-gram trains a word’s vector to score high with the vectors of words seen inside its context window and low with a handful of randomly drawn negative words — a binary logistic loss per pair.
- Negative sampling replaces the full softmax over the vocabulary with k sampled contrasts, cutting the cost per update from O(V) to O(k); negatives are drawn from the unigram distribution raised to the ¾ power.
- The famous analogy king − man + woman ≈ queen works because consistent semantic relations become near-parallel offsets in embedding space — but it needs corpora far larger than fit in a textarea.
- PCA projects the high-dimensional vectors onto the 2-D plane of maximum variance, so distances on screen only approximate the true cosine similarities.
- Runs 100% in your browser — models are trained and computed locally on your device.