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 Results
Optional extraction response associated with the Classification. This is only filled if extraction chaining is activated for the model.
Chained Extraction results will be in 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.
Sample Code
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}")function handleResponse(response) {
const classification = response.getInference().getResult().getClassification();
// Document type identified for this file
const documentType = classification.getDocumentType();
console.log(`Detected type: ${documentType}`);
// Optional extraction response, present if extraction chaining was requested
const extractionResponse = classification.getExtractionResponse();
if (extractionResponse != null) {
// Access extracted fields from the split's inference result
const fields = extractionResponse.getInference().getResult().getFields();
console.log(`Extraction fields: ${fields.toString()}`);
}
}Last updated
Was this helpful?

