diff --git a/lstm_word2vec.ipynb b/lstm_word2vec.ipynb index abf8a74..bf73507 100644 --- a/lstm_word2vec.ipynb +++ b/lstm_word2vec.ipynb @@ -1300,6 +1300,17 @@ "word2vec_model = gensim.models.Word2Vec(sentences=sent_lst, min_count=6, size=EMBEDDING_DIM, sg=1, workers=os.cpu_count())" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true, + "deletable": true, + "editable": true + }, + "outputs": [], + "source": [] + }, { "cell_type": "markdown", "metadata": { @@ -1337,7 +1348,7 @@ "print('Total %s word vectors.' % len(embeddings_index))\n", "\n", "# Initial embedding\n", - "embedding_matrix = np.zeros((VOCAB_SIZE + 1, EMBEDDING_DIM))\n", + "embedding_matrix = np.zeros((VOCAB_SIZE, EMBEDDING_DIM))\n", "\n", "for word, i in tok.word_index.items():\n", " embedding_vector = embeddings_index.get(word)\n",