How shimingyoung/word2vec works
This is the word2vec toolkit: it optionally forms phrases from corpus text, trains CBOW or Skip-gram word embeddings, and provides tools to explore similarities, solve analogies, and evaluate analogy accuracy. The core training code also builds vocabulary, supports hierarchical softmax and negative sampling, and can emit word clusters. The map focuses on runtime tools and their file-based inputs and outputs; relationships come from the README or sampled source excerpts. Demo scripts are not mapped as runtime components.
Main entry points: word2vec.c Embedding trainer · word2phrase.c Phrase detection · compute-accuracy.c Analogy accuracy · distance.c Similarity search
Components 12
Text preparation
- Phrase detection
word2phrase.c - Phrase corpus
Embedding training
- Vocabulary building
word2vec.c - Embedding trainer
word2vec.c - Word vectors
- Word clusters
Vector exploration
- Similarity search
distance.c - Analogy search
word-analogy.c
Model evaluation
- Analogy accuracy
compute-accuracy.c
Other components
- User
- Text corpus
- Analogy questions
Connections 15
- User → Phrase detection: runs
word2phrase.c - Text corpus → Phrase detection: reads
word2phrase.c - Phrase detection → Phrase corpus: writes
word2phrase.c - User → Embedding trainer: configures
README.txt - Text corpus → Vocabulary building: reads
word2vec.c - Embedding trainer → Vocabulary building: builds
word2vec.c - Embedding trainer → Word vectors: writes
word2vec.c - Embedding trainer → Word clusters: writes
word2vec.c - User → Similarity search: queries
distance.c - Word vectors → Similarity search: reads
distance.c - User → Analogy search: queries
word-analogy.c - Word vectors → Analogy search: reads
word-analogy.c - User → Analogy accuracy: runs
compute-accuracy.c - Word vectors → Analogy accuracy: reads
compute-accuracy.c - Analogy questions → Analogy accuracy: supplies
compute-accuracy.c