Let's Learn NLP in 5 minutes (Part 7)
Let's Learn NLP in 5 minutes (Part 7)
Let’s Learn
NLP
in 5 minutes
PART 7
Word2Vec
Word2Vec
CBOW Skip-Gram
Predict the target word using its Predict the surrounding (context)
surrounding (context) words. words given a target word.
Example:
Sentence: "I love learning NLP every day."
Window size = 2 (meaning 2 words before and 2 words after target word)
Skip-Gram Model
The Skip-gram model works in the opposite way to CBOW. It takes a
target word as input and predicts the context words that are most
likely to surround it.
Example:
Sentence: "I love learning NLP every day."
Differences between
Skip-Gram and CBOW
Focus Works well for rare words Works well for frequent words
Implementation
CBOW Implementation:
Skip-Gram Implementation:
If you
find this
helpful, please
like and share
it with your
friends
for PART 8
@manidweepsharma