How to Predict Sentiment From Movie Reviews Using Deep Learning (Text Classification)

Last Updated on August 27, 2020

Sentiment analysis is a natural language processing problem where text is understood and the underlying intent is predicted.

In this post, you will discover how you can predict the sentiment of movie reviews as either positive or negative in Python using the Keras deep learning library.

After reading this post you will know:

  • About the IMDB sentiment analysis problem for natural language processing and how to load it in Keras.
  • How to use word embedding in Keras for natural language problems.
  • How to develop and evaluate a multi-layer perception model for the IMDB problem.
  • How to develop a one-dimensional convolutional neural network model for the IMDB problem.

Kick-start your project with my new book Deep Learning With Python, including step-by-step tutorials and the Python source code files for all examples.

Let’s get started.

  • Update Oct/2016: Updated for Keras 1.1.0 and TensorFlow 0.10.0.
  • Update Mar/2017: Updated for Keras 2.0.2, TensorFlow 1.0.1 and Theano 0.9.0.
  • Update Jul/2019: If you are using Keras 2.2.4 and NumPy 1.16.2+ and get “ValueError: Object arrays cannot be loaded when allow_pickle=False“, then try updating NumPy to 1.16.1, or update Keras to the version from github, or use
    To finish reading, please visit source site