未验证 提交 1fd12840 编写于 作者: T Tao Luo 提交者: GitHub

Merge pull request #9827 from sharannarang/sentiment_analysis

Add cutoff parameter to word_dict for IMDB
......@@ -124,7 +124,7 @@ def test(word_idx):
re.compile("aclImdb/test/neg/.*\.txt$"), word_idx)
def word_dict():
def word_dict(cutoff=150):
"""
Build a word dictionary from the corpus.
......@@ -132,7 +132,7 @@ def word_dict():
:rtype: dict
"""
return build_dict(
re.compile("aclImdb/((train)|(test))/((pos)|(neg))/.*\.txt$"), 150)
re.compile("aclImdb/((train)|(test))/((pos)|(neg))/.*\.txt$"), cutoff)
def fetch():
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册