Sentiment analysis is one of the most common NLP problems. The goal is to analyze a text and predict whether the underlying sentiment is positive, negative or neutral. What can you use it for? Here are a few ideas - measure sentiment of customer support tickets, survey responses, social media, and movie reviews!
Try it now
Click this button to open a Workspace on FloydHub that will train this model.
Predicting sentiment of movie reviews
In this notebook we will build a Convolutional Neural Network (CNN) classifier to predict the sentiment (positive or negative) of movie reviews.
We will use the Stanford Large Movie Reviews dataset for training our model. The dataset is compiled from a collection of 50,000 reviews from IMDB. It contains an equal number of positive and negative reviews. The authors considered only highly polarized reviews. Negative reviews have scores ≤ 4 (out of 10), while positive reviews have score ≥ 7. Neutral reviews are not included. The dataset is divided evenly into training and test sets.
- Preprocess text data for NLP
- Build and train a 1-D CNN using Keras and Tensorflow
- Evaluate our model on the test set
- Run the model on your own movie reviews!