Week 10 Assignment 10A Approach - Sentiment Analysis
Introduction (Approach)
For this assignment, I will first reproduce the main sentiment analysis example from Chapter 2 of Text Mining with R by Julia Silge and David Robinson.
To extend the example, I will use Crime and Punishment by Fyodor Dostoevsky. I plan to download the English translation by Constance Garnett from Project Gutenberg using the gutenbergr package. I expect this will lean more negative/darker than the Austen example from the book.
I will split the text into words with unnest_tokens() and track sentiment through the novel in sections of about 80 lines same as the book example. I also plan to label each line with its part and chapter so I can see where the biggest shifts happen. The book’s example uses three lexicons: AFINN, Bing, and NRC. As my additional lexicon, I plan to use the syuzhet lexicon from the syuzhet package which was built specifically for tracking emotion in stories. I will compare all four lexicons on the novel to see whether they agree on the overall pattern.
I’m curious to see the results and compare them with my own understanding of the novel. I expect some words to be scored in ways that don’t fit the story which is something the book points out with Austen. For example, a word like “crime” may be treated as negative even when it appears in the title so I will check the most common positive and negative words for anything misleading.