From the course: Build Three Real-World Python Applications

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

How to perform Vader sentiment analysis

How to perform Vader sentiment analysis - Python Tutorial

From the course: Build Three Real-World Python Applications

How to perform Vader sentiment analysis

- [Instructor] Now we will learn about the sentiment of our text. We will perform a sentiment analysis, which means that we will understand the emotions and whether they're positive, negative, or neutral within our novel. We will use the Vader sentiment analysis algorithm to perform our analysis. We will begin by initializing our Vader sentiment analyzer with the code analyzer = SentimentIntensityAnalyzer. And you'll run this to initialize it. Now that we have initialized our analyzer variable, we can begin gathering the sentiment scores from our data. We will start with getting the compound score, which is the overall sentiment score for our text with the range from -1 to 1 and its values. We will begin by creating our sentences compound column in our sentences data frame that we created earlier. So here we will equal this column to the column analyzer and we'll use the polarity_scores method on our variable x that we will…

Contents