Merge pull request #23929 from CastielWong:castielwong-patch-1
PiperOrigin-RevId: 225110544
This commit is contained in:
commit
7b9865971e
@ -91,7 +91,7 @@ vocabulary_size = 50000
|
|||||||
|
|
||||||
def build_dataset(words, n_words):
|
def build_dataset(words, n_words):
|
||||||
"""Process raw inputs into a dataset."""
|
"""Process raw inputs into a dataset."""
|
||||||
count = [['UNK', -1]]
|
count = [('UNK', -1)]
|
||||||
count.extend(collections.Counter(words).most_common(n_words - 1))
|
count.extend(collections.Counter(words).most_common(n_words - 1))
|
||||||
dictionary = dict()
|
dictionary = dict()
|
||||||
for word, _ in count:
|
for word, _ in count:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user