fix keras import for pad_sequences

This commit is contained in:
kermorvant 2023-01-11 12:50:38 +01:00
parent b51c9c4f44
commit a9e7d0ead5

View File

@ -386,7 +386,7 @@
" accuracy_score)\n",
"\n",
"from keras.preprocessing import text, sequence\n",
"\n"
"from keras.utils import pad_sequences\n"
]
},
{
@ -417,8 +417,8 @@
" tokenizer.fit_on_texts(list(train_raw_text))\n",
" train_tokenized = tokenizer.texts_to_sequences(train_raw_text)\n",
" test_tokenized = tokenizer.texts_to_sequences(test_raw_text)\n",
" return sequence.pad_sequences(train_tokenized, maxlen=MAX_TEXT_LENGTH), \\\n",
" sequence.pad_sequences(test_tokenized, maxlen=MAX_TEXT_LENGTH)\n",
" return pad_sequences(train_tokenized, maxlen=MAX_TEXT_LENGTH), \\\n",
" pad_sequences(test_tokenized, maxlen=MAX_TEXT_LENGTH)\n",
"\n",
"\n",
"\n",