keras predict

Train the model, and when you are happy then....

prediction = model.predict(np.array(tk.texts_to_sequences(text)))
print(prediction)

Fuller example

Using my FontLetter class, I have already generated a model. So I load the Model and train_test

from keras.models import load_model
basic=load_model('simple_model_full.h5')
print("simple_model_full.hd5 successfully loaded")
import numpy as np

#Generate new data to test in the model
#Note: No test & train data needed

from FontLetter import FontLetter
fl=FontLetter()

#Test ths model
for n in range(26):
    #Generate Array - reshape - scale (0-255)
    unk=fl.char_img_array_greyscale(chr(97+n),fsize=20).reshape(1,28*28)/255

    prediction=basic.predict(unk)

    values=list(prediction[0])
    max_value = max(values)
    max_index = values.index(max_value)
    if max_index != n:
        print("Error {} predicted as {} ".format(chr(97+n),chr(97+max_index)))