Skip to content

ClassifyDocumentRequest

Source code in docs_src/capo_comprehend/types/classify_document_request.py
class ClassifyDocumentRequest(TypedDict, closed=True):
    text: NotRequired["capo_comprehend.types.customer_input_string.CustomerInputString"]
    """<p>The document text to be analyzed. If you enter text using this parameter, do not use the <code>Bytes</code> parameter.</p>"""
    endpoint_arn: "capo_comprehend.types.document_classifier_endpoint_arn.DocumentClassifierEndpointArn"
    """<p>The Amazon Resource Number (ARN) of the endpoint. </p> <p>For prompt safety classification, Amazon Comprehend provides the endpoint ARN. For more information about prompt safety classifiers, see <a href="https://docs.aws.amazon.com/comprehend/latest/dg/trust-safety.html#prompt-classification">Prompt safety classification</a> in the <i>Amazon Comprehend Developer Guide</i> </p> <p>For custom classification, you create an endpoint for your custom model. For more information, see <a href="https://docs.aws.amazon.com/comprehend/latest/dg/using-endpoints.html">Using Amazon Comprehend endpoints</a>.</p>"""
    bytes: NotRequired[
        "capo_comprehend.types.semi_structured_document_blob.SemiStructuredDocumentBlob"
    ]
    """<p>Use the <code>Bytes</code> parameter to input a text, PDF, Word or image file.</p> <p>When you classify a document using a custom model, you can also use the <code>Bytes</code> parameter to input an Amazon Textract <code>DetectDocumentText</code> or <code>AnalyzeDocument</code> output file.</p> <p>To classify a document using the prompt safety classifier, use the <code>Text</code> parameter for input.</p> <p>Provide the input document as a sequence of base64-encoded bytes. If your code uses an Amazon Web Services SDK to classify documents, the SDK may encode the document file bytes for you. </p> <p>The maximum length of this field depends on the input document type. For details, see <a href="https://docs.aws.amazon.com/comprehend/latest/dg/idp-inputs-sync.html"> Inputs for real-time custom analysis</a> in the Comprehend Developer Guide. </p> <p>If you use the <code>Bytes</code> parameter, do not use the <code>Text</code> parameter.</p>"""
    document_reader_config: NotRequired[
        "capo_comprehend.types.document_reader_config.DocumentReaderConfig"
    ]
    """<p>Provides configuration parameters to override the default actions for extracting text from PDF documents and image files.</p>"""

bytes instance-attribute

bytes: NotRequired[SemiStructuredDocumentBlob]

Use the Bytes parameter to input a text, PDF, Word or image file.

When you classify a document using a custom model, you can also use the Bytes parameter to input an Amazon Textract DetectDocumentText or AnalyzeDocument output file.

To classify a document using the prompt safety classifier, use the Text parameter for input.

Provide the input document as a sequence of base64-encoded bytes. If your code uses an Amazon Web Services SDK to classify documents, the SDK may encode the document file bytes for you.

The maximum length of this field depends on the input document type. For details, see Inputs for real-time custom analysis in the Comprehend Developer Guide.

If you use the Bytes parameter, do not use the Text parameter.

document_reader_config instance-attribute

document_reader_config: NotRequired[DocumentReaderConfig]

Provides configuration parameters to override the default actions for extracting text from PDF documents and image files.

endpoint_arn instance-attribute

The Amazon Resource Number (ARN) of the endpoint.

For prompt safety classification, Amazon Comprehend provides the endpoint ARN. For more information about prompt safety classifiers, see Prompt safety classification in the Amazon Comprehend Developer Guide

For custom classification, you create an endpoint for your custom model. For more information, see Using Amazon Comprehend endpoints.

text instance-attribute

text: NotRequired[CustomerInputString]

The document text to be analyzed. If you enter text using this parameter, do not use the Bytes parameter.