# Keras Bidirectional LSTM: low training and validation loss but very bad predictions

I'm training a Bidirectional LSTM using Keras. My task is to predict the words order in a sentence, so, given a sentence, output of each timestep will be a real number: predicted real numbers of the sentence are ranked in order to obtain integer numbers, indicating the predicted position of the word in the sentence.

Example:

sentence -> "Nice I am"

predicted real numbers -> [0.2, 0.6, 0.4]

ranked real numbers -> [3,1,2]

Basically, I pad my sequences to 20, that is the max sequence length found in the dataset.

My model is the following:

model = tf.keras.Sequential()

• @Leevo my training set are ordered sentences, but my test set, of course, are unordered sentences. Could shuffle=True improve predictions? – pairon Apr 17 '20 at 18:35