Created
January 1, 2019 10:42
-
-
Save arshjat/fa6eabf01ed2df6bb171ff7754b2fd48 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
embedding_path = "path-to-word-embedding" | |
embed_size = "dimension of embedding vectors" | |
max_features = 30000 | |
def get_coefs(word,*arr): return word, np.asarray(arr, dtype='float32') | |
embedding_index = dict(get_coefs(*o.strip().split(" ")) for o in open(embedding_path)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment