Skip to content

DetectToxicContent

Source: src/AWS/Comprehend/DetectToxicContent.ts

Runtime binding for comprehend:DetectToxicContent — run toxicity analysis over a list of text segments; the response carries one result per segment with per-label scores (profanity, hate speech, harassment, …).

The binding takes no arguments and grants the action on * (the action has no resource-level IAM).

// init
const detectToxicContent = yield* AWS.Comprehend.DetectToxicContent();
// runtime
const result = yield* detectToxicContent({
TextSegments: [{ Text: "You are a wonderful person." }],
LanguageCode: "en",
});
// result.ResultList[0].Toxicity ~ 0.01