For the complete documentation index, see llms.txt. This page is also available as Markdown.

Classification Result

Reference documentation on processing a Classification result using the Mindee SDKs.

You'll need to have a response object as described in the Response Processing section.

Accessing the Classification

A Classifier describes the detected class of the entire document.

Classifier Attributes

Document Type

The document category assigned to the sub-document. It is always filled.

It is returned as a string and is identical to the value entered on the Mindee platform — case, spaces, and punctuation included.

Extraction Response

Optional extraction response associated with the split. This is only filled if extraction chaining is activated for the model.

from mindee import ClassificationResponse

def handle_response(response: ClassificationResponse) -> None:
    classification = response.inference.result.classification

    # Document type identified for this file
    document_type: str = classification.document_type
    print(f"Detected type: {document_type}")

    # Optional extraction response, present if extraction chaining was requested
    extraction_response = classification.extraction_response

    if extraction_response is not None:
        # Access extracted fields from the inference result
        fields = extraction_response.inference.result.fields
        print(f"Extraction fields: {fields}")

Chained Extraction results will be an ExtractionResponse object. This object is identical to the response of an Extraction Model.

Refer to the Extraction Result section for details on processing the Extraction.

Last updated

Was this helpful?