In the previous chapter, we looked at multiple ways of representing text as a vector and then performed sentiment classification on top of those representations.
One of the drawbacks of this approach is that we did not take the order of words into consideration—for example, the sentence A is faster than B would have the same representation as B is faster than A, as the words in both sentences are exactly the same, while the order of words is different.
Recurrent neural networks (RNNs) come in handy in scenarios when the word order needs to be preserved. In this chapter, you will learn about the following topics:
- Building RNN and LSTM from scratch in Python
- Implementing RNN for sentiment classification
- Implementing LSTM for sentiment classification
- Implementing stacked LSTM for sentiment classification