The sequence-to-sequence model architecture is well suited for capturing the context of the customer input and then generating appropriate responses based on that. Figure 8.2 shows a sequence-to-sequence model framework that can respond to questions just as a chatbot would:
We can see from the preceding diagram (Figure 8.2) that the Encoder LSTM takes the input sequence of words and encodes it into a hidden state vector, , and a cell state vector, . The vectors, , and are the hidden and cell states of the last step of the LSTM encoder. They would essentially capture the context of the whole input sentence.
The encoded information in the form of and is then fed to the Decoder LSTM as its initial hidden and cell states. The Decoder LSTM in each step tries to predict the next word...