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

Unlock the full course today

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

Sentiment analysis: Binary classification

Sentiment analysis: Binary classification - Python Tutorial

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

Start my 1-month free trial

Sentiment analysis: Binary classification

- [Instructor] The first kind of text mining that we want to look at is what I'm calling binary classification of sentiment. And what that means is looking at the words in the text and deciding if they are either positive or negative. So simply those two categories, positive or negative without quantifying the degree. That's something we're going to do in a later example. But let me show you how this works with "The Iliad". First thing you need to do is you are going to need to install a library NLTK for natural language toolkit. You might be able to uncomment this command and run it. Or in my case, I had to uncomment these two lines and run those. But once you have NLTK installed, then we're going to load a bunch of libraries. We're going to bring in regular expressions, NLTK, some plotting and pandas. And then we're going to bring in some corpora. These are things that let us know what certain kinds of words are, both how…

Contents