From the course: Data Science Foundations: Data Mining in Python

Unlock the full course today

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

Sentiment analysis: Sentiment scoring

Sentiment analysis: Sentiment scoring - Python Tutorial

From the course: Data Science Foundations: Data Mining in Python

Start my 1-month free trial

Sentiment analysis: Sentiment scoring

- [Instructor] If you've studied literature, you may know about the narrative arc. It's a very common pattern of the progress of the action or the emotions in a story. One of the really neat things about sentiment analysis is we can actually get a visualization of the narrative arc at least the emotional content in open structured text. To do this, we're going to be scoring the sentiment that is we're going to be putting number values, not just whether as positive or negative but how positive and how negative. Let me show you how we can do this. First, we're going to need to load a new package called afinn, A-F-I-N-N. And you can either uncomment this command and run it or uncomment and run these two commands. That's what I did. But once you've installed afinn, then we'll load a number of libraries, including afinn for our sentiment values. We'll import the data we're using the Iliad. There is the imported texts the way…

Contents