- Visão geral
- Contratos de Processamento de Documentos
- Notas de versão
- Sobre os Contratos de Processamento de Documentos
- Classe Box
- Interface IPersistedActivity
- Classe PrettyBoxConverter
- Interface IClassifierActivity
- Interface IClassifierCapabilitiesProvider
- Classe ClassifierDocumentType
- Classe ClassifierResult
- Classe ClassifierCodeActivity
- Classe ClassifierNativeActivity
- Classe ClassifierAsyncCodeActivity
- Classe ClassifierDocumentTypeCapability
- ContentValidationData Class
- EvaluatedBusinessRulesForFieldValue Class
- EvaluatedBusinessRuleDetails Class
- Classe ExtractorAsyncCodeActivity
- Classe ExtractorCodeActivity
- Classe ExtractorDocumentType
- Classe ExtractorDocumentTypeCapabilities
- Classe ExtractorFieldCapability
- Classe ExtractorNativeActivity
- Classe ExtractorResult
- FieldValue Class
- FieldValueResult Class
- Interface ICapabilitiesProvider
- Interface IExtractorActivity
- Classe ExtractorPayload
- Enumeração DocumentActionPriority
- Classe DocumentActionData
- Enumeração DocumentActionStatus
- Enumeração DocumentActionType
- Classe DocumentClassificationActionData
- Classe DocumentValidationActionData
- Classe UserData
- Classe Document
- Classe DocumentSplittingResult
- Classe DomExtensions
- Classe Page
- Classe PageSection
- Classe Polígono
- Classe PolygonConverter
- Classe de metadados
- Classe WordGroup
- Classe Word
- Enumeração ProcessingSource
- Classe ResultsTableCell
- Classe ResultsTableValue
- Classe ResultsTableColumnInfo
- Classe ResultsTable
- Enumeração Rotation
- Rule Class
- RuleResult Class
- RuleSet Class
- RuleSetResult Class
- Enumeração SectionType
- Enumeração WordGroupType
- Interface IDocumentTextProjection
- Classe ClassificationResult
- Classe ExtractionResult
- Classe ResultsDocument
- Classe ResultsDocumentBounds
- Classe ResultsDataPoint
- Classe ResultsValue
- Classe ResultsContentReference
- Classe ResultsValueTokens
- Classe ResultsDerivedField
- Enumeração ResultsDataSource
- Classe ResultConstants
- Classe SimpleFieldValue
- Classe TableFieldValue
- Classe DocumentGroup
- Classe DocumentTaxonomy
- Classe DocumentType
- Classe Field
- Enumeração FieldType
- FieldValueDetails Class
- Classe LanguageInfo
- Classe MetadataEntry
- Enumeração de tipo de texto
- Classe TypeField
- Interface ITrackingActivity
- Interface ITrainableActivity
- Interface ITrainableClassifierActivity
- Interface ITrainableExtractorActivity
- Classe TrainableClassifierAsyncCodeActivity
- Classe TrainableClassifierCodeActivity
- Classe TrainableClassifierNativeActivity
- Classe TrainableExtractorAsyncCodeActivity
- Classe TrainableExtractorCodeActivity
- Classe TrainableExtractorNativeActivity
- Classe BasicDataPoint - visualização
- Classe ExtractionResultHandler — visualização
- Document Understanding ML
- Document Understanding OCR Local Server
- Document Understanding
- Notas de versão
- Sobre o pacote de atividades Document Understanding
- Compatibilidade do projeto
- Configuração da conexão externa
- Definir Senha do PDF
- Merge PDFs
- Get PDF Page Count
- Extract PDF Text
- Extract PDF Images
- Extract PDF Page Range
- Extract Document Data
- Criar tarefa de validação e aguardar
- Aguarde a tarefa de validação e retome
- Create Validation Task
- Classificar Documento
- Create Classification Validation Task
- Create Classification Validation Task and Wait
- Aguardar a tarefa de Validação de Classificação e retomar
- IntelligentOCR
- Notas de versão
- Sobre o pacote de atividades IntelligentOCR
- Compatibilidade do projeto
- Carregar Taxonomia
- Digitize Document
- Classificar Escopo do Documento
- Classificador baseado em palavra-chave
- Document Understanding Project Classifier
- Intelligent Keyword Classifier
- Create Document Classification Action
- Create Document Validation Artifacts
- Recuperar artefatos de validação de documento
- Aguardar ação de classificação do documento e retomar
- Train Classifiers Scope
- Instrutor de Classificador Baseado em Palavra-chave
- Intelligent Keyword Classifier Trainer
- Escopo da Extração de Dados
- Document Understanding Project Extractor
- Document Understanding Project Extractor Trainer
- Regex Based Extractor
- Form Extractor
- Intelligent Form Extractor
- Rasurar documento
- Create Document Validation Action
- Wait For Document Validation Action And Resume
- Escopo de Extratores de Treinamento
- Exportar Resultados da Extração
- Machine Learning Extractor
- Machine Learning Extractor Trainer
- Machine Learning Classifier
- Machine Learning Classifier Trainer
- Classificador Generativo
- Extrator Generativo
- Configuração da autenticação
- Validação de documentos com ações de aplicativos
- Validação manual para digitalizar documentos
- Extração de dados baseada em âncora usando a atividade Intelligent Form Extractor
- Validation Station
- Atividades generativas — Boas práticas
- Extrator generativo — boas práticas
- Classificador generativo — Boas práticas
- Serviços de ML
- OCR
- Contratos de OCR
- Notas de versão
- Sobre os Contratos OCR
- Compatibilidade do projeto
- Interface IOCRActivity
- Classe OCRAsyncCodeActivity
- Classe OCRCodeActivity
- Classe OCRNativeActivity
- Character Class
- Classe OCRResult
- Classe Word
- Enumeração FontStyles
- Enumeração OCRRotation
- Classe OCRCapabilities
- Classe OCRScrapeBase
- Classe OCRScrapeFactory
- Classe ScrapeControlBase
- Enumeração ScrapeEngineUsages
- ScrapeEngineBase
- Classe ScrapeEngineFactory
- Classe ScrapeEngineProvider
- OmniPage
- PDF
- [Não listado] Abbyy
- [Não listado] Abbyy Embedded

Atividades do Document Understanding
Extração de dados baseada em âncora usando a atividade Intelligent Form Extractor
O exemplo abaixo explica como extrair dados de um formulário que também pode incluir texto manuscrito. O seguinte cenário de caso de uso explica como extrair dados de uma ordem de compra.
It presents activities such as Digitize Document, Data Extraction Scope, or Intelligent Form Extractor. You can find these activities in the UiPath.IntelligentOCR.Activities package.
Como criar o fluxo de trabalho
Os seguintes pacotes precisam ser instalados antes de criar o fluxo de trabalho abaixo:
- UiPath.DocumentProcessing.Contracts.Activities
- UiPath.IntelligentOCR.Activities
- UiPath.OCR.Activities
- UiPath.OCR.Contracts
- UiPath.WebApi.Activities
Steps:
-
Abra o Studio e crie um Processo.
-
Add a Sequence container in the Workflow Designer, name it Sequence1, and create the variables shown in the following table:
Table 1. Variables to be created
Tipo de Variável Valor padrão itemString N/A classificationResultClassificationResult[] N/A outputFileNameGenericValue N/A -
Add another Sequence container in the Workflow Designer, after the first one, name it Sequence2, and create the variables shown in the following table:
Table 2. Variables to be created
Tipo de Variável Valor padrão textString N/A taxonomyDocumentTaxonomy N/A domDocumento N/A documentPathString N/A classificationResult2ClassificationResult[] N/A outputFileName2GenericValue N/A -
Add a Message Box activity inside the sequence.
- In the Properties panel, select the Ok option from the Buttons dropdown. Add the following message in the Text field: "Select a PDF file".
-
Marque a caixa de seleção para a opção Superior. Isso traz a caixa de mensagens para o primeiro plano.
-
Add a Select File activity after the Message Box activity.
- In the Properties panel, add the following text in the Filter field:
Pdf files (*.pdf)|*.pdf - Add the
documentPathvariable in the SelectedFile field.
- In the Properties panel, add the following text in the Filter field:
-
Add an Assign activity after the Select File activity.
- Add the
outputFileName2variable in the To field. - Adicione a expressão
".temp/" + Path.GetFileName(documentPath)no campo Valor.
- Add the
-
Add a Deserialize JSON activity after the Assign activity.
- Add the expression
File.ReadAllText("DocumentProcessing axonomy.json")in the JSON String field. - In the Properties panel, select the UiPath.DocumentProcessing.Contracts.Taxonomy.DocumentTaxonomy option from the TypeArgument dropdown list.
- Add the
taxonomyvariable in the JsonObject field.
- Add the expression
-
Add a Digitize Document activity after the Deserialize JSON activity.
- In the Properties panel, add the value
1in the DegreeOfParallelism field. - Add the
documentPathvariable in the DocumentPath field. - Add the
domvariable in the DocumentObjectModel field. - Add the
textvariable in the DocumentText field. - Add the UiPath® Document OCR engine inside the activity.
- Add your API Key inside the ApiKey field.
- Add the
"https://du.uipath.com/ocr"expression in the Endpoint field.
- In the Properties panel, add the value
-
Add a Write Text File activity after the Digitize Document activity.
- Add the
JsonConvert.SerializeObject(dom)expression in the Text field. - Add the
outputFileName2 + ".dom.json"expression in the FileName field.
- Add the
-
Add another Write Text File activity after the Write Text File activity.
- Add the
textvariable in the Text field. - Add the
outputFileName2 + ".text.txt"expression in the FileName field.
- Add the
-
Drag another Sequence container in the Workflow Designer, name it Sequence3, and create the variables shown in the following table:
Table 3. Variables to be created
Tipo de Variável Valor Padrão extractionResultExtractionResult N/A validatedResultsExtractionResult N/A doubleValidatedResultsExtractionResult N/A datasetConjuntoDeDados N/A iInt32 N/A -
Add a Data Extraction Scope activity inside the Sequence3.
- In the Properties panel, add the
domvariable in the DocumentObjectModel field. - Add the
documentPathvariable in the DocumentPath field. - Add the
textvariable in the DocumentText field. - Add the
"All.Benchmarks.Invoice"expression in the DocumentTypeId field. - Add the
taxonomyvariable in the Taxonomy field. - Add the
extractionResultvariable in the ExtractionResults field.
- In the Properties panel, add the
-
Add an Intelligent Form Extractor activity inside the Data Extraction Scope activity.
- Add your API Key in the ApiKey field.
-
Add a Write Text File activity after the Data Extraction Scope activity.
- Add the
JsonConvert.SerializeObject(extractionResult)expression in the Text field. - Add the
outputFileName2 + ".results.json"expression in the FileName field.
- Add the
-
Add a Present Validation Station activity after the Write Text File activity.
- Add the
extractionResultvariable in the AutomaticExtractionResults field. - Add the
domvariable in the DocumentObjectModel field. - Add the
documentPathvariable in the DocumentPath field. - Add the
textvariable in the DocumentText field. - Add the
taxonomyvariable in the Taxonomy field. - Add the
validatedResultsvariable in the ValidatedExtractionResults field.
- Add the
-
Add a Write Text File activity after the Present Validation Station activity.
- Add the
JsonConvert.SerializeObject(validatedResults)expression in the Text field. - Add the
outputFileName2 + ".savedinVS.results.json"expression in the FileName field.
- Add the
-
Add another Write Text File activity after the Write Text File activity.
- Add the
JsonConvert.SerializeObject(doubleValidatedResults)expression in the Text field. - Add the
outputFileName2 + ".doubleSavedinVS.results.json"expression in the FileName field.
- Add the
-
Execute o processo. O processo de automação deve abrir a Estação de Validação, extrair os dados, validá-los e armazená-los na pasta Saída.
Visit the following link to download the example in a ZIP format: Example.
Definindo sua taxonomia
You have created your workflow, defined all variables, and customized all activities. Now it's time to define your taxonomy. Visit Load Taxonomy to learn about defining your own taxonomy.
Create your taxonomy to be able to extract information from an invoice. You should be focused on creating an Invoice document type, with the fields shown in the following table:
Table 4. Invoice document type fields
| Tipo de Campo | |
|---|---|
| Nº da Fatura | Text |
| Subtotal | Number |
| Imposto sobre vendas | Number |
| Total | Number |
Figure 1. Overview of the finished taxonomy with the previously mentioned fields

Criar seu modelo
It is now time to create the template for the extraction process. Visit Load Taxonomy to learn how to create a template.
Para esse exemplo, configure o modelo usando os seguintes valores:
- Document Type: Invoice.
- Template Name: Invoice-example.
- Template Document: Select the target file.
- OCR Engine: Microsoft OCR.
- Languages: en.
- Profile: Scan.
- Scale: 1.
Figure 2. Animated image example showing the configuration of the template

Definir âncoras no modelo
As âncoras são um recurso muito especial e útil para usar quando você precisa extrair informações precisas de um documento. Ao definir uma área de extração com uma âncora, você pode esperar uma alta precisão na extração de dados.
Uma vez definida a taxonomia e criado o modelo, você pode começar a configurar o modelo usando âncoras, o que significa que a área de extração é definida em uma caixa e as âncoras são usadas para definir a posição da caixa.
Verifique a lista a seguir para alguns ponteiros antes de começar a adicionar âncoras ao seu modelo:
- A caixa âncora deve ser o maior possível (altura, largura) para cobrir qualquer tipo de número de fatura, fonte longa, curta, grande, etc.
- Uma área de extração pode ter quantas âncoras forem necessárias, mas apenas uma definida como principal (a primeira).
- Use âncoras formadas por várias palavras lado a lado.
- A âncora principal deve estar o mais próximo possível da área de extração.
- As posições da área de extração e da âncora principal são fixadas no template, mesmo quando aplicadas a documentos diferentes. A única coisa que pode variar é a distância entre a âncora principal e as secundárias.
Vamos continuar configurando o modelo e ver como você pode extrair dados usando uma âncora.
- Defina a área de extração:
-
In the right area of the Validation Station, select Selection modes.
-
Select Anchor.
-
Comece a selecionar a área desejada.
Observação:A âncora principal deve conter duas ou três palavras para maior precisão e melhores resultados no processo de extração.
Selecione várias palavras ao marcar uma âncora pressionando CTRL e selecionando as palavras desejadas.
-
- Defina a âncora principal:
- While still in the Anchor selection mode, select the desired area as your main anchor.
- Select Extract value for the desired field.
- Defina as âncoras secundárias:
- Ensure you're still in the Anchor selection mode, and with the main anchor selections activated.
- Selecione as novas áreas para as âncoras secundárias.
- Select Options for the desired field, and then select Change extracted value.
Repita o processo até terminar de definir todas as áreas de extração e adicionar todas as suas âncoras. Depois de concluído, salve o modelo.