Learn R Programming

RDSTK (version 1.1)

text2sentiment: Estimates the sentiment of some text

Description

This function analyzes the text for words that correlate with complimentary or derogatory reviews and comments, to give an overall score for how positive or negative the text is about its subject.

Usage

text2sentiment(text, session=getCurlHandle())

Arguments

text
A short piece of writing, from a sentence to a paragraph in length for best results.
session
This is the CURLHandle object giving the structure for the options and that will process the command. For curlMultiPerform, this is an object of class code MultiCURLHandle-class.

Value

score
A number representing the estimated sentiment, from -5 (very negative) to +5 (very positive).

References

http://www.datasciencetoolkit.org/developerdocs#text2sentiment

See Also

curlPerform, getCurlHandle, dynCurlReader

Examples

Run this code
	## Not run: 
# 		text2sentiment("I love this hotel!")
# 	## End(Not run)

Run the code above in your browser using DataLab