WikiText2 is a tokenized corpus of Wikipedia article text used to train and benchmark word-level language models and word embeddings. Its text preserves headings, paragraph boundaries, and special tokens, making preprocessing visible rather than hidden. section 6.3.3 section 8.5
A practical WikiText2 workflow typically includes:
- Batchify long sequences for efficient RNN, LSTM, or GRU training. section 8.4.1
Inspecting masked tokens
The PyTorch version replaces about 2.7% of tokens with <unk>. This supports prediction experiments but can limit accuracy and confuse a language model, so raw text can provide a cleaner comparison. section 8.5
