Values.ClassifyDocumentResponseSourceCreates a classification request to analyze a single document in real-time. ClassifyDocument supports the following model types: Custom classifier - a custom model that you have created and trained. For input, you can provide plain text, a single-page document (PDF, Word, or image), or Amazon Textract API output. For more information, see Custom classification in the Amazon Comprehend Developer Guide. Prompt safety classifier - Amazon Comprehend provides a pre-trained model for classifying input prompts for generative AI applications. For input, you provide English plain text input. For prompt safety classification, the response includes only the Classes field. For more information about prompt safety classifiers, see Prompt safety classification in the Amazon Comprehend Developer Guide. If the system detects errors while processing a page in the input document, the API response includes an Errors field that describes the errors. If the system detects a document-level error in your input document, the API returns an InvalidRequestException error response. For details about this exception, see Errors in semi-structured documents in the Comprehend Developer Guide.
type nonrec t = {classes : ListOfClasses.t option;The classes used by the document being analyzed. These are used for models trained in multi-class mode. Individual classes are mutually exclusive and each document is expected to have only a single class assigned to it. For example, an animal can be a dog or a cat, but not both at the same time. For prompt safety classification, the response includes only two classes (SAFE_PROMPT and UNSAFE_PROMPT), along with a confidence score for each class. The value range of the score is zero to one, where one is the highest confidence.
*)labels : ListOfLabels.t option;The labels used in the document being analyzed. These are used for multi-label trained models. Individual labels represent different categories that are related in some manner and are not mutually exclusive. For example, a movie can be just an action movie, or it can be an action movie, a science fiction movie, and a comedy, all at the same time.
*)documentMetadata : DocumentMetadata.t option;Extraction information about the document. This field is present in the response only if your request includes the Byte parameter.
*)documentType : ListOfDocumentType.t option;The document type for each page in the input document. This field is present in the response only if your request includes the Byte parameter.
*)errors : ListOfErrors.t option;Page-level errors that the system detected while processing the input document. The field is empty if the system encountered no errors.
*)warnings : ListOfWarnings.t option;Warnings detected while processing the input document. The response includes a warning if there is a mismatch between the input document type and the model type associated with the endpoint that you specified. The response can also include warnings for individual pages that have a mismatch. The field is empty if the system generated no warnings.
*)}type nonrec error = [ | `InternalServerException of InternalServerException.t| `InvalidRequestException of InvalidRequestException.t| `TextSizeLimitExceededException of TextSizeLimitExceededException.t| `Unknown_operation_error of string * string option ]val error_of_json :
string ->
Yojson.Safe.t ->
[> `InternalServerException of InternalServerException.t
| `InvalidRequestException of InvalidRequestException.t
| `ResourceUnavailableException of ResourceUnavailableException.t
| `TextSizeLimitExceededException of TextSizeLimitExceededException.t
| `Unknown_operation_error of string * string option ]val error_of_xml :
string ->
Awso.Xml.t ->
[> `InternalServerException of InternalServerException.t
| `InvalidRequestException of InvalidRequestException.t
| `ResourceUnavailableException of ResourceUnavailableException.t
| `TextSizeLimitExceededException of TextSizeLimitExceededException.t
| `Unknown_operation_error of string * string option ]val to_value :
t ->
[> `Structure of
(string
* [> `List of
[> `Structure of
(string
* [> `Enum of string
| `Float of Float_.t
| `Integer of Integer.t
| `String of String_.t ])
list ]
list
| `Structure of
(string
* [> `Integer of Integer.t
| `List of
[> `Structure of (string * [> `Integer of Integer.t ]) list ]
list ])
list ])
list ]