Skip to content

Commit 1fd1284

Browse files
authored
Merge pull request #9827 from sharannarang/sentiment_analysis
Add cutoff parameter to word_dict for IMDB
2 parents 90abd9d + 09c1c69 commit 1fd1284

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/paddle/v2/dataset/imdb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ def test(word_idx):
124124
re.compile("aclImdb/test/neg/.*\.txt$"), word_idx)
125125

126126

127-
def word_dict():
127+
def word_dict(cutoff=150):
128128
"""
129129
Build a word dictionary from the corpus.
130130
131131
:return: Word dictionary
132132
:rtype: dict
133133
"""
134134
return build_dict(
135-
re.compile("aclImdb/((train)|(test))/((pos)|(neg))/.*\.txt$"), 150)
135+
re.compile("aclImdb/((train)|(test))/((pos)|(neg))/.*\.txt$"), cutoff)
136136

137137

138138
def fetch():

0 commit comments

Comments
 (0)