2

I've been using R's sentiment package for sentiment analysis. I was shocked when some trivial negatives as positives for many of my documents. For instance

library("sentiment")
classify_polarity("Not good")

#      POS                NEG                 POS/NEG            BEST_FIT  
# [1,] "8.78232285939751" "0.445453222112551" "19.7154772340574" "positive"

I'm not sure what's happening behind this. Can someone clarify this?

rawr
  • 20,481
  • 4
  • 44
  • 78
Fitzerbirth
  • 133
  • 10
  • [possibly relevant](http://stackoverflow.com/questions/15194436/is-there-any-other-package-other-than-sentiment-to-do-sentiment-analysis-in-r). plus that function should not be returning a matrix, that was a poor design choice – rawr May 30 '16 at 15:04
  • @rawr thanks. I've just gone through the source code. This scores each word and summing up for the whole. "good" has relatively high score than "not", remains positive. Can I have any other proper implementation in R for sentiment analyis? – Fitzerbirth May 30 '16 at 15:13
  • did you click the link? – rawr May 30 '16 at 15:14
  • @rawr yes, qdap::polarity() gives average polarity. I hope this works for my purpose. – Fitzerbirth May 30 '16 at 15:18

1 Answers1

3

Thanks rawr. I found this helpful.

>library(qdap)
> polarity("Not Good")
  all total.sentences total.words ave.polarity sd.polarity stan.mean.polarity
  1 all               1           2       -0.707          NA                 NA
> polarity("It's cool but not great")
  all total.sentences total.words ave.polarity sd.polarity stan.mean.polarity
  1 all               1           5       -0.894          NA                 NA
> polarity("It's awesome")
  all total.sentences total.words ave.polarity sd.polarity stan.mean.polarity
  1 all               1           2        0.707          NA                 NA
Fitzerbirth
  • 133
  • 10