calculate_custom_sentiment: Predicts the sentiment of sentences

Description Usage Arguments Value Examples

View source: R/custom.R

Description

This function loads text and words of positive and negative sentiment supplied externally as paramater and calculates sentiment of each sentence. It classifies sentences into 6 categories: Positive, Negative, Very Positive, Very Negative Sarcasm and Neutral.

Usage

1
calculate_custom_sentiment(text, positivewords, negativewords, check = 0)

Arguments

text

A vector of sentences or a sentence (English).

positivewords

A vector of words of positive sentiment.

negativewords

A vector of words of negative sentiment.

check

A flag variable whose value if 1 denotes appending of passed positive and negative words with existing words.By default, this method will work with supplied positive and negative words only.

Value

A vector containing sentiment of each sentence.

Examples

1
2
calculate_custom_sentiment("This is good",c("good"),c("bad"),1)
calculate_custom_sentiment(c("This is good","This is bad"),c("good"),c("bad"),0)

RSentiment documentation built on May 2, 2019, 3:45 a.m.