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

Method __init__

intermediate_source/seq2seq_translation_tutorial.py:155–160  ·  view source on GitHub ↗
(self, name)

Source from the content-addressed store, hash-verified

153
154class Lang:
155 def __init__(self, name):
156 self.name = name
157 self.word2index = {}
158 self.word2count = {}
159 self.index2word = {0: "SOS", 1: "EOS"}
160 self.n_words = 2 # Count SOS and EOS
161
162 def addSentence(self, sentence):
163 for word in sentence.split(' '):

Callers 4

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected