UiPath Documentation
document-understanding
2020.10
false
Document Understanding 用户指南
重要 :
新发布内容的本地化可能需要 1-2 周的时间才能完成。

OCR 服务

关于 OCR 服务

OCR 服务用于以下目的:

  • 在为数据加标签时,当将文档导入到 Data Manager 时。此步骤可用的服务包括 UiPath Document OCR(免费,云或内部部署)、Google Cloud OCR(仅云)、Microsoft Read OCR(云或内部部署)和 Omnipage(仅内部部署)。
  • 在运行时,从 RPA 工作流调用模型时。此步骤可用的服务是与 UiPath RPA 平台集成的所有 OCR 引擎,包括上述引擎,以及 Abbyy Finereader、Microsoft OCR(旧版)、Microsoft Project Oxford OCR 和 Tesseract。

In production, we recommend calling the OCR using the Digitize Document activity in your workflow and passing the Document Object Model as input to the activity calling the ML model. For this purpose, you need to use the Machine Learning Extractor activity (Official feed).

为便于测试,您也可以直接在 AI Center(“设置”窗口)中配置 OCR,但对于生产部署不建议这样做。

内部部署选项

UiPath Document OCR 有 3 个可用的部署选项:

  • On the robot using a LocalServer activity package and the UiPath.OCR.Activities package version 3.1.0-preview or later - requires no internet access and no additional hardware but the Robot machine needs a CPU with AVX2 support.
    • 这应该是您的默认选项。对于更大数量,您可以添加更多机器人。
  • 在 Linux GPU 计算机上运行的独立 Docker 容器(见下文 - 建议用于每年超过一百万页的数量)- 许可/计量需要互联网访问
    • 对于每年超过两百万到三百万页的大数量,这应该是您的默认选项。
  • 在 Linux CPU 计算机上运行的独立 Docker 容器(见下文)- 许可/计量需要互联网访问
    • 仅适用于机器人计算机在不支持 AVX2 的 CPU 上运行或无法获取 GPU 等极少数情况。
  • ML Skill in AI Center (see ML Packages section) (GPU strongly recommended) - Internet access not required on premises if AI Center installation is airgapped

要求

本节详细介绍了安装 OCR 引擎的硬件要求和软件要求。

硬件要求

  • 涉及的计算机:云虚拟机、内部部署计算机或笔记本电脑
  • 操作系统:Windows (Windows 10) 或 Linux (Ubuntu/CentOS/RedHat)
  • 计算引擎:CPU 或 GPU
  • OCR:UiPath 文档 OCR CPUUiPath 文档 OCR GPUOmniPage OCR CPU
CPU 核心RAM (GB)视频 RAM (GB)硬盘 (GB)
UiPath CPU8850
UiPath GPU14850
OmniPage CPU12Resolution settings

软件要求

The software requirements for OCR Engines are the same as for Data Manager.

网络配置

Data Manager 需要访问 OCR 引擎 <IP>:<port_number>。OCR 引擎可能是内部部署 UiPath Document OCR、内部部署 Omnipage OCR、Google Cloud Vision OCR、Microsoft Read Azure 或内部部署 Microsoft Read。

机器人需要访问 OCR <IP>:<port_number>。OCR 选项与上述相同,不同之处在于 Omnipage 可直接作为活动包在机器人中使用。

OCR 引擎需要通过端口 443 访问 Azure 中 UiPath 托管的许可服务器。

最低试用配置或概念验证配置

如果您只想提供开箱即用的预训练模型,则可以在 Windows 10 笔记本电脑上运行 OCR 引擎。请确保 Docker Desktop 具有 8G RAM 可用。

如果要尝试以少量数据(不足 100 个文档)将自定义模型作为演示进行训练,您可以在 RAM 限制为 4GB 的环境中运行 OCR 引擎。对于此类小型用例,可能不需要用于 OCR 引擎的 GPU。

先决条件

OCR 引擎是在 Docker 之上运行的容器化应用程序。不能在与内部部署 AI Center 相同的计算机上运行这些 OCR 引擎。为了在单独的计算机上运行它们,可以使用下面的先决条件安装程序命令来设置 Docker,并选择性地安装 NVidia 驱动程序。这些脚本不应在将安装 AI Center 的计算机上运行。

The prerequisites for OCR Engines are the same as for Data Manager.

(可选)GPU 计算机安装

Linux

运行以下命令:

curl -fsSL https://raw.githubusercontent.com/UiPath/Infrastructure/master/ML/du_prereq_installer.sh | sudo bash -s -- --env gpu
curl -fsSL https://raw.githubusercontent.com/UiPath/Infrastructure/master/ML/du_prereq_installer.sh | sudo bash -s -- --env gpu

在某些系统上必须运行此命令两次,否则可能需要重新启动系统以安装所要求的所有依赖项。

Azure Specific: In order to use the NV-series virtual machines you need to either install the NVIDIA driver before executing the above command, or you can use a Driver Extension from Azure to install the necessary NVIDIA driver according to that tier GPU model.

Azure 虚拟机

如果要在 Azure 虚拟机上安装,请改用此命令:

curl -fsSL https://raw.githubusercontent.com/UiPath/Infrastructure/master/ML/du_prereq_installer.sh | sudo bash -s -- --env gpu --cloud azure
curl -fsSL https://raw.githubusercontent.com/UiPath/Infrastructure/master/ML/du_prereq_installer.sh | sudo bash -s -- --env gpu --cloud azure

安装

UiPath Document OCR(预览版)

UiPath 文档 OCR 是 UiPath 的专有 OCR 技术,支持以下拉丁语脚本语言使用的字符:英语、法语、德语、意大利语、葡萄牙语、罗马尼亚语和西班牙语。该技术能够识别其他语言的文本,但不带重音符号,例如,波兰语中的“Ł”将被识别为“L”。使用 UiPath 文档 OCR 处理的页面不计入与 Document Understanding 企业版许可证一起购买的页面配额,因此 UiPath 文档 OCR 可免费使用。

UiPath Document OCR is available both on-premises as a docker container and in the cloud as a cloud service API with the URL: https://du.uipath.com/ocr. See the full description of the available URLs on the Public Endpoints page.

  1. 要安装 UiPath 文档 OCR,请运行以下命令:

    docker login aiflprodweacr.azurecr.io -u *** -p **docker pull aiflprodweacr.azurecr.io/uipath-ocr:latest
    docker login aiflprodweacr.azurecr.io -u *** -p **docker pull aiflprodweacr.azurecr.io/uipath-ocr:latest
    
  2. 使用 CPU 运行

    docker run -d -p 5000:80 aiflprodweacr.azurecr.io/uipath-ocr:latest LicenseAgreement=accept
    docker run -d -p 5000:80 aiflprodweacr.azurecr.io/uipath-ocr:latest LicenseAgreement=accept
    
  3. 使用 GPU 运行

    docker run -d -p 5000:80 --gpus all aiflprodweacr.azurecr.io/uipath-ocr:latest LicenseAgreement=accept
    docker run -d -p 5000:80 --gpus all aiflprodweacr.azurecr.io/uipath-ocr:latest LicenseAgreement=accept
    
  4. 在 AI Center 中,当创建新的 ML 包时,屏幕底部有 OCR 配置部分,您可以在其中定义 OCR 引擎类型、OCR URL 和 OCR 密钥。OCR 密钥是您从 Automation Cloud 帐户的“许可证”部分获取的 API 密钥。

    重要提示:

    UiPath 文档 OCR 容器和 Omnipage OCR 容器不能与内部部署 AI Center 在同一台计算机上运行。

OmniPage OCR

Omnipage Docker 容器仅适用于 Data Manager,用于以 UiPath Document OCR 尚不支持的语言导入文档。

运行以下命令:

docker login aiflprodweacr.azurecr.io -u *** -p ***docker pull aiflprodweacr.azurecr.io/omnipage-ocr:latestdocker run -d -p 5100:80 aiflprodweacr.azurecr.io/omnipage-ocr:latest LicenseAgreement=accept
docker login aiflprodweacr.azurecr.io -u *** -p ***docker pull aiflprodweacr.azurecr.io/omnipage-ocr:latestdocker run -d -p 5100:80 aiflprodweacr.azurecr.io/omnipage-ocr:latest LicenseAgreement=accept

Google Cloud OCR

The endpoint can be obtained from the Google Cloud Platform documentation. The ApiKey can be obtained from your Google Cloud Platform Console if you have a Google Cloud Vision service in your subscription.

Microsoft Read

重要提示:

适用于 Azure 和内部部署容器端点。

对于 Azure 服务,您需要同时提供端点和 API 密钥

对于内部部署容器端点,则不需要提供 API 密钥

在 Data Manager 和 AI Center Document Understanding ML 包中配置 OCR 服务

下表显示了如何在 Data Manager 和 AI Center 中配置 6 种受支持的 OCR 引擎类型。

重要提示:

ocr.method 参数对应于 AI Center 的“ML 包创建”视图中的“OCR 引擎”下拉列表。

OCR 引擎ocr.methodocr.keyocr.url
UiPathUiPathUiPath Automation Cloud

Document Understanding API 密钥

企业计划
http://<IP_addr>:<port_number>
OmniPageomnipageUiPath Automation Cloud

Document Understanding API 密钥

企业计划
http://<IP_addr>:<port_number>
GoogleGoogleGCP 控制台 API 密钥https://vision.googleapis.com/v1/images:annotate
Microsoft Read 2.0 内部部署Microsofthttp://<IP_addr>:<port_number>/vision/v2.0/read/core/Analyze
Microsoft Read 2.0 AzureMicrosoft来自 Azure 门户的资源的 API 密钥<Azure_resource_Endpoint>/vision/v2.0/read/core/asyncBatchAnalyze
Microsoft Read 3.1 内部部署Microsofthttp://<IP_addr>:<port_number>/vision/v3.1/read/analyze
Microsoft Read 3.1 AzureMicrosoft来自 Azure 门户的资源的 API 密钥<Azure_resource_Endpoint>/vision/v3.1/read/analyze

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新