UiPath Documentation
activities
latest
false
Document Understanding 活动
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

提取文档数据

使用“提取文档数据”活动从文档文件或文档数据对象中提取数据,并将结果存储在文档数据对象中。

UiPath.IntelligentOCR.StudioWeb.Activities.ExtractDocumentDataWithDocumentData<UiPath.IntelligentOCR.StudioWeb.Activities.DataExtraction.ExtendedExtractionResultForDocumentData>

描述​

从输入文件或文档数据对象中提取数据,并将结果存储到文档数据对象中。

在开始之前​

先决条件​

The Extract Document Data activity requires input objects of type Document Data or File. A possible use case for using this activity is to precede it with a Classify Document activity, that generates an object of type Document Data.

输入选项​

“提取文档数据”活动接收以下选项之一作为输入:

  • 文档数据 - 来自“分类文档”活动
  • 文件 - 来自“获取文件/文件夹”或“获取最新的电子邮件”活动

生成式模型支持的语言​

The supported languages for the generative models are the same as the OCR engine used, which depends on the project. For the Predefined and Generative Predefined projects, the OCR Engine used is UiPath Document OCR. For more information, visit the OCR Supported languages page.

活动使用的模型​

您可以将“提取文档数据”活动用于以下类型的项目和模型:

已知限制​

“生成式预定义”项目类型和相应的提取程序在 Automation Suite 中不可用。

向“提取文档数据”活动提供带有子文档的文档数据将触发运行时错误。此行为是设计使然。要从拆分文档中提取数据,请遍历每个子文档。

项目兼容性​

Windows | 跨平台

配置​

设计器面板​

  • Input - Requires you to specify the file itself, or Document Data, in case you have used other Document Understanding Activities before in your workflow, (for example, Classify Document). This field is required.

    重要提示:

    一个文件最多可包含 500 页。超出此限制的文件将无法提取。

  • Document Understanding project - Requires you to select your Document Understanding project from the dropdown list. This field is required. The available options are:

    • 预定义– 传统项目类型,使用建议用于标准场景的预训练专用模型。有关传统项目计费逻辑的更多信息,请访问“计量和计费逻辑” 。
    • 生成式预定义– 新式项目类型,使用预训练的生成式模型,接受指令作为提取文档数据的输入。有关新式项目计费逻辑的更多信息,请访问“计量和计费逻辑” 。
    • 预定义的非拉丁语言– 新式项目类型,将预训练模型用于非拉丁语文档处理场景。有关新式项目计费逻辑的更多信息,请访问“计量和计费逻辑” 。
    • 您连接到的租户和文件夹中的现有项目。
    • 您可以转到 Document Understanding 来创建自定义项目。有关更多信息,请访问模型构建简介。
      备注:

      如果您在租户上创建的项目超过 500 个,并使用“提取文档数据”活动,则 UiPath Studio 或 Studio Web 将不会显示最初 500 个项目之后的任何项目。因此,您不能使用这些项目。

  • Version - Appears for the Predefined and Predefined Non-Latin Languages projects, and for existing Document Understanding modern projects. Select the version name or tag that corresponds to the project version from which you want to process data. For instance, if you choose the Production tag assigned to Version 3, the activity processes data from Version 3 of your project in the production environment. You can also choose a specific version from the drop-down if you do not wish to use the staging and production tags. For more information about versions, visit Publishing models. This field is required.

  • Document type - Select the document type that defines the fields to extract. After you select a document type, the activity shows the extraction fields related to it. This field is required.

    • For the Predefined project, select a pre-trained model. Visit Out-of-the-box models for a list of pre-trained models that you can use.
      备注:

      The Extract Document Data activity extracts the information for the fields available on the selected document type (regardless of the actual type of the document). This is not applicable for generative models.

    • 对于预定义的非拉丁语言项目,您可以根据特定的非拉丁语文档布局,从三种提取中选择:
      • 日本发票– 建议用于日本发票文档。提取程序可以处理常见的日语发票布局,并且可以识别和提取关键发票字段,例如供应商信息、发票编号和币种。
      • 中国发票- 建议用于中国发票单据。提取程序可以处理常见的中国发票布局,并可以识别和提取关键发票字段,例如供应商信息、发票编号和币种。
      • 日本收据- 建议用于日语收据文档。您可以使用提取程序从日语收据中识别和提取商户名称、交易日期、总金额、税和币种等字段。
    • For existing Document Understanding modern projects, when you choose a tag from the Version field, the activity automatically selects the first deployed document type from the relevant version of your chosen project.
  • Extractor - This field is required. For the Generative Predefined project, select one of the following extractors, tailored to a specific document layout:

    备注:

    The information sent to the generative extractors goes to an LLM Model instance. This instance isn't publicly available, doesn't store the data sent, and doesn't use it for training purposes.

    • 长文档简单版式提取程序 – 推荐用于主要包含文本和标题的长表单文档。例如,您可以在租赁协议、主服务协议或其他类似文档上使用“长文档简单布局提取程序”。
    • 长文档复杂布局提取程序(预览版)– 建议用于包含图像、手写内容、表单控件、浮动标注框或其他复杂布局类型等元素的长表单文档。例如,您可以在保险单等文档或其他类似文档上使用“长文档复杂布局提取程序”。
    • 短文档复杂布局提取程序(预览版)– 建议用于包含图像、手写、表单控件、浮动标注框或其他复杂布局类型等元素的短文档。例如,您可以在由政府签发的身份证、医疗保健登记表或其他类似文档上使用“短文档复杂布局提取程序”。
  • Use Classification Result - Option available in both the Document type and Extractor lists. If the Generate data type property is set to false, you can opt for the Use Classification Result option. This option automatically uses a recommended extractor based on the document type resulted from the Classify Document activity. If multiple extractors can work with that document type, the activity returns an error. In this scenario, you must manually select your preferred extractor.

  • Document Type Details - This field appears when you select the Generative Predefined project. Prompt to identify the fields to be extracted, provided as key-value pairs, where the key represents the name of the field and the value a description for it, helping the extractor identify the corresponding value. This field is required. Select the field, and you will get a prompt with the following options, provided as pairs:

    • “字段名称” - 要求您输入要提取的字段名称,例如到期日期)(上限 30 个字符)
    • 说明- 要求您提供有关应从相应字段提取哪些信息的说明。允许的最大字符数为 1000。响应(即提取结果,也称为完成)字数限制为 700。也就是不得超过 700 个单词。这意味着您无法从单个提示词中提取超过 700 个单词。如果您的提取要求超过此限制,您可以将文档拆分为多个页面,单独处理,然后合并结果。
      提示:

      For good practices on how to use generative prompts, check the Generative extractor - Good practices page.

  • 使用解决方案资源- 启用此切换以选择 IXP 模型作为解决方案资源。仅当工作流是解决方案的一部分时,此选项才可用。选定的 IXP 模型将添加到解决方案中,显示在 Studio Web 的资源探测器中,并与解决方案的其余资源一起打包和部署。

    • 智能提取处理 (IXP) 模型(预览)- 选择在 Maestro 中的流画布上创建且要用于数据提取的智能提取处理 (IXP) 模型。仅当启用“使用解决方案资源”开关时,才会显示此字段。不能与IXP 模型(独立)一起使用。
    • IXP 模型(独立) - 选择要用于数据提取的独立 IXP 模型。仅当启用“使用解决方案资源”开关时,才会显示此字段。它不能与IXP 模型一起使用。

属性面板​

输入​
  • Timeout (seconds) - Maximum execution time (in seconds) for the call to the generative model. If the operation exceeds this timeout, it is automatically terminated to prevent delays or hangs. The default value is 3600. This field is required.
  • 自动验证- 使用此选项启用自动验证,此功能可帮助验证根据生成模型获得的数据提取结果。“自动验证” 字段的默认值为False 。
    备注:

    Auto-validation is available only for specialized extraction models. The option is disabled for the Generative Predefined project.

  • Generate data type - The default value is True. If set to True, indicates that the output should be generated based on the selected extractor, resulting in an IDocumentData<ExtractorType> object. Alternatively, if set to False, indicates that the data generation should be skipped, resulting in a generic IDocumentData<DictionaryData> object. When set to False, you can consume the results either through the Get/Set methods or through the strongly-typed ExtractionResultHandler navigator, available on the output as DocumentData.Data.Handler. Visit Document Data for additional details and limitations available for the two object types. This field is required.
Auto-validation configurations​
  • Confidence threshold - This field becomes visible once you enable Auto-validation. Extraction results falling below the threshold are compared to the generative extraction model. If they match, the system adjusts the extraction confidence to meet the threshold value. Possible threshold values range from 0 to 100. The default value is 0. If the value is set to 0, no validation is applied. However, if you set a specific value (from 0 to 100), the system checks all extraction results below this value. For example, if you set a confidence threshold of 80%, the system will apply the generative validation for fields with confidence below 80%.
输出​
  • Document data - All the extracted field data from the file, in a (field-name, field-value) format. Information can also be received from Classify Document. To learn how Document Data works and how to consume the extracted results for single and multi-value fields, visit Document data. When Generate data type is off, the DictionaryData output can also be navigated and edited with the strongly-typed ExtractionResultHandler navigator, via DocumentData.Data.Handler.

    当您将智能提取处理 (IXP) 非结构化文档项目与“提取文档数据”活动一起使用时,文档数据输出对象支持以下对象:

    • 结果以字段组的形式报告,而非以表格的形式报告。
    • 字段会返回项目中定义的特定字段类型,包括货币数量。
    • 文档验证任务将结果显示为字段组,而非表格。

    Any downstream processing or data manipulation logic that relies on this output must account for Field Group values. For the full list of supported field types, check FieldType Enum.

外部连接​
  • Credentials Asset - The Orchestrator credentials asset path used to authenticate against the Document Understanding tenant. The input should use the format <orchestratorFolder>/<assetName>.
  • 租户 URL - 用于对 Document Understanding 服务进行身份验证的租户 URL。输入应使用https://<base_url>/<organization>/<tenant>格式。
  • Connect to tenant - Connects to the Document Understanding instance of the specified tenant.
备注:

您必须使用访问作用域 → 自动化和 API配置凭据资产。对其他租户或组织的身份验证仅适用于支持此凭据资产配置的环境。

支持的型号​

生成预定义项目下可用的生成式提取程序可用于下表中描述的文档:

备注:

长文档复杂布局和短文档复杂布局提取程序当前在适用于公共部门环境的 Automation Cloud TM (FedRamp) 中不可用。

表格 1. 生成式提取程序支持的场景

提取程序推荐场景提供程序区域支持情况多模态支持1
长文档简单布局提取程序建议用于主要包含文本和标题的长文档。 例如,您可以在租赁协议、主服务协议或其他类似文档上使用“长文档简单布局提取程序”。Azure OpenAI澳大利亚、欧盟、印度、日本、新加坡、英国、美国、加拿大❌
长文档复杂布局提取程序(预览版)建议用于包含复杂布局(例如图像、手写文字、表单元素)或独特布局(例如浮动标注框)的长文档。您可以将此提取程序用于保单等布局复杂的长文档。Azure OpenAI美国、欧盟、日本、新加坡✅
短文档复杂布局提取程序(预览版)建议用于包含图像、手写文字、表单元素或复杂布局(例如浮动标注框)的较短文档(最多 20 页)。您可以将此提取程序用于政府身份证件或医疗接诊表等通常内容较短但布局更复杂的文档。Azure OpenAI美国、欧盟、日本、新加坡✅

1 多模式支持是指提取不同类型的数据输入,例如文本、图像、手写文本等的功能。

使用生成提取程序​

要快速开始使用“提取文档数据”活动的生成式功能,请执行以下步骤:

  1. 添加“提取文档数据”活动。
  2. From the Document Understanding project dropdown list, select Generative Predefined.
  3. For Extractor, select one of the following extractors: Long Document Simple Layout Extractor, Long Document Complex Layout Extractor, or Short Document Complex Layout Extractor. The Document Type Details property appears in the body of the activity.
  4. For Document Type Details, provide your instructions as Dictionary key-value pairs, where:
    • “字段名称”表示要从文档中提取的字段的名称。例如email address 。

    • “说明”表示提供给提取程序,用于提取字段的信息的说明。这是生成式提取程序用于识别相应值的说明。例如,请查看下表中的键值对示例:

      表 2. 生成式提取程序提示的键值对示例

      字段名称说明
      名称“候选人叫什么名字?”
      当前作业“候选人当前的工作是什么?”
      雇主“候选人当前的雇主是什么?”

      图 1. 生成式提取程序的键值对详细信息

此页面有帮助吗?

连接

需要帮助? 支持(opens in new window)

想要了解详细内容? UiPath Academy(opens in new window)

有问题? UiPath 论坛(opens in new window)

保持更新