LLM Document Classifier Model
Classifies the document using an LLM
Slug: llm-document-classifier
Version: 1.0.0
Infer: Yes
Overview
LLM Document Classifier Model
The LLM Document Classifier model uses AI to automatically categorize documents based on their content. It examines document text and determines the most appropriate document type from a predefined list, providing intelligent document sorting and routing capabilities.
How It Works
- The model analyzes document content at the page level
- It compares the content against a list of document types with optional hints
- Using a powerful language model, it determines the most appropriate classification
- Optionally generates a concise summary of the document content
- Adds the classification and summary as features to the document
Options Configuration
Option | Description |
---|---|
document_types | List of possible document types to classify against, with optional hints in parentheses |
create_summary | When enabled, generates a one-sentence summary of the document content |
classification_model | The AI model used for classification and summarization |
Process Flow
Document Type Configuration
The document_types
option accepts a list of document types with optional hints to guide classification. For example:
Including hints improves classification accuracy by telling the AI which keywords or patterns to look for when identifying each document type.
Classification Process
The classification process follows these steps:
- Content Extraction: Extracts text content from each page
- Prompt Creation: Constructs a prompt with your document types and instructions
- LLM Analysis: Sends the prompt and content to the AI model
- Response Processing: Parses the AI’s JSON response to extract the document type and summary
- Feature Addition: Adds the classification and summary as document features
Example Usage
This model is particularly useful for:
- Automatically sorting incoming documents by type
- Creating document metadata for search and filtering
- Routing documents to appropriate processing pipelines
- Generating concise document summaries for quick review
- Building intelligent document management systems
Configuration Example
To classify business documents with summaries:
Inference Options
The following options can be configured when using this model for inference:
Name | Label | Type | Description | Default | Required |
---|---|---|---|---|---|
document_types | Document Types | string | The possible document types to use for classification. You can include hints in parentheses. | - Document Type 1 (hints:) | No |
create_summary | Create Summary | boolean | Whether to create a summary of the document | True | No |
classification_model | Model | cloudModel | The model to use to classify and summarize of each page of the document | anthropic.claude-3-5-sonnet-20240620-v1:0 | No |
Model Details
- Provider: Kodexa