DetectSentiment
Source:
src/AWS/Comprehend/DetectSentiment.ts
Runtime binding for comprehend:DetectSentiment — infer the prevailing
sentiment of a piece of text (POSITIVE, NEGATIVE, NEUTRAL, or
MIXED).
Comprehend’s synchronous detect APIs are pure pay-per-call with no
resource to manage: the binding takes no arguments and grants the
function comprehend:DetectSentiment (the action has no resource-level
IAM).
Real-Time Analysis
Section titled “Real-Time Analysis”// initconst detectSentiment = yield* AWS.Comprehend.DetectSentiment();
// runtimeconst result = yield* detectSentiment({ Text: "I love this product, it works wonderfully!", LanguageCode: "en",});// result.Sentiment === "POSITIVE"// result.SentimentScore.Positive ~ 0.99