소스 검색

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 년 전
부모
커밋
796de7c657
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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",