First of all I am new to Keras and ML.
I am trying https://github.com/fchollet/keras/blob/master/examples/pretrained_word_embeddings.py example.
I saved the trained model using model.save()
. Now I am writing a script to predict using another script:
model = load_model('./model.h5')
tokenizer = Tokenizer(num_words=MAX_NB_WORDS)
text = np.array(['some unseen text'])
tokenizer.fit_on_texts(text)
sequences = tokenizer.texts_to_sequences(text)
data = pad_sequences(sequences, maxlen=MAX_SEQUENCE_LENGTH)
prediction = model.predict(np.array(data))
The above returns something like:
[[ 1.00000000e+00 2.66153551e-18 1.67506186e-15 1.33851482e-16
2.85387820e-16 3.06079675e-15 1.34407281e-14 1.38863788e-15
4.20352726e-16 1.28687439e-15 1.52688925e-16]]
I would like to get the label names given in the training. Any idea how I can do this?
Thanks