Basic idea of Word2Vec
Word2Vec models only have three layers; the input layer, the projection layer, and the output layer. There are two models that come with it, namely the Continuous Bag of Words (CBOW) model and the Skip-Gram model. They are very similar but differ in how the input layer and output layer are constructed. The Skip-Gram model has each target word (for example, mat) as the input and predicts the context/surrounding words as the output (the cat sits on the). On the other hand, CBOW starts from source context words (the cat sits on the), does aggregation and transformation using the middle layer, and predicts the target word (mat). The following figure illustrates the differences:
Take the CBOW model as an example. Each word ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access