Protection Order Sentiment Analysis - Initial Exploration

Purpose/Context:

Apply R's "sentimentr" package to initial batch of transcribed protection order text in order to get a sense of what analysis is doable and interesting.

Average Sentiment Per Protection Order

For each Protection Order, produce a word count, a sentiment score and corresponding standard deviation (e.g. the variability of positive & negative emotions in a single protection order).

PO ref # Word Count Std. Dev. Average Sentiment
1 248 0.3919165 -0.2896926
6 323 0.2565173 -0.1678728
3 116 0.3297618 -0.1260139
2 764 0.2835390 -0.0646693
4 366 0.1243202 -0.0063708
7 0 NA 0.0000000
5 139 0.1532549 0.0544215

Density Plot of Sentence Sentiment Across all Protection Orders

Show the distribution of positive and negative emotions for every sentence across the whole dataset.

## 
## Call:
##  density.default(x = senti$sentiment)
## 
## Data: senti$sentiment (73 obs.); Bandwidth 'bw' = 0.1168
## 
##        x                 y            
##  Min.   :-1.4659   Min.   :0.0005279  
##  1st Qu.:-0.8260   1st Qu.:0.0525892  
##  Median :-0.1862   Median :0.2437542  
##  Mean   :-0.1862   Mean   :0.3903267  
##  3rd Qu.: 0.4536   3rd Qu.:0.6740276  
##  Max.   : 1.0935   Max.   :1.1708733

Top Emotions Referenced in all POs

Plot the most common emotions across the whole dataset.

## # A tibble: 14 × 2
##    emotion_type         ave_emotion
##    <fct>                      <dbl>
##  1 anger                   0.0188  
##  2 anger_negated           0.00246 
##  3 anticipation            0.0190  
##  4 anticipation_negated    0.00227 
##  5 disgust                 0.00592 
##  6 fear                    0.0237  
##  7 fear_negated            0.00337 
##  8 joy                     0.00953 
##  9 sadness                 0.0173  
## 10 sadness_negated         0.00205 
## 11 surprise                0.00519 
## 12 surprise_negated        0.000825
## 13 trust                   0.0214  
## 14 trust_negated           0.00263