Once the model is trained, we want to use it to generate responses given an input tweet. The same can be done in the following steps:
- Replace the anonymized screen names in the input tweet with the common name.
- Convert the modified input tweet into word indices.
- Feed the word indices to the encoder LSTM and the START keyword to the decoder LSTM to generate the first predicted word. From the next step onward, feed the predicted word from the previous time step instead of the START keyword.
- Continue doing this until the end-of-sentence keyword is predicted. We have represented this with PAD.
- Look at the inverse vocabulary dictionary to get the words from the predicted word indexes.
The respond_to_input ...