Quellcode durchsuchen

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 vor 6 Jahren
Ursprung
Commit
796de7c657
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  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",