>>> t = Tokenizer(num_words=3)
>>> l = [\"Hello, World! This is so$ fantastic!\", \"There is no other world like this one\"]
>>> t.f
There is nothing wrong in what you are doing. word_index
is computed the same way no matter how many most frequent words you will use later (as you may see here). So when you will call any transformative method - Tokenizer
will use only three most common words and at the same time, it will keep the counter of all words - even when it's obvious that it will not use it later.