Skip to content

Instantly share code, notes, and snippets.

@DerekChia
Last active December 3, 2018 10:32
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 DerekChia/b65ef4808b62c6e1c4c289aac73888c3 to your computer and use it in GitHub Desktop.
Save DerekChia/b65ef4808b62c6e1c4c289aac73888c3 to your computer and use it in GitHub Desktop.
w2v_get_vector
# Get vector for word
vec = w2v.word_vec("machine")
class word2vec():
## Removed ##
# Get vector from word
def word_vec(self, word):
w_index = self.word_index[word]
v_w = self.w1[w_index]
return v_w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment