Genpact Cora Knowledge Center

Support

Classification Configuration

Overview

The classification.yaml configuration file classifies the documents and then the classification-results.yaml determines which extraction model should be used for the system based on the document type.

Template

classification.yaml
kind: document 
metadata: 
  name: extraction/v1/document-classification 
spec: 
  classificationModel: commonclassification10withprebuiltandABC 
  minimumClassificationConfidence: 0 
Parameter Description
Classification model The classification model name.
Minimum classification confidence The confidence level based on which this classification model will be used.
classification-results.yaml
kind: ruleSet 
metadata: 
  name: extraction/v1/document-classification-result 
spec: 
  nodes: 
  - if: 'it["DocumentType"] == "prebuilt-invoice"' 
    then: 
      extractionModel: prebuilt-invoice 
      extractionSuffix: currency,grossAmount,freightCharges      

  - if: 'it["DocumentType"] == "ABCInvoice1"' 
    then: 
      extractionModel: ABCInvoice1
Parameter Description
If then The condition to decide which extraction model should be used based on document type.

For example, in the above template, if the document type is ABCInvoice1 then the extraction model to be used is ABCInvoice.