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

Function indexesFromSentence

beginner_source/chatbot_tutorial.py:492–493  ·  view source on GitHub ↗
(voc, sentence)

Source from the content-addressed store, hash-verified

490#
491
492def indexesFromSentence(voc, sentence):
493 return [voc.word2index[word] for word in sentence.split(' ')] + [EOS_token]
494
495
496def zeroPadding(l, fillvalue=PAD_token):

Callers 3

inputVarFunction · 0.70
outputVarFunction · 0.70
evaluateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected