fix keras import for pad_sequences
This commit is contained in:
parent
b51c9c4f44
commit
a9e7d0ead5
|
@ -386,7 +386,7 @@
|
||||||
" accuracy_score)\n",
|
" accuracy_score)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"from keras.preprocessing import text, sequence\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",
|
" tokenizer.fit_on_texts(list(train_raw_text))\n",
|
||||||
" train_tokenized = tokenizer.texts_to_sequences(train_raw_text)\n",
|
" train_tokenized = tokenizer.texts_to_sequences(train_raw_text)\n",
|
||||||
" test_tokenized = tokenizer.texts_to_sequences(test_raw_text)\n",
|
" test_tokenized = tokenizer.texts_to_sequences(test_raw_text)\n",
|
||||||
" return sequence.pad_sequences(train_tokenized, maxlen=MAX_TEXT_LENGTH), \\\n",
|
" return pad_sequences(train_tokenized, maxlen=MAX_TEXT_LENGTH), \\\n",
|
||||||
" sequence.pad_sequences(test_tokenized, maxlen=MAX_TEXT_LENGTH)\n",
|
" pad_sequences(test_tokenized, maxlen=MAX_TEXT_LENGTH)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"\n",
|
"\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user