Created
March 12, 2020 10:22
-
-
Save aravindpai/18236d9fe523a561f73bb033234cb97d to your computer and use it in GitHub Desktop.
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
# load the whole embedding into memory | |
embeddings_index = dict() | |
f = open('../input/glove6b/glove.6B.300d.txt') | |
for line in f: | |
values = line.split() | |
word = values[0] | |
coefs = np.asarray(values[1:], dtype='float32') | |
embeddings_index[word] = coefs | |
f.close() | |
print('Loaded %s word vectors.' % len(embeddings_index)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment