Last active
January 18, 2019 05:53
-
-
Save MLWhiz/3374d8cd11443b1a2de72207a66eaa5b to your computer and use it in GitHub Desktop.
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
| def load_glove_index(): | |
| EMBEDDING_FILE = '../input/embeddings/glove.840B.300d/glove.840B.300d.txt' | |
| def get_coefs(word,*arr): return word, np.asarray(arr, dtype='float32')[:300] | |
| embeddings_index = dict(get_coefs(*o.split(" ")) for o in open(EMBEDDING_FILE)) | |
| return embeddings_index | |
| glove_embedding_index = load_glove_index() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment