MCPcopy Create free account
hub / github.com/pytorch/examples / __init__

Method __init__

word_language_model/data.py:21–25  ·  view source on GitHub ↗
(self, path)

Source from the content-addressed store, hash-verified

19
20class Corpus(object):
21 def __init__(self, path):
22 self.dictionary = Dictionary()
23 self.train = self.tokenize(os.path.join(path, 'train.txt'))
24 self.valid = self.tokenize(os.path.join(path, 'valid.txt'))
25 self.test = self.tokenize(os.path.join(path, 'test.txt'))
26
27 def tokenize(self, path):
28 """Tokenizes a text file."""

Callers

nothing calls this directly

Calls 2

tokenizeMethod · 0.95
DictionaryClass · 0.85

Tested by

no test coverage detected