【发布时间】:2018-02-22 11:00:55
【问题描述】:
>>> t = Tokenizer(num_words=3)
>>> l = ["Hello, World! This is so&#$ fantastic!", "There is no other world like this one"]
>>> t.fit_on_texts(l)
>>> t.word_index
{'fantastic': 6, 'like': 10, 'no': 8, 'this': 2, 'is': 3, 'there': 7, 'one': 11, 'other': 9, 'so': 5, 'world': 1, 'hello': 4}
我原以为 t.word_index 只包含前 3 个单词。我做错了什么?
【问题讨论】:
标签: machine-learning neural-network keras deep-learning tokenize