liveBook · Manning

Word2Vec

As explained in Data Without Labels

Word2Vec is a family of neural language models that learns vector representations of words from their surrounding context in a text corpus.

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.
figure

Use the relationship diagram to inspect how word embeddings place analogous word pairs in relation to one another. section 7.13

How Data Without Labels covers it

How deep it goes
Explains embeddings, co-occurrence, CBOW, and skip-gram, then defers the mathematical foundation while supporting Python implementation.
Examples
Uses the men–women and king–queen analogy to illustrate relational structure in vector space.
What it assumes
Assumes text-corpus data and basic representation methods while introducing contextual word vectors from their working mechanism.
What you can do after
Evaluate/understand contextual word representations and develop Word2Vec models with Python.
How it connects
Connects word embeddings with co-occurrence, CBOW, continuous skip-gram, GloVe, bag-of-words, and one-hot encoding.

Also explained in

Compare how 3 books explain Word2Vec →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Without Labels. The section links point to the parts of the book it draws on.