Last active
January 30, 2018 10:23
-
-
Save joshkyh/ac70176080a21ff5a800466cf169ac65 to your computer and use it in GitHub Desktop.
word2vec_emotions.py
This file contains 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
import gensim | |
from gensim.models.keyedvectors import KeyedVectors | |
# Load Google's pre-trained Word2Vec model. | |
model = KeyedVectors.load_word2vec_format('I:/Downloads/GoogleNews-vectors-negative300.bin/GoogleNews-vectors-negative300.bin', binary=True) | |
word1 = 'anger' | |
word2 = 'trust' | |
model.most_similar(positive = [word1, word2]) | |
word_w2v = 'resentment' | |
plutchik = 'dominance' | |
model.wv.similarity(word_w2v,plutchik) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment