Quality Gate Model
Checks the quality of the document
Slug: quality-gate
Version: 1.0.0
Infer: Yes
Overview
Quality Gate Model
The Quality Gate model analyzes documents to detect quality issues that might interfere with downstream document processing. Currently, it specializes in detecting handwritten numeric values (such as invoice amounts, balances, etc.) that might require manual processing.
How It Works
- The model converts the input document to grayscale to optimize handwriting detection
- It uses AI to identify specific document types based on content and layout
- For qualifying documents, it analyzes each page to detect handwritten numeric values
- Documents with handwriting are labeled accordingly, allowing for special handling
Options Configuration
Option | Description |
---|---|
should_check_for_handwriting | Enables or disables handwriting detection (default: true) |
included_document_types | Document types to check for handwriting (e.g., “invoice, receipt”) |
excluded_document_types | Document types to exempt from handwriting checks (e.g., “bill of lading, weight slip”) |
limited_to_first_page | When true, only checks the first page for handwriting (default: false) |
handwriting_detector_model | The AI model used for handwriting detection (default: “gemini-2.0-flash-001”) |
Process Flow
Example Usage
The Quality Gate model is especially useful for:
- Automated document processing pipelines that require high-quality machine-readable content
- Identifying documents that need manual review versus those that can be fully automated
- Creating quality control steps before document extraction
- Filtering invoices with handwritten amounts that might lead to extraction errors
Configuration Example
To check only invoices and receipts for handwriting:
Handwriting Detection Logic
The handwriting detection algorithm:
- Focuses specifically on numeric values (amounts, quantities, totals)
- Ignores dates, times, and non-numeric handwritten text
- Verifies multiple handwritten numeric values or the same value in multiple places
- Uses a two-pass verification process to reduce false positives
Inference Options
The following options can be configured when using this model for inference:
Name | Label | Type | Description | Default | Required |
---|---|---|---|---|---|
should_check_for_handwriting | Should Check For Handwriting | boolean | Whether to check for handwriting related to numeric data (e.g. invoice amounts, balances, or amounts paid | True | No |
included_document_types | Included Document Types | string | The document types to check for handwriting (e.g. invoice, receipt, etc.) | - | Yes |
excluded_document_types | Excluded Document Types | string | The document types to specifically exclude from handwriting checking (e.g. bill of lading, weight slip, etc.) | - | No |
limited_to_first_page | Limit to First Page | boolean | Whether to limit the handwriting detection to just the first page | False | No |
handwriting_detector_model | Handwriting Detector Model | string | The model to use to identify pages with handwritten billing information | gemini-2.0-flash-001 | No |
Model Details
- Provider: Kodexa