We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 54fcf42 + f8d9dce commit 0bcfd44Copy full SHA for 0bcfd44
Ch4/03_Word2Vec_Example.ipynb
@@ -210,7 +210,7 @@
210
" feats = []\n",
211
" for tokens in list_of_lists:\n",
212
" feat_for_this = np.zeros(DIMENSION)\n",
213
- " count_for_this = 0\n",
+ " count_for_this = 0 + 1e-5 # to avoid divide-by-zero \n",
214
" for token in tokens:\n",
215
" if token in w2v_model:\n",
216
" feat_for_this += w2v_model[token]\n",
0 commit comments