graykode / nlp-tutorial

Natural Language Processing Tutorial for Deep Learning Researchers
https://www.reddit.com/r/MachineLearning/comments/amfinl/project_nlptutoral_repository_who_is_studying/
MIT License
14.31k stars 3.95k forks source link

Added cbow method. #16

Closed us closed 5 years ago

us commented 5 years ago

Inverted skip-gram files output and input to cbow method.

graykode commented 5 years ago

Thanks ! but I think it's wrong about CBOW In CBOW mathematical expression, P(w_target|{set of w_context}), not cbows.append([w, target]) So cbows.append([context, target]) maybe right. @us

graykode commented 5 years ago

image mathematical expression reference : http://mccormickml.com/assets/word2vec/Alex_Minnaar_Word2Vec_Tutorial_Part_II_The_Continuous_Bag-of-Words_Model.pdf

graykode commented 5 years ago

@us please see this code! https://github.com/FraLotito/pytorch-continuous-bag-of-words/blob/master/cbow.py#L43