Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
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
492
def
indexesFromSentence(voc, sentence):
493
return
[voc.word2index[word]
for
word in sentence.split(
' '
)] + [EOS_token]
494
495
496
def
zeroPadding(l, fillvalue=PAD_token):
Callers
3
inputVar
Function · 0.70
outputVar
Function · 0.70
evaluate
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected