January 2018
Intermediate to advanced
474 pages
10h 23m
English
Now we do the same loading and preprocessing steps with the text8 dataset:
from datasetslib.text8 import Text8text8 = Text8()text8.load_data() # downloads data, converts words to ids, converts files to a list of idsprint('Train:', text8.part['train'][0:5])print('Vocabulary Length = ',text8.vocab_len)
We find the vocabulary length is about 254,000 words:
Train: [5233, 3083, 11, 5, 194] Vocabulary Length = 253854
Preparing the CBOW pairs:
text8.skip_window=2text8.reset_index_in_epoch() ...
Read now
Unlock full access