Week10A
Approach
For this assignment, my plan is to follow the example from Chapter 2 of Text Mining with R: A Tidy Approach and reproduce the sentiment analysis process in R using a Quarto file.
Step 1: Reproduce the base example
First, I will recreate the main sentiment analysis example from Chapter 2. I will use the same general idea shown in the chapter, which is to take a text, turn it into a tidy format, and then connect the words to a sentiment lexicon.
To do this, I will:
- load the needed R packages
- bring in the original text data used for the example
- break the text into individual words
- remove words that are not useful for sentiment analysis
- join the words with a sentiment lexicon
- summarize the sentiment results
- create a simple visual to show the sentiment pattern
This part is important because the assignment requires to reproduce the original example code.
Step 2: Cite the source
I will include a citation to Text Mining with R: A Tidy Approach by Julia Silge and David Robinson, and I will state that the reproduced example comes from Chapter 2 of the book website.
Step 3: Extend the analysis with a different text corpus
After reproducing the original example, I will extend the analysis by using a different text corpus. Instead of only using the text from the original example, I will choose another text source and run the same type of sentiment analysis on it.
My goal here is to show that the sentiment results can change depending on the kind of text being analyzed.
Step 4: Add one more sentiment lexicon
Next, I will add one additional sentiment lexicon. The original chapter uses sentiment lexicons for text mining, so in my extension I will compare results by using another lexicon as well. This will help me see if the sentiment results stay similar or change when a different lexicon is used.
Step 5: Compare the results
At the end, I will explain how my extended analysis differs from the original example. I focus on simple comparison points such as:
- if the second text looks more positive or more negative
- if the additional lexicon gives similar or different results
- which words seem to drive the sentiment most strongly
Overall, my approach is to first reproduce the Chapter 2 example correctly, and then extend it in a simple way that still meets all assignment requirements.