getting started with neural networks classifying movie reviewsa binary classification example two-class classificationor binary classificationmay be the most widely applied kind of machine-learning problem in this exampleyou'll learn to classify movie reviews as positive or negativebased on the text content of the reviews the imdb dataset you'll work with the imdb dataseta set of , highly polarized reviews from the internet movie database they're split into , reviews for training and , reviews for testingeach set consisting of negative and positive reviews why use separate training and test setsbecause you should never test machinelearning model on the same data that you used to train itjust because model performs well on its training data doesn' mean it will perform well on data it has never seenand what you care about is your model' performance on new data (because you already know the labels of your training data--obviously you don' need your model to predict thosefor instanceit' possible that your model could end up merely memorizing mapping between your training samples and their targetswhich would be useless for the task of predicting targets for data the model has never seen before we'll go over this point in much more detail in the next just like the mnist datasetthe imdb dataset comes packaged with keras it has already been preprocessedthe reviews (sequences of wordshave been turned into sequences of integerswhere each integer stands for specific word in dictionary the following code will load the dataset (when you run it the first timeabout mb of data will be downloaded to your machinelisting loading he imdb dat aset from keras datasets import imdb (train_datatrain_labels)(test_datatest_labelsimdb load_datanum_words= the argument num_words= means you'll only keep the top , most frequently occurring words in the training data rare words will be discarded this allows you to work with vector data of manageable size the variables train_data and test_data are lists of reviewseach review is list of word indices (encoding sequence of wordstrain_labels and test_labels are lists of and swhere stands for negative and stands for positivetrain_data[ [ train_labels[ licensed to