Created
December 24, 2018 21:58
-
-
Save pravj/5075bd9fdd7b093ceee1b4da80b249f3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gensim.models.keyedvectors import KeyedVectors | |
# load local word2vec model | |
model = KeyedVectors.load_word2vec_format( | |
os.getenv('SEMANTRIS_SOLVER_WORD2VEC_PATH'), | |
binary=True | |
) | |
# list of tuples containing the word and similarity score | |
associated_word_tuples = model.most_similar(word, topn=20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment