Understanding Data for Sentiment Analysis
Sentiment analysis is a type of text classification. Sentiment analysis models are usually trained using supervised datasets. Supervised datasets are a kind of dataset that is labeled with the target variable, usually a column that specifies the sentiment value in the text. This is the value we want to predict in the unseen text.
Exercise 8.02: Loading Data for Sentiment Analysis
In this exercise, we will load data that could be used to train a sentiment analysis model. For this exercise, we will be using three datasets—namely Amazon, Yelp, and IMDb.
Note
You can find the data being used in this exercise here: https://packt.live/2XgeQqJ.
Follow these steps to implement this exercise:
- Open a Jupyter notebook.
- Insert a new cell and add the following code to import the necessary libraries:
import pandas as pd pd.set_option('display.max_colwidth', 200)
This imports the
pandas
library. It also sets the display...