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

Unlock the full course today

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

Solution: Sentiment scoring

Solution: Sentiment scoring

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

Start my 1-month free trial

Solution: Sentiment scoring

(upbeat music) - [Instructor] Hopefully, you've taken up the challenge to do a little bit of exploration of the text of Little Women and specifically to do sentiment scoring and find the emotional arc of the story. Let me show you how I did this one. I'm going to start by loading the packages and then coming down and importing the data, that is, the text of Little Women, and save it as a Tibble. We'll take a look at the first few lines and it's just the title page here. Let's prepare the data and I'm going to be using code that's very similar to what we used for the Iliad. I'm going to begin by adding line numbers because this is going to allow me to split up the text into lines and I'll remove the Gutenberg book ID number. We'll overwrite the data and now you can see Little Women and we have the first 10 lines there. And then we'll tokenize the data. We'll take the text and split it into words and we'll call that…

Contents