Last active
December 3, 2018 10:32
-
-
Save DerekChia/b65ef4808b62c6e1c4c289aac73888c3 to your computer and use it in GitHub Desktop.
w2v_get_vector
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
# 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