Text mining of State of the Union Addresses of Barack Obama, 2009-2016. Part 1 : Sentiment analysis with R package “syuzhet”

In this post we use the basic functions of the Syuzhet package to perform sentiment analysis on the text of the State of the Union Addresses of president Barack Obama in the period 2009-2016.

Project Gutenberg makes e-texts available and through the corresponding R library we use the UTF-8 file to perform sentiment analysis on  the SOTU texts.   The latter are tokenized by concatenation of the lines in chunks of 10.  The syuzhet package in R uses the NRC emotion lexicon and the get_nrc_sentiment function returns a data frame in which each token represents a row.  The columns include eight emotions (anger, fear, anticipation, trust, surtprise, sadness, joy and disgust) as well as two sentiments (negative and positive).

Download and read the full document : syuzhet_sotu

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s