in
21 pairs=[]
22 for input,target in zip(data['input'],data['target']):
---> 23 VOC.index_words(input)
24 VOC.index_words(target)
25 if len(input.split(' ')) in index_words(self, sentence)
8 def index_words(self, sentence):
9 for word in sentence.split(' '):
---> 10 self.index_word(word)
11
12 def index_word(self, word):
in index_word(self, word)
12 def index_word(self, word):
13 if word not in self.word2index:
---> 14 self.word2index[word]=self.n_words
15 self.word2count[word]=1
16 self.index2word[self.n_words]=word
TypeError: list indices must be integers or slices, not str
TypeError Traceback (most recent call last)