MCPcopy Index your code
hub / github.com/pytorch/tutorials / addWord

Method addWord

beginner_source/chatbot_tutorial.py:281–288  ·  view source on GitHub ↗
(self, word)

Source from the content-addressed store, hash-verified

279 self.addWord(word)
280
281 def addWord(self, word):
282 if word not in self.word2index:
283 self.word2index[word] = self.num_words
284 self.word2count[word] = 1
285 self.index2word[self.num_words] = word
286 self.num_words += 1
287 else:
288 self.word2count[word] += 1
289
290 # Remove words below a certain count threshold
291 def trim(self, min_count):

Callers 2

addSentenceMethod · 0.95
trimMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected