In this example, we will design a neural network to perform two-class classification, or binary classification, of reviews, from the IMDB movie reviews dataset, to determine whether the reviews are positive or negative.
The IMDB dataset is a set of 50,000 highly polarized reviews from the Internet Movie Database. They are split into 25000 reviews each for training and testing. Each set contains an equal number (50%) of positive and negative reviews. The IMDB dataset comes packaged with Keras. It consists of reviews and their corresponding labels (0 for negative and 1 for positive review). The reviews are a sequence of words. They come preprocessed as a sequence of integers, where each integer stands for a specific word in the dictionary. The IMDB dataset can be loaded directly from Keras and will usually download about 80 MB on your machine.