Я получаю list object cannot be interpreted as integer
при попытке выполнить нижеуказанные последовательности Keras.
def tk(lines):
tokenizer = Tokenizer()
tokenizer.fit_on_texts(lines)
return tokenizer
toc_Eng = tk(data[:,0])
train, test = train_test_split(data, test_size=0.25, random_state = 5)
seq = toc_Eng.texts_to_sequences(train[:,0])
seq[0:10]
output: [[8, 114, 9],
[2, 149, 30, 22, 620],
[1, 19, 36, 398, 39],
[4, 23, 2744, 1275],
[1, 112, 666, 9],
[8, 203, 47, 6, 1632],
[24, 14, 90, 201, 193],
[8, 105, 1, 16, 692],
[29, 853, 226, 1, 287],
[65, 1, 1520]]
seq1 = pad_sequences(seq, maxlen = 12)
Это ошибка. Пожалуйста, дайте мне знать, что мне здесь не хватает.
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-18-7226268b5209> in <module>()
----> 1 pad_sequences(seq, Eng_len)
1 frames
/usr/local/lib/python3.6/dist-packages/numpy/core/numeric.py in full(shape, fill_value, dtype, order)
323 if dtype is None:
324 dtype = array(fill_value).dtype
--> 325 a = empty(shape, dtype, order)
326 multiarray.copyto(a, fill_value, casting='unsafe')
327 return a
TypeError: 'list' object cannot be interpreted as an integer