Here, we are going to train our word2vec model. The dataset that I'm going to use is text data of Game of Thrones. So, our formal goal is to develop word2vec to explore semantic similarities between the entities of A Song of Ice and Fire (from the show Game of Thrones). The good part is we are also doing visualization on top of that, to get a better understanding of the concept practically. The original code credit goes to Yuriy Guts. I have just created a code wrapper for better understanding.
I have used IPython notebook. Basic dependencies are gensim, scikit-learn, and nltk to train the word2vec model on the text data of Game of Thrones. You can find the code on this GitHub link:
https://github.com/jalajthanaki/NLPython/blob/master/ch6/gameofthrones2vec/gameofthrones2vec.ipynb.
The code contains inline comments and you can see the snippet...
https://github.com/jalajthanaki/NLPython/blob/master/ch6/gameofthrones2vec/gameofthrones2vec.ipynb.
The code contains inline comments and you can see the snippet...