Skip to content

Instantly share code, notes, and snippets.

@joshkyh
Created January 30, 2018 10:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshkyh/bdc7821fc650563ffd3e2596fa3ff8ab to your computer and use it in GitHub Desktop.
Save joshkyh/bdc7821fc650563ffd3e2596fa3ff8ab to your computer and use it in GitHub Desktop.
Word2Vec Emotions
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