Word2Vec is a family of prediction-based models that learns compact vector representations of words from a large text corpus. Words appearing in similar contexts receive nearby vectors, allowing the representation to capture semantic relationships more effectively than one-hot encoding or bag-of-words. section 7.13 section 7.14
Word2Vec uses two related learning objectives:
- Continuous bag of words (CBOW) predicts the current target word from a surrounding context window. section 7.14
- Continuous skip-gram uses the current word to predict surrounding context words, weighting neighboring words more heavily than distant words. section 7.14
The learned vectors encode relationships through co-occurrence: words that frequently share contexts become close in the vector space. Word2Vec is prediction-based, whereas GloVe is frequency-based. The underlying mathematics is deferred, but Python code can be used to develop the models. section 7.14 section 7.13
Relational word vectors
Vector relationships can represent analogies such as men-to-women and king-to-queen, where both express a male-to-female relationship. section 7.13
Figure 7.16 Word embeddings can be used to represent the relationships between words. For example, there is a relation from “men” to “women” that is similar to “king” to “queen” as both “men-women” and “king-queen” represent the male-female gender relationship.
Use the relationship diagram to inspect how word embeddings place analogous word pairs in relation to one another. section 7.13


