Case studies for document classifications
Since I have presented two viable alternatives for document classifications, this chapter will contain two separate examples for document classification. Both will use embedding layers. One will use an LSTM and the other will use a CNN.
We will also compare the performance between learning an embedding layer and, starting with someone else's weights, applying a transfer learning approach.
The code for both of these examples can be found in the Chapter10
folder in the book's Git repo. Some of the data and the GloVe vectors will need to be downloaded separately. Instructions to do so exist in comments within the code.
Sentiment analysis with Keras embedding layers and LSTMs
The first case study in this chapter will demonstrate sentiment analysis. In this example, we will get to apply most of the things we have learned in the chapter.
We will be using a dataset built into Keras from the Internet Movie DataBase (IMDB). This dataset contains 25,000 movies...