March 12, 2017

(This article was first published on R – FordoX, and kindly contributed to R-bloggers)

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
Very Positive

There are currently 3 methods in the package:

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

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. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)