Skip to content

Commit fc346e3

Browse files
committed
Add cutoff parameter to build_dict.
1 parent 873cb9b commit fc346e3

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)