Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
bordertrue


Column

Table of Contents

Table of Contents
exclude(Table of Contents|Read on|ML Training Pipeline|Kairos CLI App|PREDICT-API Service)


Inference Schema

The inference schema is a JSON configuration file defining the object types that will be available for the classification as well as the properties for which the metadata extraction should be done. At the same time, each internal aiObjectTypeId for classification or aiPropertyId for metadata extraction gets a corresponding objectTypeId in the case of classification, or propertyId in the case of metadata extraction, which will be used in the response bodies of the classification and extraction endpoints to be compatible with the connected client application.

The inference schema also defines whether the particular mapping is enabled or disabled, and also timeouts, allowed values, patterns that should be met, external validation services to be called, etc.

The inference schema can be defined for a specific tenant, or for the whole instance. If defined, the tenant-specific inference schema will override the global inference schema.

Code Block
languageyml
titleExample for an inference schema
{
    "tenant" : "ACME Inc.",
    "appName" : "InvoiceBatchProcessing",
    "classification" : {
        "enabled" : true,
        "timeout" : 2,
        "aiClassifierId" : "DOCUMENT_CLASSIFICATION",
        "objectTypes": [
            {
                "objectTypeId" : "invoiceIn",
                "aiObjectTypeId" : "AI_INVOICE"
            },
            {
                "objectTypeId" : "invoiceOut",
                "aiObjectTypeId" : "AI_INVOICE"
            },
			{
                "objectTypeId" : "creditMemoIn",
                "aiObjectTypeId" : "AI_CREDIT_MEMO"
            },
            {
                "objectTypeId" : "creditMemoOut",
                "aiObjectTypeId" : "AI_CREDIT_MEMO"
            }
    },
    "extraction" : {
        "enabled" : true,
        "timeout" : 5,
        "objects" : [
            {
                "objectTypeId" : "invoiceIn",
                "enabled" : true,
                "timeout" : 10,
                "propertyReference" : [
                    {
                        "propertyId" : "companyName",
                        "aiPropertyId" : "AI_INVOICE_COMPANY_NAME",
                        "allowedValues" : ["Lufthansa", "KLM", "Swiss"],
                        "pattern" : "/^[a-z]|\\d?[a-zA-Z0-9]?[a-zA-Z0-9\\s&@.]+$",
                        "validationService" : "os_company_name_validation_service",
                        "maxNumberOfPredictions" : 5
                    },
                    {
                        "propertyId" : "baseAmount",
                        "aiPropertyId" : "AI_BASE_AMOUNT",
                        "pattern" : "^[0-9]*[.][0-9]*$",
                        "validationService" : "os_amounts_validation_service",
                        "maxNumberOfPredictions" : 1
                    },
                    {
                        "propertyId" : "totalAmount",
                        "aiPropertyId" : "AI_INVOICE_TOTAL_AMOUNT",
                        "pattern" : "^[0-9]*[.][0-9]*$",
                        "validationService" : "os_amounts_validation_service",
                        "maxNumberOfPredictions" : 1
                    },
                    {
                        "propertyId" : "invoiceDate",
                        "aiPropertyId" : "AI_INVOICE_DATE",
                        "pattern" : "^[0-9]*[.][0-9]*$",
                        "validationService" : "os_dates_validation_service",
                        "maxNumberOfPredictions" : 1
                    }
					
                ]
            },
			{
                "objectTypeId" : "invoiceOut",
                "enabled" : true,
                "timeout" : 10,
                "propertyReference" : [
                    {
                        "propertyId" : "companyName",
                        "aiPropertyId" : "AI_INVOICE_COMPANY_NAME",
                        "allowedValues" : ["Lufthansa", "KLM", "Swiss"],
                        "pattern" : "/^[a-z]|\\d?[a-zA-Z0-9]?[a-zA-Z0-9\\s&@.]+$",
                        "validationService" : "os_company_name_validation_service",
                        "maxNumberOfPredictions" : 5
                    },
                    {
                        "propertyId" : "totalAmount",
                        "aiPropertyId" : "AI_INVOICE_TOTAL_AMOUNT",
                        "pattern" : "^[0-9]*[.][0-9]*$",
                        "validationService" : "os_amounts_validation_service",
                        "maxNumberOfPredictions" : 1
                    }
                ]
            },
			{
                "objectTypeId" : "creditMemoIn",
                "enabled" : true,
                "timeout" : 10,
                "propertyReference" : [
                    {
                        "propertyId" : "companyName",
                        "aiPropertyId" : "AI_CREDIT_MEMO_TOTAL_AMOUNT",
                        "allowedValues" : ["Lufthansa", "KLM", "Swiss"],
                        "pattern" : "/^[a-z]|\\d?[a-zA-Z0-9]?[a-zA-Z0-9\\s&@.]+$",
                        "validationService" : "os_company_name_validation_service",
                        "maxNumberOfPredictions" : 5
                    },
                    {
                        "propertyId" : "totalAmount",
                        "aiPropertyId" : "AI_CREDIT_MEMO_TOTAL_AMOUNT",
                        "pattern" : "^[0-9]*[.][0-9]*$",
                        "validationService" : "os_amounts_validation_service",
                        "maxNumberOfPredictions" : 1
                    }
                ]
            },
			{
                "objectTypeId" : "creditMemoOut",
                "enabled" : true,
                "timeout" : 10,
                "propertyReference" : [
                    {
                        "propertyId" : "companyName",
                        "aiPropertyId" : "AI_CREDIT_MEMO_TOTAL_AMOUNT",
                        "allowedValues" : ["Lufthansa", "KLM", "Swiss"],
                        "pattern" : "/^[a-z]|\\d?[a-zA-Z0-9]?[a-zA-Z0-9\\s&@.]+$",
                        "validationService" : "os_company_name_validation_service",
                        "maxNumberOfPredictions" : 5
                    },
                    {
                        "propertyId" : "totalAmount",
                        "aiPropertyId" : "AI_CREDIT_MEMO_TOTAL_AMOUNT",
                        "pattern" : "^[0-9]*[.][0-9]*$",
                        "validationService" : "os_amounts_validation_service",
                        "maxNumberOfPredictions" : 1
                    }
                ]
            }
        ]
    }
}

...

The inference schema is a part of the Artificial Intelligence Platform and can run only in combination with the other included services.

Requirements

The inference schema is a part of the Artificial Intelligence Platform and can run only in combination with the other included services.

Configuration

Performed via endpoints of the KAIROS-API Service service.


Info
iconfalse

Read on


Section


Column
width25%

ML Training Pipeline

Insert excerpt
ML Training Pipeline
ML Training Pipeline
nopaneltrue
 Keep reading


Column
width25%

KAIROS-API Service

Insert excerpt
KAIROS-API Service
KAIROS-API Service
nopaneltrue
 Keep reading



Column
width25%

PREDICT-API Service

Insert excerpt
PREDICT-API Service
PREDICT-API Service
nopaneltrue
 Keep reading



...