Document processing

Classify documents without forcing unknown types

Reading time
9 minutes
Updated
Published
Written by
modernagents editorial teammodernagents is an AI automation agency from Austria for SMEs, based in the Vienna region.
AI-generated image: Stepped metal document tray with an indigo side panel on linoleum

Perhaps at your business too, invoices, delivery notes, payment reminders and contracts arrive in the same inbox every morning, often as a single scan. Someone in the office opens each file, checks what it is and forwards it to the right place. AI document classification can take over this first look: the software says what kind of document it has in front of it and assigns it to one of the categories you have defined.

For this to work in daily life, your workflow must be able to do three things. It must recognise when a document is unknown and tell apart several documents in one file. The workflow must also check whether a document is linked to the right business case, for example the right purchase order. The most important preparation is a short list of your document types with clear boundaries, and a person who resolves uncertain cases by hand.

An example: a plumbing and heating wholesaler in Porto with 30 employees receives its incoming mail in a shared inbox. Today, Inês from accounts opens every attachment, recognises the invoice, the delivery note or the reminder and forwards it to purchasing, the warehouse or management. With the new setup, software should do this sorting, and Inês only looks at the cases where it is unsure.

Key takeaways

  • Keep three questions apart: what kind of document it is, which business case it belongs to and who may see it.
  • Start with a few document types that your team clearly tells apart, plus a separate "unknown" category.
  • Establish whether the software classifies whole files, single pages or single documents within a file.
  • Count hits and mistakes for each document type separately, not only in total.
  • A high success rate is of little use if you cannot see the exceptions.

01 / 09

Separate document type, business case and confidentiality

Inês receives an invoice from a supplier. That it is an invoice is the first question, the document type, and that it belongs to purchase order 471 is the second, the link to the business case. On the same day, a sick note from a warehouse employee arrives that only HR may see. This raises the third question, who may see a document.

Keep these three questions separate and do not pack them into one AI label. Otherwise the software can recognise the document type correctly, and the document still ends up with the wrong team. At the wholesaler, it can also end up in the wrong company if a separate installation company next to the wholesale business receives mail in the same inbox.

Start with a few document types that your team clearly tells apart: invoice, credit note, delivery note, contract, correspondence and unknown. A new category is only worth it if something different happens next. If two document types get the same checks, go to the same person and follow the same retention rules, they may not need a category of their own.

Describe each document type with examples that belong to it and examples that do not. At the wholesaler, for instance, a payment request arrives that looks like an invoice but may be a reminder about an invoice that Inês already knows. In the same way, a contract offer is not yet a signed contract. The word on the first page alone must not hide such differences.

02 / 09

Does the AI classify files, pages or separate documents?

At the end of the month, the supplier sends a 20-page scan. It can contain one invoice with supporting material, but it can also contain ten different invoices. What is correct depends on the content, not on the file extension.

So before you buy, establish what your software classifies: the whole file, each page on its own, or complete documents within a file. Some products only split a file into single documents if you switch this function on explicitly. Microsoft describes this for its product Document Intelligence; the details are in the section for your IT team below.

Test the splitting of documents independently of whether the document type is correct. Suppose the software recognises an invoice correctly but assigns its last page to the next business case. Then the invoice is still unusable for Inês. For her to find and correct such a mistake, she must see which file and which pages a document comes from.

03 / 09

What belongs in a document category catalogue?

A category catalogue is your list of document types. A first draft names, for each document type, strong evidence, a common confusion and what happens next:

Category Strong evidence Common confusion Next action
Invoice Charge for goods or services with an amount Reminder including a copied invoice Extract and validate fields
Credit note Correction or credit linked to an earlier transaction Invoice containing one negative line Check relationship to the original
Delivery note Delivered items and quantities Purchase order Associate with receipt process
Contract Agreement identifying parties and terms Draft or amendment Check version and applicability
Unknown Insufficient evidence for one category Unfamiliar supplier layout Manual classification

This table is a draft, and the teams who work with the documents should adapt it. A term such as "credit note" in particular does not mean the same thing everywhere in daily business. Write in the meaning that the next work step at your business actually needs. Have the responsible specialist label suitable examples. At the wholesaler, Inês does this with documents from the inbox.

Sender and filename help the software, but they do not decide on their own. A supplier who usually only sends invoices can also send a contract or advertising. If the intake channel, such as the inbox a document comes through, and its content do not match, the software should show this uncertainty rather than silently pick some category.

04 / 09

How do you test a document classifier so failures stay visible?

For the test, collect examples that your team has checked and approved, from different periods and from different sources, such as several senders and several inboxes. Keep the examples you use to set up or train the software separate from a fixed test set that you no longer change. Deliberately include confusions that are rare but can have serious consequences: a reminder that looks like an invoice, an offer that looks like a contract, or a document that belongs to the other company.

How is classification quality measured?

For each document type, count three things separately: how many documents the software assigned correctly, how many it wrongly put into this document type and how many it missed. A single success rate for everything can hide a small document type where the software is weak. At the wholesaler, that could be the few contracts a year. Google explains this separate counting for its product Document AI; there is more on this in the section for your IT team. The idea also applies if you use a different product.

For daily work, something else counts too: how many documents, and what share, go to Inês for review, and how long does she need for them? If your software has an adjustable threshold, you can choose a stricter threshold above which the software decides itself and below which it sends a document to review. Then it may route fewer documents wrongly, but Inês may get more work. Decide how strict it should be using your own documents and the consequences a mistake has for you. Do not copy a number from a vendor demo as a general value.

A broken file also belongs in the count. Suppose a supplier sends a damaged PDF that the software cannot open at all. Then it must not simply disappear from the statistics. The number of incoming documents should match the number of classified, excluded and unresolved documents.

Got a workflow like this?

Tell me about it. Honest take and a rough price, usually within a day.

05 / 09

Illustrative example: a mixed purchasing inbox

Suppose Inês puts together 120 documents from purchasing for a test: 60 invoices, 30 delivery notes, 20 purchase orders and ten other letters. The software labels 58 invoices correctly. It takes two invoices for delivery notes, and it takes one reminder for an invoice. Anyone who only says "almost everything was recognised" misses the additional false invoice, which could now get paid.

Inês looks at the three mistakes. The two invoices lack a clear heading on the first page, and the decisive amount appears on page two. And with the reminder, the software took the reference to the earlier invoice for a new charge. The improvement is therefore specific: the software should read related pages together, and reminders should go to review as a separate case.

Inês then repeats the test with the same, unchanged documents and adds fresh examples. The three old mistakes stay in the test set, so that they do not come back unnoticed. A document only passes when the category is correct and the right thing happens next. In this example, a correctly recognised invoice still fails the test if it lands in the task list of the installation company instead of the wholesale business.

06 / 09

How are corrections and new document types handled?

When Inês corrects a label by hand, the record should show what the software chose, what is correct, why, and who corrected it. Do not take such corrections into the software's training data without checking them. People can also classify wrongly, and sometimes a correction follows a new rule in the business rather than an extraction problem.

Unknown documents need a named person who reviews them regularly. When similar cases pile up, the team decides whether a new document type is needed or whether an existing description is unclear. Both are business changes. So record each new version of the catalogue. Afterwards, check whether documents still go to the right places and the right people see them.

Start small, with one intake stream, such as one inbox, and clear next steps. At the wholesaler, that is the invoice inbox first. In the end, the finished workflow must be able to account for every document. It is assigned, deliberately excluded, or still open, and the reason for this is visible. That completeness is more useful in daily work than an impressive success rate where you cannot see the exceptions.

You can start on this this week: take one day's incoming mail and write down for each document what it is, where it goes and who may see it. This gives you the first draft of your catalogue.

07 / 09

For your IT team

According to the Microsoft custom classification documentation, checked on 26 September 2026, Document Intelligence classifies documents using layout and language and returns page ranges. With API version 2024-11-30, automatic splitting must be enabled explicitly with splitMode: auto. The default is none.

Store the original file, the page range and the resulting document identifier for each document. This lets staff reconstruct and correct a bad split.

For measuring per document type, Google documents the separate evaluation of precision and recall using labelled Document AI test documents (Google Document AI evaluation). Precision here means how many of the assignments to a document type are correct, and recall how many of the real documents of this type the software found.

Treat a technical failure as a recorded outcome. A corrupt file that never reaches classification must not disappear from the denominator. Version changes to the category catalogue so that you know which version applied for each measurement.

08 / 09

Take the worksheet

Worksheet

Download the editable CSV table

Test documentExpected classConsequence
InvoiceInvoiceCapture draft
Priced quotationQuotationNo invoice approval
Invoice and contract in one PDFMixed inputSplit or review
Unreadable pageUnusable inputRequest replacement
New formUnknownNo invented classification

Columns to fill in, in the file: Your value / observation, Owner, Next action.

Download the editable CSV table (CSV). Add your own values, owners and open actions. This worksheet contains no measured client results.

09 / 09

These guides and service pages cover the decisions next to AI document classification:

For a first review of your workflow, start with a short description of how documents arrive and move on at your business, which software is involved and which exceptions are typical. Discuss it with modernagents.

ShareEmail

Related reading

AI document processing

Got a workflow like this?

Tell me about it. Honest take and a rough price, usually within a day.

Robert Van Ysendyck · Founder & Managing Director