We will learn how to teach a recurrent neural network (RNN) how it can create a sequence of text. In simple words, the RNN model that we will build now will be able to predict the next word, given some context. This is just like the Swift app on your phone, which guesses the next word that you are typing. The ability to generate sequential data has applications in many different areas, such as:
- Image captioning
- Speech recognition
- Language translation
- Automatic email reply
We learnt in Chapter 6, Deep Learning with Sequence Data and Text, that RNNs are tough to train. So, we will be using a variant of RNN called Long Short-Term Memory (LSTM). The development of the LSTM algorithm started in 1997 but became popular in the last few years. It became popular due to the availability of powerful hardware and quality data, and some advancements such as dropout also...