WikiText¶
Various functions for accessing the WikiText datasets (WikiText-2 and WikiText-103).
-
dynn.data.wikitext.
download_wikitext
(path='.', name='2', force=False)¶ Downloads the WikiText from “http://www.fit.vutbr.cz/~imikolov/rnnlm”
Parameters:
-
dynn.data.wikitext.
load_wikitext
(path, name='2', eos=None)¶ Loads the WikiText dataset
Returns the train, validation test set, each as a list of sentences (each sentence is a list of words)
Parameters: Returns: dictionary mapping the split name to a list of strings
Return type:
-
dynn.data.wikitext.
read_wikitext
(split, path, name='2', eos=None)¶ Iterates over the WikiText dataset
Example:
for sent in read_wikitext("train", "/path/to/wikitext"): train(sent)
Parameters: Returns: list of words
Return type: