UiPath Documentation
document-understanding
latest
false
Document Understanding API 指南
  • 入门指南
    • 概述
    • 限制和配额
    • 将自动化从 Document Understanding API v1 迁移到 v2
  • Document Understanding™ Cloud API v1 使用示例
  • 许可
  • 故障排除
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

对文档进行分类

API 示例,使用 Document Understanding 分类服务以及项目 ID 和 curl 请求对文档进行分类。

开始对文档进行分类​

提示:

项目 ID 从“获取项目信息”调用收到的响应中获取。

curl -X 'POST' \
  'https://{AutomationCloudURL}/<Organization_Name>/<Tenant_Name>/du_/api/framework/projects/<Project_ID>/classifiers/ml-classification/classification?api-version=1' \
  -H 'accept: text/plain' \
  -H 'Authorization: Bearer <your-access-token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "documentId": "25a03e48-cfe8-ed11-9f75-000d3a4964af"
}'
curl -X 'POST' \
  'https://{AutomationCloudURL}/<Organization_Name>/<Tenant_Name>/du_/api/framework/projects/<Project_ID>/classifiers/ml-classification/classification?api-version=1' \
  -H 'accept: text/plain' \
  -H 'Authorization: Bearer <your-access-token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "documentId": "25a03e48-cfe8-ed11-9f75-000d3a4964af"
}'

对文档进行分类的响应​

{
  "classificationResults": [
    {
      "documentTypeId": "invoices",
      "documentId": "25a03e48-cfe8-ed11-9f75-000d3a4964af",
      "confidence": 0.6170391,
      "ocrConfidence": -1,
      "reference": {
        "textStartIndex": 0,
        "textLength": 0,
        "tokens": []
      },
      "documentBounds": {
        "pageRange": "1",
        "pageCount": 1
      },
      "classifierName": "ML Classification (Preview)"
    }
  ]
}
{
  "classificationResults": [
    {
      "documentTypeId": "invoices",
      "documentId": "25a03e48-cfe8-ed11-9f75-000d3a4964af",
      "confidence": 0.6170391,
      "ocrConfidence": -1,
      "reference": {
        "textStartIndex": 0,
        "textLength": 0,
        "tokens": []
      },
      "documentBounds": {
        "pageRange": "1",
        "pageCount": 1
      },
      "classifierName": "ML Classification (Preview)"
    }
  ]
}
备注:

此示例显示了API v1响应,该响应使用驼峰式命名法属性名称。API v2 返回所有路由的帕斯卡拼写法属性名称。有关详细信息,请查看将自动化从 Document Understanding API v1 迁移到 v2 。

文档边界​

documentBounds对象可识别分类结果适用的输入文件页面。

属性类型描述
pageRange字符串结果涵盖的页面,编号从 1 开始。单页显示为"3" ,范围显示为"1-3" 。当分类器将一个文件拆分为多个文档时,每个结果都有自己的范围。
pageCount整数pageRange中的页数。
备注:

startPage 、 textStartIndex和textLength属性已弃用。出于向后兼容性,响应仍包含它们,但它们的值不会反映拆分文档的页面范围。并用pageRange和pageCount替换它们。

  • 开始对文档进行分类​
  • 对文档进行分类的响应​
  • 文档边界​

此页面有帮助吗?

连接

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

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

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

保持更新