Score text on a scale of positive, negative, or neutral
supercontrast
is easy, all you have to do is provide the text and the provider you want to use.
In this example, we’ll specify that for Task.SENTIMENT_ANALYSIS
, we want to use Provider.AWS
, which uses Amazon’s Comprehend API.
Task.SENTIMENT_ANALYSIS
, the request schema is defined by SentimentAnalysisRequest
and the response schema is defined by SentimentAnalysisResponse
.
SentimentAnalysisRequest
text
: a string of the text to analyze for sentiment.score
: a float between 0 and 1, representing the sentiment of the text.