Skip to content

Tell Statements from Invoices with Hints

An accounts receivable team receives customer statements and invoices in the same work items. Statements list many invoices, so they contain invoice numbers, dates and amounts too, and the model confused the two kinds. The team needs every document classified correctly and the right amount extracted from each kind. Plain-language hints solve it with no script.

At a glance

  • Extension point Zero-Shot Classifier hints, or Auto Extraction field hints
  • You need Either two classes ("AR Statement" and "AR Invoice") or one class ("AR Document") with Index fields Document Type, Invoice Number and Amount Due; permission Use This App
  • Teaches Hints that compete side by side, hints that survive the engine's cleanup, and one shared test applied to every field

Pick one approach:

Approach Use it when
Two classes, each with a Zero-Shot Classifier hint The two kinds need different fields, content types or routing
One class, with Auto Extraction field hints that branch Both kinds share one content type and the same fields

Set it up

  1. In the Intuitive AI app, open class "AR Statement" › Document Classification.
  2. In the "Zero Shot Classification" condition, select Hint (not Class Name) and paste the statement hint.
  3. Do the same in class "AR Invoice" with the invoice hint.
  4. Give both classes the same tag (for example AR) so you can test them together.

Before the change, both classes used Class Name mode. The model saw only "AR Statement" and "AR Invoice", and statements with a long invoice table were often classified as invoices.

AR Statement: Zero-Shot Classifier hint
A customer account statement. The title says Statement or Statement of Account. It lists several invoices with their dates and a running balance. It often shows an aging summary with Current and 30 Days and 60 Days columns. It shows one Balance Due for the whole account. It has no line items for goods or services.
AR Invoice: Zero-Shot Classifier hint
A bill for one sale. The title says Invoice. It has one invoice number and one invoice date. It lists line items with quantity and unit price. It shows a subtotal and tax and an invoice total. It does not list other invoices. It has no aging summary.
  1. In the Intuitive AI app, open class "AR Document".
  2. Open the Default Rule and open the Auto Extraction action ("AI Extraction").
  3. Paste each hint into the Hint box of its field row, and save the class.
  4. Correct the values on a few training documents of both kinds. The engine adds up to 2 matching training documents with saved correct values to each request as examples.
Document Type (Type: Text): field hint
Return Statement if the document lists several invoices with a running balance or an aging summary. Return Invoice if the document bills one sale with its own line items. Return only one of these two words.
Invoice Number (Type: Text): field hint
The number of this one invoice. It is labeled Invoice No or Invoice #. If the document is a statement that lists several invoices, return an empty string. Do not use a customer account number.
Amount Due (Type: Number): field hint
The total amount the customer must pay now. On an invoice it is labeled Invoice Total or Amount Due. On a statement it is labeled Balance Due or Total Due and it sums all open invoices. Do not use a line-item amount. Do not use an aging bucket such as 30 Days or 60 Days. Return a number with two decimals and no currency symbol.

How it works

  • Each hint names the words printed on the page (Statement of Account, aging, line items), so the model has concrete evidence to match.
  • Each classifier hint says what the other kind has that this kind does not. The model reads every class hint side by side and picks one.
  • The engine removes commas, parentheses and brackets from classifier hints, so the lists use "and" instead of commas. Each rule is its own sentence.
  • The strongest signal (the title) comes first, because the classifier focuses on the beginning of the document.
  • The three field hints use the same test (one invoice versus several invoices), so the model applies it the same way to every field.

Test it

  1. Open class "AR Statement" (or "AR Document") and select Test.
  2. In Configure Test, under Choose Class Tags, select AR. Upload 10 statements and 10 invoices, including statements with long invoice tables.
  3. Select Start Test. Check Matched Class and Document Confidence for each file, and Extraction Results for each field.

You should see

every statement matched to "AR Statement" (or Document Type = Statement) with an empty Invoice Number, and Amount Due equal to the Balance Due, not a line-item amount.

What can go wrong

Watch out

  • The first page is a cover letter. The classifier focuses on the beginning of the text. Add its wording to the hint ("It may start with a cover letter about the account balance"), or separate the cover letter earlier in the workflow.
  • Commas in a classifier hint. "Current, 30, 60, 90" becomes "Current 30 60 90". Write "Current and 30 Days and 60 Days".
  • The model returns no class. If no hint fits, the model answers "None" and every class gets 0 from this refiner. Add the missing wording to the right hint.
  • Similar class names. "AR Statement" and "AR Statement Copy" confuse the model even with hints. Rename one, or merge them.
  • A hint longer than 1000 characters. The end is cut without warning. Keep the deciding rules in the first sentences.