How Classes, Refiners and Actions Fit¶
Intuitive AI is the KnowledgeLake engine that classifies documents and extracts their data. You configure it in the class builder of the Intuitive AI app. This page explains the parts of a class, the order the engine uses them in, and the scoring rules that decide which class wins and which actions run. Read it before you write a refiner script, an action script or an AI hint.
At a glance
- Runs On the server, on the Intuitive AI worker, when a workflow sends documents for classification and extraction
- Configured in Intuitive AI app, class builder (permission: Use This App)
- Extension points Regex Anchor patterns, Zero-Shot Classifier and Auto Extraction hints, JavaScript conditions and actions
- Output A class, a subclass, a content type and Index field values on each document
- Best for Sorting mixed documents and filling Index fields with no person involved
The pipeline¶
graph TD
A["Page or document"] --> B["Refiners score each class and subclass"]
B --> C["Best match picks the class and subclass"]
C --> D["Each rule of the match scores its conditions"]
D -->|pass| E["Actions run"]
D -->|fail| X["Actions skipped"]
E --> F["Same field twice: higher confidence wins"]
F --> G["Index fields on the document"]
A rule passes when its combined condition confidence is 0.5 or more. The Default Rule has no conditions, so it always passes for the matched class.
The parts¶
- Class A kind of document, for example "Vendor Invoice". A class sets the content type for the documents it matches.
- Subclass A variation of a class, for example one vendor's invoice layout or one revision of a form. A subclass has a model document. Its page refiners and page rules are tied to the pages of that model document.
- Rule In the engine, a rule is an interaction. A rule has conditions, actions, and a logic group that joins the conditions with And or Or.
- Refiner A condition used to classify. A refiner does not write data. It returns a confidence between 0 and 1 that tells the engine how well the page or document fits this class or subclass.
- Action A step that runs when a rule passes. Actions write Index metadata. Examples: OCR (shown in a rule as "Extract from OCR Snippet"), Auto Extraction (shown as "AI Extraction") and Custom Action.
Where you add each part¶
Open the Intuitive AI app (permission: Use This App) and open a class or a subclass. The interaction panel has these sections:
| Section | What it holds |
|---|---|
| Document Classification | The Zero-Shot Classifier refiner. Class level only. Document scope. |
| First Page Refiners | Refiners that test the first page |
| Middle Page Refiners | Refiners that test middle pages. The model document needs 3 or more pages. |
| Last Page Refiners | Refiners that test the last page. The model document needs 2 or more pages. |
| Default Rule | "On Class Match" (or "On Subclass Match"), then "Set Content Type". Auto Extraction lives here. |
| Add a Rule | Your own rules, built with Add Condition: and Add Action: |
In a refiner section, use Add Refiner:. In a rule, use Add Condition: and Add Action:. Each list shows only the items that fit the scope of the section.
Page scope and document scope¶
Every condition and action is either page scope or document scope.
| Scope | Conditions | Actions |
|---|---|---|
| Page | Regex Anchor, Identification Zone, Custom Condition | OCR, OMR, Signature Detection, Static Metadata, Custom Action |
| Document | Zero-Shot Classifier, Custom Document Condition | Auto Extraction, Static Metadata, Custom Document Action |
A page script sees one page and its OCR. A document script sees the whole document and can OCR up to 100 pages. Use a page script when one page decides the answer. Use a document script when the answer needs several pages together.
How the engine scores¶
These rules come from the released engine. They decide what your refiner, action or hint must return.
- Confidence is a number from 0 to 1. The engine clamps values outside that range to 0 or 1 and logs a warning. A value of 100 counts as 1.
- And takes the lowest value. Or takes the highest value. Groups can nest.
- One condition needs no logic. A rule with one condition uses that condition's value directly.
- A rule with no conditions always passes. The Default Rule has no conditions, so its actions run every time the class or subclass matches.
- Actions run only at 0.5 or more. A rule whose combined condition confidence is below 0.5 does not run its actions.
- Script conditions run last. In each rule, Custom Condition and Custom Document Condition run after the other conditions in that rule.
- Document script conditions are scaled. The engine multiplies the confidence of a Custom Document Condition by 0.9.
- No result is not the same as 0. In a page refiner, a Custom Condition that never calls
result.SetResultgives no opinion: the refiner does not count. A result of 0 counts as "this is not a match". In a rule, no result counts as 0. - Several page refiners on one page combine with And. The lowest refiner confidence becomes the page confidence for that subclass.
- A page rule runs on every page. The engine evaluates each page rule on each page of the document. When several pages pass 0.5, it keeps the results from the page with the highest average of condition confidence and action confidence.
- Two actions that write the same field. The value from the action with the higher confidence wins. On a tie, the value from a Custom Action or Custom Document Action wins.
Stop on first match
The rule model has a "stop on first match" flag. The class builder always saves it as on, and you cannot change it in the UI. Do not design rules that depend on it.
Pick the right tool¶
| You need to | Use |
|---|---|
| Tell classes apart by what the document is about | Zero-Shot Classifier hint |
| Find a label that moves around the page, or a form ID | Regex Anchor |
| Weigh several text signals to pick a subclass | Custom Condition |
| Fill Index fields from free-form documents | Auto Extraction hints |
| Clean or derive a value after OCR | Custom Action |
| Change many classes from your own code | Intuitive AI API |