Running some sentences using Tyler Rinker’s Sentimentr. According to his page:

## [1] "do you like it?  But I hate really bad dogs"
## [2] "I am the best friend."                      
## [3] "Do you really like it?  I'm not a fan"

##    element_id sentence_id word_count  sentiment
## 1:          1           1          4  0.2500000
## 2:          1           2          6 -1.8677359
## 3:          2           1          5  0.5813777
## 4:          3           1          5  0.4024922
## 5:          3           2          4  0.0000000

Here we compare the results using different sentiment models in addition to Sentimentr. Unfortunately I have not been able to get Stanford’s wrapper to work in R yet.

## [1] "I haven't been sad in a long time."                     
## [2] "I am extremely happy today."                            
## [3] "It's a good day."                                       
## [4] "But suddenly I'm only a little bit happy."              
## [5] "Then I'm not happy at all."                             
## [6] "In fact, I am now the least happy person on the planet."
## [7] "There is no happiness left in me."                      
## [8] "Wait, it's returned!"                                   
## [9] "I don't feel so bad after all!"

## 
## 1: Yes
## 2: No
## 
## Enter an item from the menu, or 0 to exit
## Enter an item from the menu, or 0 to exit

## Warning in file.copy(stan, file.path(root, "/"), , TRUE): problem
## creating directory /tmp/Rtmp1O6kB6/stanford-corenlp-full-2017-06-09:
## Permission denied

## Warning in system(cmd, input = text.var, intern = TRUE,
## ignore.stderr = TRUE): running command '< '/tmp/Rtmp1O6kB6/
## file370538286fab' java -cp "/stanford-corenlp-full-2017-06-09/*" -mx5g
## edu.stanford.nlp.sentiment.SentimentPipeline -stdin 2>/dev/null' had
## status 1

## [1] "Processing sentence: i have not been sad in a long time"
## [1] "Processing sentence: i am extremely happy today"
## [1] "Processing sentence: its a good day"
## [1] "Processing sentence: but suddenly im only a little bit happy"
## [1] "Processing sentence: then im not happy at all"
## [1] "Processing sentence: in fact i am now the least happy person on the planet"
## [1] "Processing sentence: there is no happiness left in me"
## [1] "Processing sentence: wait its returned"
## [1] "Processing sentence: i do not feel so bad after all"

##   stanford sentimentr_jockers_rinker sentimentr_jockers sentimentr_huliu
## 1        0                      0.18               0.18             0.35
## 2        0                       0.6                0.6              0.8
## 3        0                      0.38               0.38              0.5
## 4        0                         0                  0                0
## 5        0                     -0.31              -0.31            -0.41
## 6        0                      0.04               0.04             0.06
## 7        0                     -0.28              -0.28            -0.38
## 8        0                     -0.14              -0.14                0
## 9        0                      0.28               0.28             0.38
##   sentimentr_sentiword RSentiment SA_GI SA_LM SA_QDAP meanr jockers bing
## 1                 0.18          1 -0.25     0   -0.25    -1    -0.5   -1
## 2                 0.65          1  0.33  0.33       0     1    0.75    1
## 3                 0.32          1   0.5   0.5     0.5     1    0.75    1
## 4                    0          0     0  0.25    0.25     1    0.75    1
## 5                -0.56         -1     1     1       1     1    0.75    1
## 6                 0.11          1  0.17  0.17    0.33     1    0.75    1
## 7                -0.05          1   0.5   0.5     0.5     1    0.75    1
## 8                -0.14         -1     0     0       0     0   -0.25    0
## 9                 0.24          0 -0.33 -0.33   -0.33    -1   -0.75   -1
##   afinn nrc sentences                                              
## 1    -2   0 I haven't been sad in a long time.                     
## 2     3   1 I am extremely happy today.                            
## 3     3   1 It's a good day.                                       
## 4     3   1 But suddenly I'm only a little bit happy.              
## 5     3   1 Then I'm not happy at all.                             
## 6     3   1 In fact, I am now the least happy person on the planet.
## 7     2   1 There is no happiness left in me.                      
## 8     0  -1 Wait, it's returned!                                   
## 9    -3  -1 I don't feel so bad after all!