Я пытаюсь обучить RNN
бинарной классификации. Мой словарь состоит из 1000000 слов, и вы можете найти следующие результаты ...
text_field = torchtext.data.Field(tokenize=word_tokenize)
print(text_field.vocab.freqs.most_common(15))
>>
[('.', 516822), (',', 490533), ('the', 464796), ('to', 298670), ("''", 264416), ('of', 226307), ('I', 224927), ('and', 215722), ('a', 211773), ('is', 180965), ('you', 180359), ('``', 165889), ('that', 156425), ('in', 138038), (':', 132294)]
print(text_field.vocab.itos[:15])
>>
['<unk>', '<pad>', '.', ',', 'the', 'to', "''", 'of', 'I', 'and', 'a', 'is', 'you', '``', 'that']
text_field.vocab.stoi
>>
{'<unk>': 0,'<pad>': 1,'.': 2,',': 3,'the': 4,'to': 5,"''": 6,'of': 7,'I': 8,'and': 9,'a': 10, 'is': 11,'you': 12,'``': 13,'that': 14,'in': 15,....................
В документации сказано:
freqs – A collections.Counter object holding the frequencies of tokens in the data used to build the Vocab.
stoi – A collections.defaultdict instance mapping token strings to numerical identifiers.
itos – A list of token strings indexed by their numerical identifiers.
Что для меня непонятно.
Может кто-нибудь, пожалуйста, объясните, что это, давая интуицию каждого из этих ?
Например, если the
представлен как 4
, значит ли это, что если предложение содержит слово the
,
- Будет ли оно равно 1 в позиции 4? ИЛИ
- Будет ли 1 в позиции 464796 ИЛИ
- Будет ли 4 в позиции 464796 ??
Что произойдет, если несколько the
есть там ??