- 概述
- Document Understanding 流程
- 快速入门教程
- 框架组件
- ML 包
- 管道
- Data Manager
- OCR 服务
- 部署在 Automation Suite 中的 Document Understanding
- 在 AI Center 独立版中部署的 Document Understanding
- 深度学习
- 许可
- 参考
- UiPath.Abbyy.Activities
- UiPath.AbbyyEmbedded.Activities
- UiPath.DocumentUnderstanding.ML.Activities
- UiPath.DocumentUnderstanding.OCR.LocalServer.Activities
- UiPath.Intelligent OCR.Activities
- UiPath.OCR.Activities
- UiPath.OCR.Contracts
- UiPath.DocumentProcessing.Contracts
- UiPath.OmniPage.Activities
- UiPath.PDF.Activities
使用附加字段重新训练发票
此页面旨在帮助首次使用 Document Understanding 的用户。
For scalable production deployments, we strongly recommend using the Document Understanding Process available in UiPath Studio under the Templates section.
本快速入门向您展示如何重新训练开箱即用的发票 ML 模型,以再提取一个字段。
Let’s use the same workflow we used for the receipts in the previous quickstart and modify it so it can support invoices.
为此,我们需要在工作流中执行以下步骤:
- 修改分类
- 添加分类器
- 添加机器学习提取程序
- 标记数据
- 重新训练发票 ML 模型
现在,让我们详细了解每个步骤。
1. 修改分类
在此步骤中,我们需要修改分类以添加发票文档类型。
To do so, open Taxonomy Manager and create group named "Semi Structured Documents", a category named "Finance", a document type named "Invoices". Create the above listed fields with user-friendly names along with respective data types.
- 名称 -
Text - 供应商地址 -
Address - 账单名称 -
Text - 账单地址 -
Address - 收货地址 -
Address - 发票编号 -
Text - 订单号 -
Text - 供应商增值税号 -
Text - 日期 -
Date - 税金 -
Number - 总计 -
Number - 付款条款 -
Text - 净额 -
Number - 到期日 -
Date - 折扣 -
Number - 运费 -
Number - 付款地址 -
Address - 说明 -
Text - 项目 -
Table- 说明 -
Text - 数量 -
Number - 单价 -
Number - 行数量 -
Number - 项目订单号 -
Text - 行号 -
Text - 部分编号 -
Text - 账单增值税号 -
Text
- 说明 -
2. 添加分类器
在此步骤中,我们需要添加分类器,以便使用工作流处理收据和发票。
由于我们的工作流现在支持“收据”和“发票”两种文档类型,因此我们需要添加分类器以区分作为输入的不同文档类型:
-
Add a Classify Document Scope after the Digitize Document activity and provide the DocumentPath,DocumentText, DocumentObjectModel, and Taxonomy as input arguments and capture the ClassificationResults in a new variable. We need this variable to check what document(s) we are processing.
-
We also need to specify one or more classifiers. In this example, we are using the Intelligent Keyword Classifier. Add it to the Classify Document Scope activity.
This page helps you take an educated decision on what classification method you should use in different scenarios.
-
Train the classifier as described here.
-
通过为这两种文档类型启用分类器来配置分类器。
-
Depending on your use case, you might want to validate the classification. You can do that using the Present Classification Station or the Create Document Classification Action and Wait For Document Classification Action And Resume activities.
3. 添加机器学习提取程序
In this step, we need to add a Machine Learning Extractor to the Data Extraction Scope activity and connect it to the Invoices public endpoint.
该过程与我们之前添加的先前收据机器学习提取程序相同:
-
在收据机器学习提取程序旁边添加“机器学习提取程序”活动。
-
Provide the Invoices public endpoint, namely https://du.uipath.com/ie/invoices/, and an API key to the extractor.
-
通过将在分类管理器中创建的字段映射到 ML 模型中的可用字段,配置提取程序以使用发票:
-
请勿忘记使用“分类文档作用域”输出的“分类结果”变量作为“数据提取作用域”的输入,而不是指定“文档类型 ID”。
您应该得到如下结果:
-
运行工作流以测试它是否能正确处理发票。
4. 标记数据
在重新训练基本发票 ML 模型之前,我们需要为数据加上标签,以使其支持新的 IBAN 字段。
-
考虑到您需要解决的用例的复杂性,收集足够数量的需求和发票文档示例。
Label 50 pages, as explained on this documentation page.
-
Gain access to an instance of Document Manager either on premises or in AI Center in the Cloud. Make sure you have the permissions to use Document Manager.
-
创建一个 AI Center 项目,转到“数据标签”>“UiPath Document Understanding”,然后创建一个“数据标签”会话。
-
Configure an OCR Engine as described here, try importing a diverse set of your production documents and make sure that the OCR engine reads the text you need to extract.
More suggestions in this section. Only proceed to next step after you have settled on a OCR engine.
-
Create a fresh Document Manager session, and import a Training set and an Evaluation set, while making sure to check the Make this a Test set checkbox when importing the Evaluation set.
-
创建并配置 IBAN 字段。
More advanced guidelines are available in this section.
-
Label a Training dataset and an Evaluation dataset as described here.
此处描述的 Document Manager 预加标签功能可以使加标签工作变得更加容易。
-
首先从“Document Manager”视图顶部的筛选器下拉列表中选择评估集,然后将训练集导出到 AI Center。
接下来,让我们创建模型,重新训练并部署它。
5. 重新训练发票 ML 模型
现在,我们的工作流支持处理发票,我们需要从发票中提取 IBAN,此字段是开箱即用的发票 ML 模型默认情况下不会选取的字段。这意味着我们需要从基本模型开始重新训练新模型。
-
Create an ML Package as described here. If your document type is different from the ones available out-of-the-box, then choose the DocumentUnderstanding ML Package. Otherwise, use the package closest to the document type you need to extract.
-
Create a Training Pipeline as described here using the Input dataset which you exported in the previous section from Document Manager.
-
当训练完成并且您有包次要版本 1 时,请在此次要版本上运行评估管道,并并排检查 evaluation.xlsx。
Use the detailed guidelines here.
-
If the evaluation results are satisfactory, go to the ML Skills view and create an ML Skill using the new minor version of the ML Package. If you want to use this to do prelabeling in Document Manager, you need to click on the Modify Current Deployment button at the top right of the ML Skill view and toggle on the Make ML Skill Public.
-
创建 ML 技能后,我们现在需要在 Studio 中使用它。最简单的方法是按此处所述将 ML 技能设为公开。然后,唯一要做的就是将我们最初在工作流中添加到机器学习提取程序的发票 ML 模型公共端点替换为 ML 技能的公共端点。
-
运行工作流,您应该会看到沿默认发票字段提取新添加的 IBAN 字段。
下载示例
请使用此链接下载此示例项目。您需要将发票的机器学习提取程序从端点模式更改为经过训练的 ML 技能。