View this page in the latest version of Appian. Extraction Models Share Share via LinkedIn Reddit Email Copy Link Print On This Page The capabilities described on this page are included in Appian's advanced and premium capability tiers. Usage limits may apply. About extraction Extraction is the process of automatically identifying structured information from unstructured content, such as a document or paragraph field. An extraction process takes a document as input, identifies field values based on the labels the user has defined, and provides that data as an output. The process of extraction can also include a user reconciliation task to manually review that data was extracted correctly. The Extraction tab in DocCenter has two pages: Models and Instances. Models lists the extraction models you've previously created. When you click on a model, you see version information and performance metrics. Instances lists the processes where extraction models were executed. About natural language prompting You use natural language prompting to interact with AI models that power Appian's classification and extraction capabilities. Natural language means you describe a task in your own words, with no need to write code or AI-specific terminology. The models are designed to understand and act on natural language, but for the best results, you'll want to provide a lot of context. Imagine you are onboarding a new employee. On their first day, you are explaining to them how to identify a document type or the various fields within a document type. Your new employee is eager to help, but they might not have the experience to know what traits or fields to look for in an invoice or purchase order. So you provide them with examples or guidelines to help them see what patterns or traits are present in invoices or purchase orders. With these examples and details, the employee can quickly identify these documents and fields accurately. Or maybe you notice they need some additional examples. With some practice, the employee gets better at completing their task. The technology that powers DocCenter works much the same way. The more detail you can provide, the more likely the AI model will be to consistently provide correct results. Tip: Take a look at our tips for writing effective prompts. Usage considerations Supported file size DocCenter is capable of extracting data from files 25MB or less. Supported file types DocCenter is able to extract data from the following file types: CSV DOCX EML GIF HTML JPG, JPEG MSG PDF PNG TIFF XLSX (limited based on the complexity of the spreadsheet) Supported languages DocCenter supports the following languages for all configurations of extraction models: English French German Italian Portuguese Spanish Most other languages are supported with certain configurations enabled. To extract data in languages other than English, select Generative AI as the method and enable Visual field extraction as you define fields. Bounding boxes are not supported in this scenario. Browser configurations For reconciliation tasks to render properly, your browser may require certain configurations: Chrome: Allow third-party cookies must be enabled. Firefox: Add an exception for Appian in the Enhanced Tracking Protection settings. Page limits When used with reconciliation tasks, DocCenter is capable of extracting data from files that contain 500 or fewer pages. If you plan to extract data from documents and skip reconciliation, the page limit is 1000 pages. Create and configure an extraction model In the Extraction page group, click Models. Click on + Extraction Model. In step 1, enter the Model Details: Field Description Name Name to uniquely identify model. Description Description of model (optional). Key A read-only string, automatically generated to uniquely identify model. You'll use this value as the modelKey parameter when you use your extraction model as a subprocess. Bounding Boxes (Recommended) Displays bounding boxes in the reconciliation task. These boxes show where the model found the data to extract from the document. Advanced Layout Improves the extraction results for documents that have pages, signatures, or checkboxes. Usage limits apply. Automatic Rotation If needed, automatically rotate the document to its proper orientation to help improve extraction accuracy. In step 2, configure sections that appear in your document: Section Name: Name of section. Section Type: Choose how to configure sections in the document, if any. In step 3, choose how to create fields: Create & Configure Manually: Select this option if you want to add all fields manually in step 4. Describe Fields: Using natural language, describe the type of document you're extracting data from and AI Copilot suggests fields that appear in those documents. Extract from Document: Upload a PDF, Text file, or Excel workbook and describe the document. Click NEXT. In step 4, configure the fields on each tab: Field Definition: Field Definition Label Field name as it most often appears in documents. Key Field name as you'd like it to appear in a structured response such as JSON. Data Type Type of data present in this field. Options include Text, Paragraph, Integer, Decimal, Date, DateTime, Boolean, Table. List Select this option if the field contains multiple values. If you selected Table as the Data Type, click Edit table here. Method Choose how you'd like to extract the field data. Instructions Provide input that corresponds to the method you select. See Methods for more information. Visual When enabled, the AI model uses additional capabilities to locate the field. We recommend selecting this option for fields containing visual elements, such as a checkbox or a wet signature, or for elements where spatial layout is important such as a complex table. Extraction Details: Field Definition Label Read-only label of the field. Section If using section, choose the section where the field is most likely to appear. Options Rule Generates the options included in the prompt and as a dropdown on the reconcile screen. Post Process Rule Processes fields before displaying them on the reconcile screen. This can be used for doing things like reformatting dates or phone numbers. Reconciliation: Field Definition Label Read-only label of the field. Required If selected, this field is required to be populated during reconciliation and throws a validation error if blank. Field Validation Used to run additional validations on the extracted value in the reconciliation form. For example, flagging a date field value that's in the future. Reconciliation Instructions Instructions that appear for this field in the reconciliation task. Hidden Choose to hide a field from the reconciliation task. Exclude from Metrics Exclude this field from the accuracy calculation. This is useful for calculated fields or other information that won't appear in the reconciliation task. Click NEXT. In step 5, refine and preview your prompt: Field Definition Large Language Model Choose the LLM you'd like to use to extract data. Some models prioritize speed, while others provide more advanced reasoning. Choosing the right model depends on your extraction model's performance and accuracy needs. Role Tell the model what it is responsible for in this task. The role is pre-populated with text, but you can edit it as you see fit. Additional Instructions Tell the model anything else it should keep in mind as it performs analysis and extracts data. For example, you could tell the model, "Not all documents have all information and that's ok." Examples Add inputs and outputs the AI model can use as an example of what you expect to receive as a response when presented with text. Click CREATE to proceed with creating the extraction model. Test an extraction model Before you deploy anything to production, you want to know how well it meets your expectations. You can test an extraction model in the DocCenter application, review its accuracy metrics, and make any adjustments you'd like before the model extracts any real data. Note: Test the Extraction Models against at least 30 unique documents to ensure statistically significant results. Select documents that include variations and edge cases, such as low-quality scans, unusual formatting, or documents with missing data fields, to ensure robustness against real-world data. To test a model: In the Extraction page group, click Models. In the list, find and click on the model you want to test. Click RUN EXTRACTION. Choose what type of document you want to classify: Existing Document: Choose from a file in Appian. New Document: Upload a file. Add Text: Enter plain text. Optionally, select Set as Test Case to use this document to quickly and accurately validate new model versions. Click EXTRACT. Click the Instance tab, where your test run appears. Click the instance that represents your test to learn more, or glance at the Accuracy column to quickly see how well the model extracted data. If the instance status is Extracted, click Reconcile Fields in the related action menu. After running the full test set, refine the model as needed: If you notice that the model isn't performing well enough for your purposes, create a new version. If testing reveals errors, edit the prompt with additional instructions to cover the identified failures. Tip: To save time during frequent testing, set a particular instance as a test case. Test cases use the documents you previously uploaded and the values you reconciled, allowing you to quickly and accurately validate new model versions. Create test cases There are two primary ways to set an instance as a test case: During initial extraction Go to the Models tab and choose a model. Click the options icon and select Run Extraction. In the extraction run dialog, turn on the Set as Test Case toggle. Using this method, the reconciled values from your test input become the baseline for future instance retests. From a previously run instance Navigate to the Instance tab. Choose a previously run instance that represents your complete, reconciled test set. Click on the options icon and select Set as Test Case. Run test cases Use run test cases to evaluate subsequent model versions against your saved baseline. Update the prompt with your refinements to create a new model version. In the same model view, click RUN TEST CASES. Review the updated accuracy metric. Create a new model version Click on Extraction page group and select Models. Find the model you want to use as the basis for your new version. Then: Click the overflow menu in the model's row, and click New Version. OR Click the model name to open its summary. In the menu of options at the top of the page, click New Version. On the Create Extraction Model Version page, edit the following details: Version Description: Provide information about the updates you're making in this version. Fields Sections Prompt Examples Tip: See the previous section for a refresher on how to configure the model details. Click SAVE to save this version for future updates, or SAVE AND PUBLISH to save your changes and use this version now. All new extraction processes are now run and recorded against the latest published model version. Restore a previous model version If you want to use a previous version of an extraction model, you can restore it. This process creates a new version of the model, using a previous version's configurations. Click on Extraction page group and select Models. Click the name of a model in the list. Go to the Versions tab. Find the version you want to restore, and open its overflow menu. Click Restore Version. The Create Extraction Model Version page displays, with the configurations from that model version prepopulated. Update the model configurations if desired, and click SAVE or SAVE AND PUBLISH. In the list of versions, a new model version appears. The new model version's description refers to the previous model version you used to create it. Extraction options Rules Rules help provide the extraction model with additional guardrails that ensure field data is extracted in the way you expect. When you create an extraction model, you can add three types of rules: Options: This rule provides the model with a list of valid options, which also appear as a dropdown list in the reconciliation interface. For example, if you're extracting data from a field for a US state, you can create an options rule with the 50 states to ensure the model chooses from one of those. Field Validations: This rule validates that the extracted data fits certain logical criteria. If the data fails validation, the message appears on the reconciliation interface. For example, a validation rule can flag a date field value that's in the future. Post-Process: This rule transforms or changes extracted data before displaying that information on the reconcile screen. For example, a post-process rule can be used to reformat a phone number. Options rule Options rules provide the extraction model with valid responses it should be extracting. To create an options rule: Create a new expression rule. In the expression editor, create an array and list the valid options. For example, values can be hard-coded in a list or calculated by querying a record type. To see an example options rule, view AIA_Example_OptionsRule which returns three options: 1 2 3 4 5 { "Option 1", "Option 2", "Option 3" } Field Validation Field validation rules provide additional validation on the reconciliation form. For example, if a field is supposed to contain a date in the past, you can create a validation rule to catch any dates that don't adhere. The validation message appears on the reconciliation interface, prompting the user to correct the value. To create a field validation rule: Create a new expression rule. Create a rule input named value and type Any Type. The field value is passed into the validation rule using this rule input. In the expression editor, create your validation rule. It should use the input value and return a string error if invalid. To see an example validation rule, view AIA_Example_ValidationRule which returns a validation error if the input is not in the correct format: 1 2 3 4 5 6 7 8 9 if( a!isNullOrEmpty(ri!value), null, if( regexmatch("^\(\d{3}\) \d{3}-\d{4}$", ri!value), null, "Phone number must be in the format of (XXX) XXX-XXXX" ) ) Post-process rule Post-process rules reformat the extracted data before proceeding to validation and reconciliation. These rules can remove invalid characters or reformat dates. To create a post-process rule: Create a new expression rule. Create a rule input named input and type Map. In the expression editor, create your post-processing rule. It should index values out of the map, use them to post-process the extracted field, and return the newly formatted string. The available parameters are: Map: map containing the key-value pairs of the extracted data. ExtractionInstance: The Extraction Instance record for this extraction, used to get document or model version details. To see an example post-process rule, view AIA_Example_PostProcessRule which returns the value stripped of dashes: 1 2 3 4 5 6 7 8 if( or( a!isNullOrEmpty(ri!input), a!isNullOrEmpty(ri!input.value) ), null, substitute(ri!input.value, "-", "") ) Methods Methods instruct the model on how to extract data from the content. You'll choose an extraction method for each field. Methods can also help extract information that doesn't appear in the content, but is calculated using extracted information. The Instructions field takes different inputs based on the method you choose: Field Definition Input Generative AI (Default) Extract field from document using generative AI. Text - A natural language description of the field and the contents you expect it to contain. For example, you could ask for ZIP codes to only extract 5 digits instead of 9. The more detail you provide, the better outcomes you'll see. This prompt is the primary way to improve the accuracy of the model. Rule Calculate the field using an expression rule. Expression rule. The inputs to this expression rule are: ExtractionInstance Other extracted fields (excluding calculated fields) Calculated Calculate the field using another extraction field + generative AI. Text - A natural language description of a field that can be calculated using the other extracted fields. Examples: Extract the postal code from the address block Count the number of line items from the invoice Analyze Expense Extract the field using data often found in expense-related documents. Usage limits apply. Field selection Regex Extract the field using a regular expression. Text - A regular expression with a single capturing group. Examples: Phone number: ((\d{3}) \d{3}-\d{4}) Email: ([\w.-]+@[\w-]+.[a-zA-Z]{2,}) Social Security Number: (\d{3}-\d{2}-\d{4}) Search Query Extract additional data by asking questions or looking for specific terms or phrases in the document. Text - Natural language questions about the document, or terms or phrases to find. Generative AI This method is the standard way of extracting data. Using generative AI, data is extracted from the input documents using the type, extract instructions, and options as hints. Rule-based Extraction rules programmatically extract fields without the use of an AI tool. For example, extraction rules can return metadata about the document, such as its overall length. To create an extraction rule: Create a new expression rule. Create a rule input named input and type Map. In the expression editor, create your rule. It should index values out of the map and use them to calculate the extraction field. The available parameters are: ExtractionInstance: The Extraction Instance record for this extraction. To see an example extraction rule, view AIA_Example_ExtractionRule which returns whether the input document is over 20 pages: 1 2 3 4 5 6 7 8 9 10 11 12 /* This rule returns true if the document has more than 20 pages */ if( a!isNullOrEmpty(ri!input), null, if( getpdfmetadata( ri!input.ExtractionInstance['recordType!AIA Extraction Instance.documentId'] ).pageCount > 20, true, false ) ) Calculated Note: Calculated fields only use other extracted data as inputs. Ensure that you set up fields to extract the data you are using in your calculation. This method is the final method used against the data to calculate results. It uses the results from all of the previous extraction methods as input and uses Generative AI to calculate fields. This can be useful for combining other extraction fields together or further parsing of extracted fields. For example, if extracting dates from a resume, you could have a calculated field add all time periods together to determine the total amount of work experience. Analyze expense Usage limits apply. Select this method to extract financial information, such as costs and line items, from documents such as invoices. When using this method, a single field type must be selected. The model extracts the field value with highest confidence value for that field type. Regex (regular expressions) Regular expressions can extract the text programmatically from the input document text layer. The regex pattern must have a single capturing group. For example, if you are looking for an email address, you can use ([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}). Type your regular expression as plain text in the Extraction Prompt field when you choose Regex as the extraction method. Search query This method allows you to ask questions about the document contents, or look for specific terms or phrases. This method leverages the Advanced IDP Tools AI skill design object. Sections As you create an extraction model, you have the option to configure sections. Sections are helpful for two reasons: Sections break larger documents into smaller chunks. You assign fields to those sections, which helps the AI model more easily locate and extract data. For larger documents (> 20 pages), it can be helpful to break the document into smaller chunks using various sections with rules. Sections organize data on the reconciliation screen. This can help users find and confirm that data was extracted correctly, or help them update fields if needed. To use sections solely to organize data on the reconciliation screen, simply enter the section name into the picker in the extraction model version update form. Available section types: General: Creates no section for the document. Page Range: Split a document into a section using a fixed page range. Start Page: Page number to start the section. End Page: Page number to end the section. End of Document: Create a section starting at the end of the document and going back a certain number of pages. For example, if you want to create a section for an index that appears at the end of a document, count the number of pages in the index and enter it here. If the index is 5 pages, the AI model considers the last 5 pages of each document to be the index. Number of Pages: Number of pages before the end of the document to start the section. Table of Contents: Create a section based on the table of contents in the document. The table of contents is assumed to be within the first 10 pages of the document. Generative AI determines the start and end page for a particular section title you input. Additional processing occurs to determine if there is any offset between the page numbers in the table of contents and the actual page numbers of the document. Section Name: Input the name of the section as it appears in the table of contents. Find Text on Page: Create a section using the pages where particular text is first found. Ensure that the section start page is before the section end page when you enter the start and end text. Start Text: The text that first appears on a page where the section starts. End Text: The text that first appears on a page where the section ends. Use the model Once your extraction model meets your accuracy benchmarks, you're ready to add it to your business process. Straight through processing Before you further automate an extraction process, you want to be confident that the extracted data is accurate. To gain confidence, you can set up multiple validations and checks for the extracted data. The combination of features on the Straight Through Processing tab allow you to configure automated checks in multiple ways and in combination with each other to best meet your needs: Confidence threshold: Call attention to extracted fields that the model isn't confident it extracted correctly. Sampling: Review a small portion of extracted documents to verify data is extracted correctly. Validations: Use conditions to verify anything about the extracted content. AI Review: use AI to further validate that your model's extracted values are accurate. Tip: If any model instance is flagged by the options that you have set up on this tab, that instance will appear as Extracted with Errors, encouraging manual review. Confidence threshold Models provide confidence scores to indicate how sure they are of their predictions, including extracted values. Confidence thresholds define the lower limit of what you're comfortable automating: If a model's confidence score for a certain field falls below the threshold you've defined, that field is flagged for manual review. Confidence thresholds can be helpful by calling attention to extracted fields that the model isn't confident it extracted correctly. Human reviewers can spend their time manually reviewing fields and documents where AI is less sure, and you can feel comfortable knowing that the automatically processed documents meet your standards. The confidence score can also be used in downstream workflows to help further automate your document processes. Note: To use confidence scores on an extraction model, the model must have Bounding Boxes or Advanced Layout enabled in the Model Details. To enable field flagging based on confidence thresholds: Go to the Straight Through Processing tab. In the Settings section, click next to Confidence Threshold. Enable Use Confidence to Flag Fields. Set the Threshold value to your desired level. Note: The confidence threshold can only be set in increments of 10, from 10 to 90. Click SAVE. When confidence thresholds are enabled, DocCenter flags extracted fields that fall below the threshold. You'll see these flags next to the extracted fields in the reconciliation task. Learn more about how confidence is calculated and how it relates to other metrics like accuracy. Sampling rate When you process high volumes of documents, you may find it useful to manually reconcile a small portion of those documents to verify data is extracted correctly. You can configure a sampling rate, which determines the size of that portion to manually verify. DocCenter randomly chooses a portion of documents for you to manually review based on the sampling rate you set. Tip: Sampled documents won't include other documents flagged due to confidence thresholds, validations, or AI review. To enable sampling: Go to the Straight Through Processing tab. In the Settings section, click next to Sampling Rate. Turn on Enable Sampling to Verify Accuracy. Adjust the Sampling Rate value based on your preference. You can update this value as needed. We recommend starting at a higher sampling rate for new models or if you're extracting data from important documents. Click SAVE. Validations Validation rules are based on conditions you want to verify in the extracted document. This can be as simple as verifying that fields are not blank, or as complicated as calling an integration to verify an address exists. You can validate data for individual fields or entire document: Field validations only validate the data within a single field and have no context about the rest of the extracted data. You configure field validations when you create the model. Model validations can validate across fields in a document. For example, a validation can ensure that the total of each of my line items adds up to the invoice total. Validations are configured at a model version level and can be accessed through the Validation Rules tab on a Model Version dashboard. Create a model validation To create a new validation do the following: In DocCenter, navigate to the model where you want to add a validation. Click the Straight Through Processing tab. Click the CREATE MODEL VALIDATION RULE button. Populate the following fields: Name: This name appears on extraction instances when a validation error is triggered. Priority: Relative importance of the validation rule, which displays if the validation error is triggered. Build Your Rule: Describe Validation: Describe the validation in your own words, and AI will generate conditions for you. Expression Rule: Select the Appian expression rule containing your validation. This rule should: take a single parameter called parameters of type Map, containing the instance, instanceMap, and modelVersionFields. return a Map with the following fields: result: Whether the rule passed or failed. message: Error message to display if failed. Test the rule by providing sample data, or use AI Copilot to generate sample test data for you. Click RUN TEST. Confirm that the output in the Result field makes sense. Click CREATE. DocCenter includes the following example expression rules: AIA_RULE_ExampleValidationFirstLastName - validates that a first and last name are not both blank. AIA_RULE_ExampleValidationRuleSalesOrderLines - validates that the number of sales order line items is > 0. AI Review You can also use AI to further validate that your model's extracted values are accurate. After AI extracts the data from a document, a second AI model verifies those extractions. If the AI review detects that an extracted field may be incorrect, it provides you with suggestions on what the correct value may be. Tip: AI Review is enabled per model. When enabled, it will apply to all instances for that model, increasing your AI Action usage. Set up AI review To enable AI review for your model: Go to the Straight Through Processing tab. In the AI Review section, click SET UP AI REVIEW. Select the fields and tables you want AI to review. All fields are selected by default, except those you've hidden from reconciliation or excluded from metrics. All tables are selected by default. Review the AI Review Prompt: Select the Large Language Model you'd like to use. Review the Role field to add or change details about the role the AI model should assume when reviewing. Go to the Additional Instructions field to add specific instructions for the AI model to use when reviewing extracted values. Click SAVE. Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to close That's it! When AI review is enabled, it automatically occurs on all instances that use this extraction model. Users see AI's suggestions as they complete the reconciliation task. To disable AI review for a model: Go to the Straight Through Processing tab. Click . Click Clear All to deselect all fields and tables. Click SAVE. Add triggers Extraction is often one part of a larger business workflow. To help further automate your document-based processes, you can create triggers that initiate other process models when extraction activities are complete. For example, after the model extracts data from Invoices, you can kick off the process that saves the data to your record types and compiles a report for the finance department. Note: You can only create one trigger per activity type in a given model. Reconciliation is the only available activity type at this time. Keep in mind that triggered processes need to meet certain requirements. To create a trigger: Go to the extraction model where you want to add a trigger. Open the Triggers tab. Click CREATE TRIGGER. Enter the following configurations: When this activity completes: Select the activity you want to base the trigger on. Currently, Reconciliation is the only available option. Run this process model: Choose the process model to start when the activity is complete. Trigger this process to run: Synchronously or Asynchronously. Click ADD TRIGGER. Every time the extraction model runs, your chosen process model will automatically start when the chosen activity is complete. Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to close To edit a trigger: Go to the extraction model where you want to edit a trigger. Open the Triggers tab. Click Update Trigger . Change the configurations as desired. Click UPDATE TRIGGER. To delete a trigger, open the Triggers tab and click Delete Trigger in the list. Requirements for triggered processes For triggers to work effectively and execute processes reliably, the process model should meet the following requirements: It must have a single parameterized process variable named instance with AIA Extraction Instance as its type The process model object must have View permissions for the AIA Operations group. The process model should have flows that help account for re-runs or updated runs. You can only create one trigger per AI model. If you need to trigger more than one process model, create a wrapper process model containing all needed processes, and call that wrapper process model here. Feedback Was this page helpful? SHARE FEEDBACK Loading...