|
| 1 | +# Document Understanding Sample |
| 2 | + |
| 3 | +This sample demonstrates how to use UiPath Document Understanding capabilities with the UiPath Python SDK to classify, extract and validate data from documents. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +Document Understanding enables automated processing of documents through: |
| 8 | + |
| 9 | +- **Classification**: Identify document types |
| 10 | +- **Extraction**: Extract data from classified documents |
| 11 | +- **Validation**: Create human-in-the-loop validation actions for review |
| 12 | + |
| 13 | +This sample includes three Document Understanding approaches: |
| 14 | + |
| 15 | +- **IXP (Intelligent Xtraction and Processing)** (`src/ixp.py`) - [IXP documentation](https://docs.uipath.com/ixp/automation-cloud/latest/overview/introduction) |
| 16 | +- **Modern Projects** (`src/du_modern.py`) - [Modern DU documentation](https://docs.uipath.com/document-understanding/automation-cloud/latest/user-guide/about-document-understanding) |
| 17 | +- **Pretrained Models** (`src/pretrained.py`) - [Pretrained models documentation](https://docs.uipath.com/document-understanding/automation-cloud/latest/user-guide/out-of-the-box-pre-trained-ml-packages) |
| 18 | + |
| 19 | +## Prerequisites |
| 20 | + |
| 21 | +- UiPath Automation Suite or Automation Cloud tenant |
| 22 | +- Document Understanding projects deployed with appropriate tags ( [DU Modern publish documentation](https://docs.uipath.com/document-understanding/automation-cloud/latest/user-guide/publish) / [IXP model deployment documentation](https://docs.uipath.com/document-understanding/automation-cloud/latest/user-guide/publish) ) |
| 23 | +- Action catalog configured for validation actions ( [Actions documentation](https://docs.uipath.com/action-center/automation-cloud/latest/user-guide/about-actions) ) |
| 24 | +- Storage bucket for validation data ( [Storage buckets documentation](https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/about-storage-buckets) ) |
| 25 | + |
| 26 | +## Setup |
| 27 | + |
| 28 | +1. **Install dependencies**: |
| 29 | + |
| 30 | + ```bash |
| 31 | + uv sync |
| 32 | + ``` |
| 33 | + |
| 34 | +2. **Configure UiPath credentials and initialize project**: |
| 35 | + |
| 36 | + ```bash |
| 37 | + uv run uipath auth |
| 38 | + uv run uipath init |
| 39 | + ``` |
| 40 | + |
| 41 | +3. **Update sample parameters**: |
| 42 | + |
| 43 | + Edit the sample files to match your environment: |
| 44 | + - Project names and tags |
| 45 | + - Document type names |
| 46 | + - Action catalog and folder names |
| 47 | + - Storage bucket configuration |
| 48 | + |
| 49 | +## Usage |
| 50 | + |
| 51 | +Run the complete sample workflow: |
| 52 | + |
| 53 | +```bash |
| 54 | +uv run uipath run main |
| 55 | +``` |
| 56 | + |
| 57 | +Or run individual samples: |
| 58 | + |
| 59 | +```python |
| 60 | +from src import ixp, du_modern, pretrained |
| 61 | + |
| 62 | +# IXP extraction and validation |
| 63 | +ixp.extract_validate() |
| 64 | + |
| 65 | +# Modern project |
| 66 | +du_modern.extract_validate() |
| 67 | +du_modern.classify_extract_validate() |
| 68 | + |
| 69 | +# Pretrained model |
| 70 | +pretrained.extract_validate() |
| 71 | +pretrained.classify_extract_validate() |
| 72 | +``` |
0 commit comments