calculate_sentiment: Predicts the sentiment of sentences

Description Usage Arguments Value Examples

View source: R/test.R

Description

This function loads text and calculates sentiment of each sentence. It classifies sentences into 6 categories: Positive, Negative, Very Positive, Very Negative Sarcasm and Neutral.

Usage

1

Arguments

text

A vector of sentences or a sentence (English).

Value

A vector containing sentiment of each sentence.

Examples

1
2
calculate_sentiment("This is good")
calculate_sentiment(c("This is good","This is bad"))

Example output

[1] "Processing sentence: this is good"
          text sentiment
1 This is good  Positive
[1] "Processing sentence: this is good"
[1] "Processing sentence: this is bad"
          text sentiment
1 This is good  Positive
2  This is bad  Negative

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