Skip to content

Instantly share code, notes, and snippets.

Created Mar 12, 2020
What would you like to do?
# create a weight matrix for words in training docs
embedding_matrix = np.zeros((size_of_vocabulary, 300))
for word, i in tokenizer.word_index.items():
embedding_vector = embeddings_index.get(word)
if embedding_vector is not None:
embedding_matrix[i] = embedding_vector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment