Learn R Programming

syuzhet (version 1.0.6)

get_nrc_sentiment: Get Emotions and Valence from NRC Dictionary

Description

Calls the NRC sentiment dictionary to calculate the presence of eight different emotions and their corresponding valence in a text file.

Usage

get_nrc_sentiment(char_v, cl = NULL, language = "english", lowercase = TRUE)

Value

A data frame where each row represents a sentence from the original file. The columns include one for each emotion type as well as a positive or negative valence. The ten columns are as follows: "anger", "anticipation", "disgust", "fear", "joy", "sadness", "surprise", "trust", "negative", "positive."

Arguments

char_v

A character vector

cl

Optional, for parallel analysis

language

A string

lowercase

should tokens be converted to lowercase. Default equals TRUE

References

Saif Mohammad and Peter Turney. "Emotions Evoked by Common Words and Phrases: Using Mechanical Turk to Create an Emotion Lexicon." In Proceedings of the NAACL-HLT 2010 Workshop on Computational Approaches to Analysis and Generation of Emotion in Text, June 2010, LA, California. See: http://saifmohammad.com/WebPages/lexicons.html