December 20, 2024
5 min.

Automate document classification with this AI workflow

Kavian Braanaas

Content Writer

Indexing documents with pre-defined categories plays a vital role in organizing, routing, and archiving within business processes. However, when documents are stored in unstructured formats like PDFs and images, the task of classifying them becomes highly repetitive and manual.

In this example, we’ll use Cradl AI to automate a time-consuming document workflow many businesses are familiar with: employee expense management. We'll set up an AI model that categorises and validates common receipt types, such as food, lodging and transportation. Additionally, we’ll connect incoming emails to the AI model, enabling receipts received as email attachments to be classified with minimal manual effort.

Create a Cradl AI model with the «Enumerations» field

First, make sure you've created a Cradl AI account.

Once you're logged in, the next step is to create an AI model that can classify documents using the unique Enumerations field.

Screenshot of the Create Model user interface inside the Cradl AI app


When setting up the Enumerations field, you’ll define a collection of labels that are used to categorise your documents. Unlike the other fields, which are used to locate and extract values, the Enumerations field infers a category which is not explicitly stated on the document based on its content and layout.

You can also enable the Cradl AI engine to work together with third-party LLMs such as Claude Sonnet to boost prediction accuracy even further. These LLMs are particularly good at understanding context, which makes them a great addition to any model that uses the Enumerations field.

Screenshot of the LLM prompt optimization user interface inside the Cradl AI app

Classify your first document

With your AI model set up, you're ready to classify your first document.

Click on «Run» from your dashboard and upload your documents. Once uploaded, Cradl AI will process the documents, and you can review the results in the «Validator».

Screenshot of the Validator user interface inside the Cradl AI app


If any adjustments are needed, you can make corrections to the classification. After making your edits, click «Validate» to finalise the classification and export the output as JSON. The model will use your feedback to improve its classification accuracy, continuously learning and refining its process over time.

Automate classification of email attachments

Cradl AI makes it easy to automate the classification of documents through a number of ready-to-use integrations. A popular use case is indexing email attachments with a pre-defined category automatically.

To set it up, select Email from the list of available triggers in Cradl AI. This will generate a dedicated Cradl AI email address, which you can use to receive documents directly.

Screenshot of the Email Integration user interface inside the Cradl AI app


Test it by sending an email with a document attached to the generated email address. The document will be automatically processed by your AI model, and you can view the result in the Validator. This automated process ensures that incoming documents are categorised in real time with minimal manual effort.

Next steps

Once a document has been processed and validated, Cradl AI generates a JSON output containing information defined by the AI model, including the document’s classification. This data can then be exported to third-party integrations like Power Automate, Zapier, webhooks, or API endpoints.

From there, additional automation is possible. For example, if a receipt's receipt_type value is marked as "invalid," an automated email notification can be sent back to the sender.

Screenshot of the Json output user interface inside the Cradl AI app

Summary

Cradl AI provides an efficient and automated solution for document classification workflows. By setting up an AI model, classifying documents, and automating email attachment processing, businesses can significantly reduce manual work and improve operational efficiency. Integrations with third-party tools further enhance the automation process, allowing for seamless workflows across various platforms.

Get started for free

We’ll help get you started with your document automation journey.

Schedule a free demo with our team today!