The objective of this chapter is to conduct a sentiment analysis of the Harry Potter novel series written by British author J.K. Rowling. The text of the series is collected from GitHub as an R package provided by Bradley Boehmke. The chapter analyzed the text by R programming to explore dominant sentiments using a lexicon approach of natural language processing (NLP). The results revealed that Professor Slughorn scored the most positive sentiment among the main characters that have heroic qualities; Death Eaters had the most negative sentiment among the anti-hero characters; negative sentiment in the text around the anti-hero characters increased significantly, while the positive sentiment around the hero characters remained constant as the story progressed throughout the series; among the series of novels, The Deathly Hallows contained the most negative sentiment; among all the houses of Hogwarts School of Witchcraft and Wizardry, Hufflepuff had the most positive sentiment; and each book of the series appeared negative until the final chapter, which always ended with a positive sentiment.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.