- 概述
- 文档处理合同
- 发行说明
- 关于文档处理合同
- Box 类
- IPersistedActivity 接口
- PrettyBoxConverter 类
- IClassifierActivity 接口
- IClassifierCapabilitiesProvider 接口
- 分类器文档类型类
- 分类器结果类
- 分类器代码活动类
- 分类器原生活动类
- 分类器异步代码活动类
- 分类器文档类型功能类
- ContentValidationData Class
- EvaluatedBusinessRulesForFieldValue Class
- EvaluatedBusinessRuleDetails Class
- 提取程序异步代码活动类
- 提取程序代码活动类
- 提取程序文档类型类
- 提取程序文档类型功能类
- 提取程序字段功能类
- 提取程序原生活动类
- 提取程序结果类
- FieldValue Class
- FieldValueResult Class
- ICapabilitiesProvider 接口
- IExtractorActivity 接口
- 提取程序有效负载类
- 文档操作优先级枚举
- 文档操作数据类
- 文档操作状态枚举
- 文档操作类型枚举
- 文档分类操作数据类
- 文档验证操作数据类
- 用户数据类
- 文档类
- 文档拆分结果类
- DomExtensions 类
- 页类
- 页面分区类
- 多边形类
- 多边形转换器类
- 元数据类
- 词组类
- 词类
- 处理源枚举
- 结果表格单元类
- 结果表值类
- 结果表列信息类
- 结果表类
- 旋转枚举
- Rule Class
- RuleResult Class
- RuleSet Class
- RuleSetResult Class
- 分区类型枚举
- 词组类型枚举
- IDocumentTextProjection 接口
- 分类结果类
- 提取结果类
- 结果文档类
- 结果文档范围类
- 结果数据点类
- 结果值类
- 结果内容引用类
- 结果值令牌类
- 结果派生字段类
- 结果数据源枚举
- 结果常量类
- 简单字段值类
- 表字段值类
- 文档组类
- 文档分类类
- 文档类型类
- 字段类
- 字段类型枚举
- FieldValueDetails Class
- 语言信息类
- 元数据输入类
- 文本类型枚举
- 类型字段类
- ITrackingActivity 接口
- ITrainableActivity 接口
- ITrainableClassifierActivity 接口
- ITrainableExtractorActivity 接口
- 可训练的分类器异步代码活动类
- 可训练的分类器代码活动类
- 可训练的分类器原生活动类
- 可训练的提取程序异步代码活动类
- 可训练的提取程序代码活动类
- 可训练的提取程序原生活动类
- BasicDataPoint Class
- BasicValue Class
- ComponentCollectionFacade Class
- DataPointFacadeBase Class
- ExtractionResultHandler Class
- FieldGroupDataPoint Class
- FieldGroupValue Class
- FieldLookupBase Class
- FieldRedactionSettings Class
- RedactionOptions Class (Preview)
- RedactionType Enum
- ResultsValueFacadeBase Class
- TableDataPoint Class
- TableRow Class
- TableValue Class
- WildcardDataPoint Class
- WildcardDataPointCollection Class
- Document Understanding ML
- Document Understanding OCR 本地服务器
- Document Understanding
- 智能 OCR
- 发行说明
- 关于“智能 OCR”活动包
- 项目兼容性
- 加载分类
- 将文档数字化
- 分类文档作用域
- 基于关键词的分类器
- Document Understanding 项目分类器
- 智能关键词分类器
- 创建文档分类操作
- 创建文档验证工件
- 检索文档验证工件
- 等待文档分类操作然后继续
- 训练分类器范围
- 基于关键词的分类训练器
- 智能关键词分类训练器
- 数据提取作用域
- Document Understanding 项目提取程序
- Document Understanding 项目提取程序训练器
- 基于正则表达式的提取程序
- 表单提取程序
- 智能表单提取程序
- 文档脱敏
- 创建文档验证操作
- 等待文档验证操作然后继续
- 训练提取程序范围
- 导出提取结果
- 机器学习提取程序
- 机器学习提取程序训练器
- 机器学习分类器
- 机器学习分类训练器
- 生成分类器
- 生成式提取程序
- 配置身份验证
- ML 服务
- OCR
- OCR 合同
- OmniPage
- PDF
- [未公开] Abbyy
- [未列出] Abbyy 嵌入式
Coded automation APIs for the Document Understanding activities package, covering document classification, data extraction, and validation artifacts.
UiPath.DocumentUnderstanding.Activities
Coded workflow API for classifying documents, extracting structured data, and creating and retrieving document validation artifacts. These APIs are available when designing coded automations. For an introduction to coded automations and how to design them using APIs, see Coded Automations.
- 服务访问者:
du(类型IDocumentUnderstandingService) - 所需的包:
"UiPath.DocumentUnderstanding.Activities": "*"依赖项中的project.json。
自动导入的命名空间
The following namespaces are automatically available in coded workflows when the Document Understanding package is installed:
UiPath.DocumentUnderstanding.Activities.ApiUiPath.Platform.ResourceHandlingUiPath.DocumentProcessing.Contracts.ActionsUiPath.IntelligentOCR.StudioWeb.Activities.DataExtractionUiPath.IntelligentOCR.StudioWeb.Activities.DocumentClassification
服务概述
The du service exposes each Document Understanding operation as a direct method call. There is no connection or scope to open. Call methods on the service accessor directly:
var extracted = du.ExtractDocumentData(@"C:\invoices\invoice.pdf", "Invoices", "Production", "invoice");
var extracted = du.ExtractDocumentData(@"C:\invoices\invoice.pdf", "Invoices", "Production", "invoice");
The service mirrors the Studio Web Classify Document, Extract Document Data, Create Document Validation Artifacts, and Retrieve Document Validation Artifacts activities.
Project version or tag
The projectVersionOrTag parameter maps to Studio's single Version dropdown. Pass either a version name (for example, v3) or a tag (for example, Production, Staging, live). The runtime resolves whichever kind matches the project. For the Predefined project, use Production.
Common parameters
timeoutMs(Int) - Timeout in milliseconds for classification and extraction. Defaults to3600000(1 hour).docType(String) - The document type id. Pass the document type name for projects with multiple document types, or an empty string for IXP-style projects that have a single extractor per version.
分类
DocumentData ClassifyDocument(string documentPath, string projectName, string projectVersionOrTag, int timeoutMs = 3600000)
Classifies a document from a local file path against a Document Understanding project. Returns a DocumentData object, including the predicted document type.
DocumentData ClassifyDocument(IResource file, string projectName, string projectVersionOrTag, int timeoutMs = 3600000)
Classifies the supplied document resource. Accepts any IResource, such as the output of the Path Exists or Get Local File or Folder activity.
数据提取
IDocumentData<DictionaryData> ExtractDocumentData(string documentPath, string projectName, string projectVersionOrTag, string docType, int timeoutMs = 3600000)
Extracts structured data from a document at a local file path. Returns the extracted fields as IDocumentData<DictionaryData>.
IDocumentData<DictionaryData> ExtractDocumentData(IResource file, string projectName, string projectVersionOrTag, string docType, int timeoutMs = 3600000)
Extracts structured data from the supplied document resource.
IDocumentData<DictionaryData> ExtractDocumentData(DocumentData classifiedDocument, string projectName, string projectVersionOrTag, string docType = null, int timeoutMs = 3600000)
Extracts structured data from a document already classified with ClassifyDocument, which avoids re-digitizing the file. When docType is null, it is derived from the classified document's document type.
Validation artifacts
ContentValidationData CreateDocumentValidationArtifacts(IDocumentData<DictionaryData> automaticExtractionResults, string orchestratorFolderName, string orchestratorBucketName = null)
Uploads extraction results to Orchestrator storage and returns a ContentValidationData handle. Use the handle to create a validation action, or to retrieve the results later with RetrieveDocumentValidationArtifacts. When orchestratorBucketName is null, the default bucket is used.
IDocumentData<DictionaryData> RetrieveDocumentValidationArtifacts(ContentValidationData contentValidationData, object completedAppAction = null, bool removeDataFromStorage = false, bool returnAutomaticExtractionResults = false)
Retrieves validated extraction results from storage. When removeDataFromStorage is true, the storage artifacts are deleted after retrieval. When returnAutomaticExtractionResults is true, the original automatic extraction results are returned instead of the validated ones.
与活动的关系
The coded API and the Document Understanding XAML activities run on the same runtime, so a coded workflow reaches the same classification, extraction, and validation-artifact behavior as the Extract Document Data and Classify Document activities. The difference is the call shape: the service takes plain file paths or IResource inputs and returns Document Data objects directly, and you use ordinary try/catch instead of the activity Continue On Error option.
常见模式
Classify, then extract
This pattern classifies a document and then reuses the classified result to extract data, which avoids digitizing the file a second time.
[Workflow]
public void Execute()
{
var classified = du.ClassifyDocument(@"C:\docs\file.pdf", "MyProject", "Production");
Log($"Document type: {classified.DocumentType.DisplayName}");
// Reuses the classified document, so the file is not digitized again.
var extracted = du.ExtractDocumentData(classified, "MyProject", "Production");
}
[Workflow]
public void Execute()
{
var classified = du.ClassifyDocument(@"C:\docs\file.pdf", "MyProject", "Production");
Log($"Document type: {classified.DocumentType.DisplayName}");
// Reuses the classified document, so the file is not digitized again.
var extracted = du.ExtractDocumentData(classified, "MyProject", "Production");
}
Extract and prepare data for app tasks containing the validation control
This pattern extracts data, uploads it to storage as validation artifacts for review in an app task, and retrieves the validated results after the action completes.
[Workflow]
public void Execute()
{
var extracted = du.ExtractDocumentData(@"C:\docs\invoice.pdf", "Invoices", "Production", "invoice");
// Upload the results so they can be reviewed in Action Center.
var artifacts = du.CreateDocumentValidationArtifacts(extracted, "Shared");
// After the Action Center validation action completes, retrieve the validated results.
var validated = du.RetrieveDocumentValidationArtifacts(artifacts, removeDataFromStorage: true);
}
[Workflow]
public void Execute()
{
var extracted = du.ExtractDocumentData(@"C:\docs\invoice.pdf", "Invoices", "Production", "invoice");
// Upload the results so they can be reviewed in Action Center.
var artifacts = du.CreateDocumentValidationArtifacts(extracted, "Shared");
// After the Action Center validation action completes, retrieve the validated results.
var validated = du.RetrieveDocumentValidationArtifacts(artifacts, removeDataFromStorage: true);
}
- 自动导入的命名空间
- 服务概述
- Project version or tag
- Common parameters
- 分类
DocumentData ClassifyDocument(string documentPath, string projectName, string projectVersionOrTag, int timeoutMs = 3600000)DocumentData ClassifyDocument(IResource file, string projectName, string projectVersionOrTag, int timeoutMs = 3600000)- 数据提取
IDocumentData<DictionaryData> ExtractDocumentData(string documentPath, string projectName, string projectVersionOrTag, string docType, int timeoutMs = 3600000)IDocumentData<DictionaryData> ExtractDocumentData(IResource file, string projectName, string projectVersionOrTag, string docType, int timeoutMs = 3600000)IDocumentData<DictionaryData> ExtractDocumentData(DocumentData classifiedDocument, string projectName, string projectVersionOrTag, string docType = null, int timeoutMs = 3600000)- Validation artifacts
ContentValidationData CreateDocumentValidationArtifacts(IDocumentData<DictionaryData> automaticExtractionResults, string orchestratorFolderName, string orchestratorBucketName = null)IDocumentData<DictionaryData> RetrieveDocumentValidationArtifacts(ContentValidationData contentValidationData, object completedAppAction = null, bool removeDataFromStorage = false, bool returnAutomaticExtractionResults = false)- 与活动的关系
- 常见模式
- Classify, then extract
- Extract and prepare data for app tasks containing the validation control