Free cookie consent management tool by TermsFeed

Combine Classification and Extraction

On This Page

This approach is useful when:

  • Different document types require extracting different sets of fields.
  • Automating document processing improves efficiency and reduces manual intervention.
  • Adding manual review or default extraction when classification is inconclusive.

Implementation

Create AI skills

Create AI skill objects:

  1. In the first AI skill you create, select Classification > Documents.
  2. Create additional skills for each type of document you want to extract data from and select Extraction > Documents > Unstructured. As you edit the prompt, use the example prompts below and adapt them for your document type and field.

Example extraction prompts

The following examples show how you might structure a prompt to extract fields from different document types.

Tip:  The prompts below only reflect the fields to extract and are only part of the entire prompt.

Invoice extraction prompt
1
2
3
4
5
<fields>
--invoiceTotalCost (decimal)
--invoiceNumber (text)
--invoiceDate (date)
</fields>
Contract extraction prompt
1
2
3
4
5
6
<fields>
--contractId (text)
--contractStartDate (date)
--contractEndDate (date)
--contractingParties (text)
</fields>
Insurance claim extraction prompt
1
2
3
4
5
6
<fields>
--claimId (text)
--claimAmount (decimal)
--policyNumber (text)
--incidentDate (date)
</fields>

Create your process

To implement this recipe:

  1. Create a process model and add the following flows and gateways:
    1. Add and configure a Classify Documents smart service to your process model.
      • Remember to save the classified document type and confidence to process variables, so you can use them in the XOR node.
    2. Add an XOR gateway after the Classify Document smart service to route based on AI classification result.
    3. Add and configure an Execute Generative AI Skill smart service for each of the extraction AI skills you created.
    4. Configure the XOR gateway to route invoices, contracts, and claims to their respective extraction AI skills based on the classified type. If classification fails or confidence is low, route to a user input task for manual review or general extraction.

Test it out

Process model

  1. User uploads document, which is stored in Appian.
  2. AI classifies document type and stores the result in a process variable.
  3. XOR Gateway directs document to extraction based on classification:

    Document type Extraction AI skill
    Invoice Invoice Extraction
    Contract Contract Extraction
    Insurance Claim Claim Extraction
  4. Extracted data is stored and used for further processing.

By combining classification and extraction in a single process model, organizations can build a flexible, scalable document processing system that optimizes efficiency while maintaining robustness.

Feedback