Skip to content

Instantly share code, notes, and snippets.

@arunm8489
Created August 1, 2020 14:24
Show Gist options
  • Save arunm8489/3ca17048444e0eabdda9efdc8bfd4400 to your computer and use it in GitHub Desktop.
Save arunm8489/3ca17048444e0eabdda9efdc8bfd4400 to your computer and use it in GitHub Desktop.
embedding_matrix = np.zeros((len(corpus) + 1, 300))
for i,word in enumerate(corpus):
if word in glove_dict.keys():
embedding_vec = glove_dict[word]
embedding_matrix[i] = embedding_vec
print(embedding_matrix.shape)
np.save('embedding_matrix_2.npy',embedding_matrix)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment