Closed us closed 5 years ago
and change file name to Word2Vec-Torch-SkipGram(Softmax).py
@us Could you tell me what is different with my Skip-gram code?!
@us Ok I will change my file name, then after I will wait CBOW code ! Thanks
@us See my Commits https://github.com/graykode/nlp-tutorial/commit/6a2a47a1146c6f53effaa44072db155bdc1338ae I will close this Pr, Thanks!
Just changed w
and target
location.
If you know CBOW, that is learning to predict the word by the context.
The skip-gram model is designed to predict the context.
I changed there :
for w in context:
skip_grams.append([w, target])
https://stackoverflow.com/questions/38287772/cbow-v-s-skip-gram-why-invert-context-and-target-words
Word2Vec has 2 methods skip-grams and CBOW(Continous Bag of Words) and I added CBOW method.