Fitzerbirth
Fitzerbirth

Reputation: 143

Confused with "sentiment" package in R?

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?

Upvotes: 2

Views: 126

Answers (1)

Fitzerbirth
Fitzerbirth

Reputation: 143

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

Upvotes: 3

Related Questions