From the course: Text Analytics and Predictions with Python Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Preparing data for sentiment analysis

Preparing data for sentiment analysis - Python Tutorial

From the course: Text Analytics and Predictions with Python Essential Training

Start my 1-month free trial

Preparing data for sentiment analysis

- [Instructor] For the sentiment analysis example, we will use the file Movie-Reviews.txt. Please review the file. This file contains reviews by various users for the "Captain Marvel" movie. Some of these reviews are positive, some are negative, but mostly neutral. We will find the polarity and subjectivity of these reviews in this exercise. Let us look at the code now. The code is available inside the Jupyter Notebook, code_02_XX Sentiment Analysis. First, we load the file into a list of sentences. Given that we are using the Bag of Words technique, there is not much cleansing we need to do on this corpus. Let us print a couple of lines from the review to make sure that the lines have loaded properly. Let us execute this code.

Contents