Document Understanding Process - User Guide
Document Understanding Process - User Guide
Understanding
Process
Studio Template
Revision History ..................................................................................................................5
24.4-preview: ..................................................................................................................6
23.10: ..............................................................................................................................6
22.10: ..............................................................................................................................6
22.6-preview: ..................................................................................................................7
22.4: ................................................................................................................................7
22.2-preview: ..................................................................................................................7
21.10: ..............................................................................................................................8
Overview.............................................................................................................................9
Project Files.................................................................................................................. 17
📄 Data\Config.xlsx ................................................................................................. 17
📄 Main-ActionCenter.xaml.................................................................................... 17
📄 Main-Attended.xaml .......................................................................................... 18
📄 Framework\00_ReadConfigFile.xaml ................................................................ 18
📄 Framework\10_InitializeProcess.xaml............................................................... 18
📄 Framework\15_GetTransactionItem.xaml ........................................................ 18
📄 Framework\20_Digitize.xaml............................................................................. 19
📄 Framework\30_Classify.xaml ............................................................................ 19
📄 Framework\35_ClassificationBussinessRuleValidation.xaml ............................ 19
📄 Framework\40_TrainClassifiers.xaml ................................................................ 19
📄 Framework\50_Extract.xaml ............................................................................. 19
📄 Framework\55_ExtractionBussinessRuleValidation.xaml ................................. 20
📄 Framework\60_TrainExtractors.xaml ................................................................ 20
📄 Framework\70_Export.xaml .............................................................................. 21
📄 Framework\80_EndProcess.xaml ...................................................................... 21
📄 Framework\ReusableWorkflows\InvoicePostProcessing.xaml ......................... 21
📄 Framework\ReusableWorkflows\AutocorrectOcrMistakes.xaml ..................... 22
📄 Framework\ERR_AbortProcess.xaml................................................................. 22
📄 Framework\ReusableWorkflows\GetWritePermission.xaml ............................ 23
📄 Framework\ReusableWorkflows\GiveUpWritePermission.xaml ...................... 23
📄 Framework\ReusableWorkflows\LockFile.xaml ................................................ 23
📄 Framework\ReusableWorkflows\UnlockFile.xaml ............................................ 23
📄 Framework\ReusableWorkflows\SetTransactionProgress.xaml....................... 23
📄 Framework\ReusableWorkflows\SetTransactionStatus.xaml .......................... 23
23.10:
New features:
22.10:
New features:
• Testing:
o Added 19 tests under the test folder that test basic DU and framework
functionality.
o Added BatchTestingUtilities under the test folder. These help the tests to
run faster, but also during the development to save data to cache, and
not run the whole process again.
o Added a Cache folder based on the sample file we have.
• Main Logic:
o Added a flow decision that would make the workflow end successfully if
no more transaction items are present.
o Automatic detection of decimal points in Invoice Post Processing
o Added Receipt Post Processing
• Other:
o Validated new Out of the Box Insight dashboards.
Changes:
22.6-preview:
New features:
• Added C# support.
• Introduced Asset naming convention for better visibility of Document
Understanding Assets in Orchestrator
• Added new overriding Assets for Orchestrator Configuration.
Changes:
Bugfixes:
22.4:
New features:
Changes:
Bugfixes:
22.2-preview:
Changes:
Bugfixes:
21.10:
New features:
• New workflows for advanced Business Rule validation for Classification and
Extraction
• New workflow for post processing Invoices based on the OOTB (out of the box)
model.
• Validation Station/Action now only displays the relevant pages instead of the
whole file. Removed the PDF splitting functionality.
• Support for ML Extractor Trainer to use the auto-retrain feature in AI Center
• New assets / settings in the config file for skipping classification/extraction
training.
• New assets / settings in the config file to force documents through manual
validation (useful in development/UAT especially)
• New exception type: DocumentRejectedByUserException. This exception is
thrown when a user explicitly rejects a document during validation. When setting
the transaction status, a DocumentRejectedByUserException is treated the same
way as a BusinessRuleException
Changes:
Key Features
• Seamless getting started process with new Document Understanding projects.
• Suitable for all use cases: from quick demos to scalable implementation projects
• Production-ready. Implements built-in logging, exception handling, and retry
mechanisms.
• Common architecture for both Attended and Unattended (plus Action Center)
implementations. Simple to switch between solutions.
• 2021.10: Ability to post-process Invoices to minimize the number of hits to
Action Center
• Designed to make development, testing, deployment, debugging, and scaling
easy.
• Follows the best practices pertaining to RPA, Document Understanding,
Orchestration Processes, and Long-running workflows.
Generic Document Processing Flow
Keep in mind that the diagram above shows that the most detailed logical flow split into the smallest possible modules. In practice, it is to
be expected that some parts could be merged or might be completely excluded, as they are not required in a particular implementation.
🚩 Pre-Digitization Processing
Any processing that needs to take place before digitizing the document. E.g., applying
grayscale or a skew correction.
🚩 Digitize Document
A digital version of the document is obtained. In case the document is scanned, OCR
(Optical Character Recognition) is required.
🚩 Classify Document
🚩 Classification Successful?
The logic required to determine whether the classification was successful or not. Based
on this decision, classification validation might be needed.
Note: Deciding whether human validation is needed or not is a business decision.
If the automatic classification was unsuccessful (low confidence, business rules are not
met, etc.), send the document to a human operator for manual classification/validation
or rejection.
🚩 Pre-Extraction Processing
Any processing that needs to take place before the actual data extraction begins.
🚩 Data Extraction
🚩 Human Validation?
The logic required to determine whether the human validation of the extracted data
(validating the extracted data against pre-defined business rules, checking confidence
levels, OCR confidence, missing data, etc.) is needed or not.
Human-in-the-loop step where the human operator can correct automatically extracted
data or manually extract the missing data.
🚩 Post-Extraction Processing
Any processing that should be done to the extracted data before exporting it. E.g.,
formatting the data in a specific manner.
🚩 Data Export
Exporting the data to a persistent location so that it can be used by other processes or
by business users. Common examples: exporting to the Data Service, updating a
Database, or writing the results to an Excel, CSV, or JSON file.
🚩 Post-Export Processing
Any processing that should be done after the data is exported. E.g., merging data
extracted from multiple documents into a single result or sending a notification email.
Solution Architecture
Benefits:
1. A Queue Trigger, tasked to start a new job for every new Queue item, using the
settings stated in the image below
Note: Due to the current Job Count Strategy for triggers, some queue items experience
delays before a processing job is triggered. This behavior is on the roadmap to be
addressed.
2. Having the Dispatcher process use a Start Job activity
Note: Currently, only the Start Job And Get Reference activity has support for passing
job arguments. This activity is part of the UiPath.Persistence.Activities package.
Right-click on Main-Attended.xaml and set it as the Main workflow for the project.
Right-click on Main-ActionCenter.xaml and set it as the Main workflow for the project.
Project Files
📄 Data\Config.xlsx
Configuration file for project settings. Minimum configuration required:
📄 Main-ActionCenter.xaml
Workflow to be set and used as Main for attended Document Understanding processes
that use Action Center for Human-in-the-Loop.
Arguments:
📄 Main-Attended.xaml
Workflow to be set and used as Main for attended Document Understanding processes.
Arguments:
📄 Framework\00_ReadConfigFile.xaml
Reads the contents of the Config file into a Config dictionary at runtime.
No custom code was added here for the purpose of creating the example
implementation.
📄 Framework\10_InitializeProcess.xaml
Workflow that loads the Taxonomy and Orchestrator assets. Any process-specific
initialization code belongs here.
No custom code was added here for the purpose of creating the example
implementation.
📄 Framework\15_GetTransactionItem.xaml
Gets the next Transaction Item when using Orchestrator queues. The target file to be
processed is expected to be found under the TargetFile key of the Transaction Item’s
SpecificContent.
Also loads all the Transaction Item's SpecificContent into the Config dictionary for ease
of use.
No custom code was added here for the purpose of creating the example
implementation.
📄 Framework\20_Digitize.xaml
Workflow for Pre-Digitization and Digitization logic.
📄 Framework\30_Classify.xaml
Workflow for Classification.
The example implementation uses the Intelligent Keyword Classifier for all document
types. Please know that using the LearningData string is also possible.
📄 Framework\35_ClassificationBussinessRuleValidation.xaml
📄 Framework\40_TrainClassifiers.xaml
Workflow for Classifier training.
The example implementation uses the Intelligent Keyword Classifier Trainer for all
document types. It also uses the LockFile/UnlockFile reusable workflows in order to
regulate access when updating the learning file. Please know that using the
LearningData string is also possible.
📄 Framework\50_Extract.xaml
Workflow for Pre-Extraction Processing, Data Extraction.
By default, all results are sent to human validation, except for invoices that go through
the Invoice Post Processing workflow.
📄 Framework\60_TrainExtractors.xaml
Workflow for Extractor training.
The example implementation uses a simple mechanic of writing the extracted data to
XLSX files. This is only one of many export possibilities besides using Data Service, a
Database, using CSV, JSON format, etc.
📄 Framework\80_EndProcess.xaml
Workflow for Post-Export Processing and Process Cleanup logic.
No custom code was added here for the purpose of creating the example
implementation.
📄 Framework\ReusableWorkflows\InvoicePostProcessing.xaml
2021.10: This workflow implements invoice post-processing using the default OOTB
model. The ruleset to check against is defined in a dedicated sheet of the Config file.
The ruleset and the logic should be updated as required by the business process.
This should NOT be used as-is, except for demo purposes. For a real implementation,
the post-processing & validation should be tailored to the specifics of the business
process.
The default implementation uses EN-US culture information. This means '.' is the
decimal separator and "," is the thousand separator. (e.g.: 10,000.00)
📄 Framework\ReusableWorkflows\AutocorrectOcrMistakes.xaml
This workflow implements OCR auto correction by saving corrections made in Human in
the Loop. This feature is meant to be used for fields where the extracted value is
expected to be part of a limited set of options that do not have a high level of similarity
between them.
Examples of fields that are suitable for the OCR auto correction – Logo, Company Name,
Document Issuer Name.
Examples of fields that are not suitable for the OCR auto correction – Amount, Date, PO
Number, First Name, Last Name.
The workflow is not enabled by default and the following settings found in the
“AutocorrectOcrMistakes” sheet in the config file need to be customized in order to use
it:
As this feature uses changes done in Human in the Loop, adding blacklisted OCR values
or performing maintenance may be required. This can be done by modifying the learning
file saved in the DU storage bucket (check StorageBucketName and
AutocorrectStorageBucketDirectoryPath in the config file).
📄 Framework\ERR_HandleDocumentError.xaml
No custom code was added here for the purpose of creating the example
implementation.
📄 Framework\ERR_AbortProcess.xaml
Workflow that is executed if the process is aborted due to a terminating exception. Code
for error cleanup or for sending error notifications belongs here.
No custom code was added here for the purpose of creating the example
implementation.
📄 Framework\ReusableWorkflows\GetWritePermission.xaml
Helper workflow using a Queue with a single queue item as a semaphore mechanism to
regulate write access to classifier training files.
📄 Framework\ReusableWorkflows\GiveUpWritePermission.xaml
Helper workflow using a Queue with a single queue item as a semaphore mechanism to
regulate write access to classifier training files.
📄 Framework\ReusableWorkflows\LockFile.xaml
Helper workflow using simple lock/unlock mechanism to regulate write access to
classifier training files.
📄 Framework\ReusableWorkflows\UnlockFile.xaml
Helper workflow using simple lock/unlock mechanism to regulate write access to
classifier training files.
📄 Framework\ReusableWorkflows\SetTransactionProgress.xaml
Updates the TransactionProgress for the Transaction Item that is being processed (if
using queues).
📄 Framework\ReusableWorkflows\SetTransactionStatus.xaml
Sets and log the transaction's status. The approach is like the one used by the RE-
Framework.
📄 QuickStart\IntializeOrchestrator\IntializeOrchestrator.xaml
Workflow that can be used for quickly setting up the necessary Orchestrator resources
(Assets, Queues, Storage Buckets, Task Catalogs).
Quick Start Guide
Please see Document Understanding and Queues for the required Orchestrator version
of using queues.
🔧Orchestrator Configuration
• Configure your Document Understanding Api Key under an Orchestrator Asset
named DocumentUnderstandingApiKey.
• If using Action Center, create a Storage Bucket for your process.
• If needed, create a Queue for your process.
Fast batch creation of items in Orchestrator can be done by running the workflow
IntializeOrchestrator.xml placed in QuickStart\IntializeOrchestrator.
The process is using the IntializeOrchestratorConfig.xslx part by loading an excel
document in the assigned section. This can be found in
QuickStart\IntializeOrchestrator\Data.
The Process can create the following 4 item types in orchestrator:
1. Storage Bucket
2. Queue
3. Asset
4. Task Catalog
The parameters to be filled in are the following:
1. Name: Displayed name on Orchestrator
2. Value: Value that the specific item will have, if needed
3. Type: One of four listed above
4. Folder: Folder location where the item must be create in Orchestrator
Description: item description
🔧 Attended Automation
• Configure your Document Understanding Api Key under an Orchestrator Asset
named DocumentUnderstandingApiKey.
• If using queues, configure the DocumentUnderstandingQueueName.
• Configure the Settings for Attended Processes.
Note: We recommend becoming familiar with the solution and the project before
removing the example implementation and the taxonomy.
🔧 Unattended Automation
• Configure your Document Understanding Api Key under an Orchestrator Asset
named DocumentUnderstandingApiKey.
• If using Action Center, configure the StorageBucketName under the Settings
sheet,
• If using queues, configure the DocumentUnderstandingQueueName.
• Configure the Settings for Unattended Processes.