// we choose to use a RNN instead.
answer.add(LSTM(32))
// one regularization layer -- more would probably be needed.
answer.add(Dropout(0.3))
answer.add(Dense(vocab_size))
// we output a probability distribution over the vocabulary
answer.add(Activation("softmax"))
After Change
// placeholders
input_sequence = Input((story_maxlen,))
question = Input((query_maxlen,))
// encoders
// embed the input sequence into a sequence of vectors