Learn Emotion Analysis with R: Perform Sentiment Assessments, Extract Emotions, and Learn NLP Techniques Using R and Shiny by Partha Majumdar
Author:Partha Majumdar [Majumdar, Partha]
Language: eng
Format: epub
Publisher: BPB Publications
Published: 2021-08-15T00:00:00+00:00
The same word can be used to express a positive emotion in one context and a negative emotion in a different context.
Similarly, we can generate the list of words which express negative emotions.
We can now generate the sentiment score of each word using an inner join with the lexicon shown as follows:
v_word_count <- v_tidy_data %>%
inner_join(get_sentiments(v_lexicon)) %>%
count(word, sentiment, sort = TRUE)
## Joining, by = "word"
head(v_word_count, 15)
## # A tibble: 15 x 3
## word sentiment n
## <chr> <chr> <int>
## 1 system trust 45
## 2 management positive 25
## 3 management trust 25
## 4 solution positive 25
## 5 information positive 14
## 6 ministry joy 13
## 7 ministry positive 13
## 8 ministry trust 13
## 9 team trust 13
## 10 technology positive 12
## 11 architecture trust 10
## 12 government fear 10
## 13 government negative 10
## 14 assurance positive 9
## 15 assurance trust 9
We can see the number of times that each word expresses an emotion in the text. See the example of the word management in the preceding output. It expressed positive sentiments in 25 contexts, and it expressed the emotion of trust in 25 contexts.
We can visualize this output using the ggplot() function from the ggplot2 library shown as follows:
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Exploring Deepfakes by Bryan Lyon and Matt Tora(7375)
Robo-Advisor with Python by Aki Ranin(7270)
Offensive Shellcode from Scratch by Rishalin Pillay(5925)
Ego Is the Enemy by Ryan Holiday(4885)
Microsoft 365 and SharePoint Online Cookbook by Gaurav Mahajan Sudeep Ghatak Nate Chamberlain Scott Brewster(4655)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4414)
Python for ArcGIS Pro by Silas Toms Bill Parker(4000)
Elevating React Web Development with Gatsby by Samuel Larsen-Disney(3705)
Machine Learning at Scale with H2O by Gregory Keys | David Whiting(3413)
Learning C# by Developing Games with Unity 2021 by Harrison Ferrone(3253)
Speed Up Your Python with Rust by Maxwell Flitton(3214)
Liar's Poker by Michael Lewis(3191)
OPNsense Beginner to Professional by Julio Cesar Bueno de Camargo(3179)
Extreme DAX by Michiel Rozema & Henk Vlootman(3154)
Agile Security Operations by Hinne Hettema(3107)
Linux Command Line and Shell Scripting Techniques by Vedran Dakic and Jasmin Redzepagic(3097)
Essential Cryptography for JavaScript Developers by Alessandro Segala(3070)
Cryptography Algorithms by Massimo Bertaccini(2986)
AI-Powered Commerce by Andy Pandharikar & Frederik Bussler(2969)
