Site icon R-bloggers

RSentiment

[This article was first published on R – FordoX, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Every system needs continuous improvement. Feedback, positive or negative, plays an important role in that improvement. Humans are fairly instinctive in interpreting the tone of the feedback. But, to teach a machine to understand the same, is highly complex. Various algorithms and tools are available today to automatically identify and categorize opinions of any textual feedback.

The application of sentiment analysis is wide and useful. It gives us a wide overview of opinion regarding various topics. Sentiment analysis provides the ability to quickly understand the impact of any product or system and react accordingly.

In one of my works, I applied sentiment analysis to predict the opinion of students regarding various academic dimensions of an institute. It is published at Springer. I used R for the purpose and was playing around with various packages already existing at CRAN but none of them was working according to my need. So, I conceptualized a tool, which applies text mining techniques to elicit insights from textual data and  published it as an open source package (RSentiment) to CRAN.

The algorithm uses Parts of Speech tagging to tag each word in the sentence. I designed various cases on sequence of occurrence of various parts of speech. I checked if there is any adverb or adjective bearing positive score following any negative quantifier  “not” , “no” and accordingly assigned score to it. The package categorizes sentences into 5 categories like:

Very Negative
Negative
Neutral
Positive
Very Positive

There are currently 3 methods in the package:

calculate_score: calculates score of a sentence or a collection of sentences as 
text.

calculate_sentiment: classifies a sentence or a text into a sentiment category.

calculate_total_presence_sentiment: calculates total number of sentences 
in each sentiment category.

I am working on it for further improvements. Any feedback will be highly appreciated. My package might be able to benefit from it.

 

 

 


To leave a comment for the author, please follow the link and comment on their blog: R – FordoX.

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.