最佳答案
有时,情况要求我们做以下事情:
from keras.preprocessing.text import Tokenizer
tokenizer = Tokenizer(num_words=my_max)
然后,我们不约而同地吟诵这句咒语:
tokenizer.fit_on_texts(text)
sequences = tokenizer.texts_to_sequences(text)
While I (more or less) understand what the total effect is, I can't figure out what each one does separately, regardless of how much research I do (including, obviously, the documentation). I don't think I've ever seen one without the other.
那么每个人都做些什么呢?在任何情况下,你会使用其中一种而不使用另一种吗?如果不是,为什么它们不简单地组合成这样的东西:
sequences = tokenizer.fit_on_texts_to_sequences(text)
很抱歉我漏掉了一些显而易见的东西,但是我在这方面还是个新手。