I am using keras model.predict after training my model for a sentence classification task. My code is
import numpy as np model = Sequential() l = ['Hello this is police department', 'hello this is 911 emergency'] tokenizer = Tokenizer() tokenizer.fit_on_texts(l) X = tokenizer.texts_to_sequences(l) X = np.array(X) a = model.predict(X) print(a) But the output seems to be an array,
[[1. 2. 3. 4. 5.] [1. 2. 3. 6. 7.]] I am working on a sentence classification task with 2 labels. So I wanted to predict these sentences as 0 or 1. But instead getting a numpy array. How do I code such that it predicts one of these two labels?