Skip to content

Instantly share code, notes, and snippets.

@eisenjulian
Last active March 4, 2018 23:37
Show Gist options
  • Save eisenjulian/6f0add8a141931637210b9a1ebba29f6 to your computer and use it in GitHub Desktop.
Save eisenjulian/6f0add8a141931637210b9a1ebba29f6 to your computer and use it in GitHub Desktop.
embeddings = {}
with open('glove.6B.50d.txt', 'r', encoding='utf-8') as f:
for line in f:
values = line.strip().split()
w = values[0]
vectors = np.asarray(values[1:], dtype='float32')
embeddings[w] = vectors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment