len(numpy.unique(numpy.hstack(X)))
np.unique(y)
len(numpy.unique(numpy.hstack(X)))
You would fixate random for reproducibility
seed = 7
numpy.ramdom.seed(seed)
model.summary()
import keras.preprocessing import sequence
sequence.pad_sequences(X_train, maxlen=max_words)
text = numpy.array([‘this is an excellent sentence’])
#print(text.shape)
tk = keras.preprocessing.text.Tokenizer( nb_words=2000, lower=True,split=” “)
tk.fit_on_texts(text)
prediction = model.predict(numpy.array(tk.texts_to_sequences(text)))
print(prediction)