Chapter 17 Feature NRC Sentiments
We create the NRC Sentiments in the following section. We display the sentiment scores for Six lines of the train
dataset.
sentimentsTrain = get_nrc_sentiment(train$text)
sentimentsTest = get_nrc_sentiment(test$text)
kable(head(sentimentsTrain),"html") %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive")) %>%
scroll_box(width = "800px")
anger | anticipation | disgust | fear | joy | sadness | surprise | trust | negative | positive |
---|---|---|---|---|---|---|---|---|---|
0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 |
0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 |
1 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 |
0 | 2 | 0 | 0 | 3 | 1 | 1 | 2 | 0 | 5 |
1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 | 1 |
3 | 4 | 2 | 3 | 3 | 0 | 2 | 6 | 4 | 9 |