Are you happy or sad?
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Well, if you wrote about it we might be able to figure it out with my new package: happyorsad
Happyorsad is a sentiment scorer. It uses the approach of Finn Årup Nielsen from Informatics and Mathematical Modelling at the Technical University of Denmark and this AFINN lists hosted in his Github repo.
Finn Årup Nielsen has constructed three lists that makes it possible to sentiment score in english, danish and using emoticons. There are already a few sentiment packages for english, but this is the first one for danish and as far as I now also the first one to sentiment score emoticons.
A big shout out to Finn for the lists.
If you want to try it out then just run the code below. Looking forward to your feedback!
if(!require("devtools")) install.packages("devtools")
devtools::install_github("56north/happyorsad")
# Examples of sentiment scoring
library(happyorsad)
# Score danish words
string_da <- 'Hvis ikke det er det mest afskyelige elendige flueknepperi...'
happyorsad(string_da, "da")
# Score english words
string_en <- 'This is utterly excellent!'
happyorsad(string_en, "en")
# Score emoticons
string_emoticon <- 'I saw that yesterday :)'
happyorsad(string_emoticon, "emoticon")
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.