Skip to content

ClassifyDocumentResponse

Source code in docs_src/capo_comprehend/types/classify_document_response.py
class ClassifyDocumentResponse(TypedDict, closed=True):
    classes: NotRequired["capo_comprehend.types.list_of_classes.ListOfClasses"]
    """<p>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. </p> <p>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.</p>"""
    labels: NotRequired["capo_comprehend.types.list_of_labels.ListOfLabels"]
    """<p>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. </p>"""
    document_metadata: NotRequired[
        "capo_comprehend.types.document_metadata.DocumentMetadata"
    ]
    """<p>Extraction information about the document. This field is present in the response only if your request includes the <code>Byte</code> parameter. </p>"""
    document_type: NotRequired[
        "capo_comprehend.types.list_of_document_type.ListOfDocumentType"
    ]
    """<p>The document type for each page in the input document. This field is present in the response only if your request includes the <code>Byte</code> parameter. </p>"""
    errors: NotRequired["capo_comprehend.types.list_of_errors.ListOfErrors"]
    """<p>Page-level errors that the system detected while processing the input document. The field is empty if the system encountered no errors.</p>"""
    warnings: NotRequired["capo_comprehend.types.list_of_warnings.ListOfWarnings"]
    """<p>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. </p> <p>The field is empty if the system generated no warnings.</p>"""

classes instance-attribute

classes: NotRequired[ListOfClasses]

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.

document_metadata instance-attribute

document_metadata: NotRequired[DocumentMetadata]

Extraction information about the document. This field is present in the response only if your request includes the Byte parameter.

document_type instance-attribute

document_type: NotRequired[ListOfDocumentType]

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 instance-attribute

errors: NotRequired[ListOfErrors]

Page-level errors that the system detected while processing the input document. The field is empty if the system encountered no errors.

labels instance-attribute

labels: NotRequired[ListOfLabels]

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.

warnings instance-attribute

warnings: NotRequired[ListOfWarnings]

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.