'Vocab' object has no attribute 'itos'
I am building ML models for NLP with pytorch, but as I define vocabulary for tekenized words in my text with &quot;vacab&quot; and try to use vocab.itos I get: 'Vocab' object has no attribute 'itos' error.
This is my vocab:
vocab = torchtext.vocab.vocab(counter, min_freq=1)

How can I solve this problem?

You should access torchtext.vocab.Vocab.get_itos to get the indices-&gt;tokens mapping.
&gt;&gt;&gt; itos = vocab.get_itos()

