Skip to content

ClassifyDocument

Source: src/AWS/Comprehend/ClassifyDocument.ts

Runtime binding for comprehend:ClassifyDocument — classify a single document in real time against a custom classifier endpoint or a Comprehend prebuilt model ARN (EndpointArn).

The binding takes no arguments and grants the action on * — endpoints are addressed per-request via EndpointArn, so the grant cannot be scoped tighter at deploy time.

// init
const classifyDocument = yield* AWS.Comprehend.ClassifyDocument();
// runtime
const result = yield* classifyDocument({
Text: "Subject: your invoice for March is attached",
EndpointArn: endpointArn,
});
// result.Classes: [{ Name: "INVOICE", Score: 0.98 }, …]