Comment
Author: Admin | 2025-04-28
Ones (i.e., occurring more than100 times).Unsurprisingly, the name of the protagonist is the most frequent word in the novel followed by Catherine and Earnshaw. It’s quite interesting to see the word Linton between Heathcliff and Catherine: as the love story of Heathcliff and Catherine ends when Linton marries Catherine.Sentiment AnalysisThe genre of this book is described as Dark, Tragedy and Gothic Fiction. I will verify the same with the help of sentiment analysis. In the previous viz, we saw the frequent words used in the book. Next, you will how these words contribute to different sentiments. I will use one of the several sentiment lexicons provided by tidytext package which is “NRC” for sentiment analysis.nrc_emotions % filter(sentiment == "joy" | sentiment == "anger" | sentiment == "fear" | sentiment == "sadness")TB_emotions % inner_join(nrc_emotions) %>% count(word, sentiment) %>% arrange(sentiment)I extracted sentiment classifications from the NRC Word-Emotion Association Lexicon and selected four emotions: anger, fear, joy, and sadness. Indeed, tragedy seems to be the main theme in the life of these characters of Wuthering Heights.Word CloudFinally, I created a wordcloud of these words, visualizing positive vs negative sentiment of frequently occurring words using the “bing” sentiment lexicons.ConclusionThis was so much fun! Now you have seen a basic implementation of Sentiment Analysis using the tidytext package. If you want to get more insights, look up the book Text Mining with R. Thank you for reading!Code for the entire article found here.
Add Comment