Jelajahi Sumber

Bug in range(len(count) - 1, -1) (#292)

Bug in  range(len(count) - 1, -1) ,need 3 arguments here, otherwise the result is empty
scyes 6 tahun lalu
induk
melakukan
796de7c657
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      notebooks/2_BasicModels/word2vec.ipynb

+ 1 - 1
notebooks/2_BasicModels/word2vec.ipynb

@@ -116,7 +116,7 @@
     "# Retrieve the most common words\n",
     "count.extend(collections.Counter(text_words).most_common(max_vocabulary_size - 1))\n",
     "# Remove samples with less than 'min_occurrence' occurrences\n",
-    "for i in range(len(count) - 1, -1):\n",
+    "for i in range(len(count) - 1, -1, -1):\n",
     "    if count[i][1] < min_occurrence:\n",
     "        count.pop(i)\n",
     "    else:\n",