Classify document
Decide which type of document a text is (invoice, purchase order, claim...) by keywords, by AI, or keywords first and AI when they do not decide.
Command in the Document processing toolkit · id ooa.idp/classify_document · 10 inputs (2 required), 4 outputs
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Text | String | Yes | The document's text (read it with the PDF, OCR or Word toolkits). | |
| Types | List | Yes | The document types: name, keywords and a description for the AI. | |
| Method | String | No | keywords_then_ai | How to decide. |
| Connection | String | No | Name of a Model Connection (provider, model and key managed in one place). Leave empty to set them on this action. | |
| Provider | String | No | openai | Who runs the model: OpenAI, Azure OpenAI, Anthropic, OpenAI-compatible (LiteLLM, vLLM, Ollama), Hugging Face (its router or your own TGI server), AWS SageMaker (a model on an Amazon SageMaker endpoint), AWS Bedrock or Google Vertex AI (Gemini). |
| Model | String | No | Model name; the deployment name for Azure OpenAI; the endpoint name for AWS SageMaker; the model or inference profile id for AWS Bedrock. | |
| API key | Credential | No | API key or access token from the vault (not needed for some self-hosted endpoints). For AWS Bedrock and AWS SageMaker: the AWS secret access key (or ACCESS_KEY_ID:SECRET). For Google Vertex AI: a service-account JSON key or an access token. | |
| Endpoint address | String | No | Endpoint; required for Azure OpenAI, Vertex AI (https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/REGION) and self-hosted models (for a TGI server, e.g. http://tgi-host:8080/v1). | |
| Minimum score | Number | No | 0.5 | Keywords decide when the best type reaches this and leads the next. |
| Hide personal data | Boolean | No | true | Replace emails, phone and card numbers, IBANs and similar before sending; restored in the answer. |
Outputs
| Output | Type | What it is |
|---|---|---|
| type | String | The document type, or unknown. |
| confidence | Number | 0 to 1. |
| method | String | keywords or ai: what decided. |
| scores | Dictionary | Keyword score per type. |