Slug: splitter-rotator-classifier Version: 1.0.0 Infer: Yes

Overview

Splitter Rotator Classifier Model

This model provides advanced document preprocessing capabilities to prepare documents for extraction or further analysis. It can split multi-document scans, correct page orientation, filter blank or duplicate pages, and classify documents by type.

How It Works

The model performs a comprehensive set of document preprocessing operations:

  1. Document Splitting: Detects when multiple documents appear on a single scanned page and separates them
  2. Rotation Correction: Automatically rotates pages to the correct orientation
  3. Page Filtering: Removes blank pages and duplicates to clean up the document set
  4. Page Reordering: Intelligently groups and orders pages that belong to multi-page documents
  5. Document Classification: Identifies document types based on content and layout

Options Configuration

OptionDescription
document_typesList of document types to classify against (can include hints in parentheses)
split_multiple_documents_in_one_pageWhen enabled, detects and splits pages containing multiple distinct documents
correct_rotationAnalyzes and corrects page orientation for proper reading
exclude_blank_pagesFilters out completely blank or mostly white pages
exclude_duplicate_pagesRemoves duplicate pages based on visual similarity
reorder_pagesIntelligently groups pages that belong to the same multi-page document
multiple_document_in_one_page_identifier_modelLLM model used to verify if a page contains multiple documents
document_classifier_modelLLM model used to determine document types
multiple_page_document_identifier_modelLLM model used to identify pages belonging to the same document
target_storeDocument store to receive the processed documents

Process Flow

Document Splitting Process

When splitting multiple documents in a single page:

  1. Image Analysis: The model scans for whitespace gaps or content boundaries
  2. Split Point Detection: It identifies potential horizontal (stacked) or vertical (side-by-side) split points
  3. LLM Validation: An AI model verifies that the detected split represents two distinct documents
  4. Document Separation: The page is split into separate documents at the validated boundary

Classification Process

Document classification uses AI to identify document types:

  1. The model analyzes page content, layout, and text
  2. It compares against your defined document types (with optional hints)
  3. For multi-page documents, it considers content across all pages
  4. Each document is assigned the most likely document type

Example Usage

This model is particularly useful for:

  • Processing batch scans that contain multiple different documents
  • Handling document collections with mixed orientations and types
  • Cleaning up scans by removing blank separator pages
  • Organizing multi-page documents that were scanned out of order
  • Automatically categorizing documents for downstream processing

Configuration Example

To process mixed-orientation invoice scans:

document_types: "- Invoice (hints: total, amount due, bill to)\n- Receipt (hints: paid, payment, thank you)\n- Packing Slip (hints: shipped items, quantity)"
split_multiple_documents_in_one_page: true
correct_rotation: true
exclude_blank_pages: true
exclude_duplicate_pages: true
reorder_pages: true
document_classifier_model: "gemini-2.0-flash-001"

Inference Options

The following options can be configured when using this model for inference:

NameLabelTypeDescriptionDefaultRequired
document_typesDocument TypesstringThe possible document types to use for classification. You can include hints in parentheses.- Document Type 1 (hints:)No
split_multiple_documents_in_one_pageSplit multiple documents in one page?booleanWhether to split multiple documents in one pageTrueNo
correct_rotationCorrect rotation of documents?booleanWhether to correct the rotation of the documentTrueNo
exclude_blank_pagesExclude blank pages?booleanWhether to exclude blank pagesTrueNo
exclude_duplicate_pagesExclude duplicate pages?booleanWhether to exclude duplicate pagesTrueNo
reorder_pagesReorder pages?booleanWhether to reorder pages based on the multi-page resultsTrueNo
multiple_document_in_one_page_identifier_modelMultiple documents in one page identifier LLM modelstringThe model to use to identify pages with multiple documents scanned into themgemini-2.0-flash-001No
document_classifier_modelDocument classifier LLM modelstringThe model to use to classify documentsgemini-2.0-flash-001No
multiple_page_document_identifier_modelMultiple page document identifier LLM modelstringThe model to use to identify documents that are scanned across multiple pagesgemini-2.0-flash-001No
target_storeTarget StoredocumentStoreThe store that should receive the processed document-No

Model Details

  • Provider: Kodexa