text_plain_output_1.png
import gensim

import nltk

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

path = '../input/embeddings/GoogleNews-vectors-negative300/GoogleNews-vectors-negative300.bin'
embeddings = gensim.models.KeyedVectors.load_word2vec_format(path, binary=True)

pd.Series(embeddings['modi'][:5])

embeddings.most_similar('modi', topn=10)

url = 'https://bit.ly/2S2yXEd'
data = pd.read_csv(url)

doc1 = data.iloc[0, 0]

words = nltk.word_tokenize(doc1.lower())
temp = pd.DataFrame()
for word in words:
    try:
        print(word, embeddings[word][:5])
        temp = temp.append(pd.Series(embeddings[word][:5]), ignore_index=True)
    except:
        print(word, 'is not there')