Skip to main content
Version: 10.2.4

Configure OCR Bridge step and OCR providers

OCR Bridge is introduced to improve:

  • Performance. The new OCR Bridge step reduces throughput due to processing documents asynchronously without submitting redundant tasks to Control Tower workers and receiving responses instantly in Control Tower.
  • Usability. Only one step is needed to recognize a document whose output is compatible with the ToD Manual Task.

Architecture​

Control Tower handles the OCR Bridge steps in a particular way. It redirects input data to the OCR Bridge queue without involving the CT worker. After the document is processed, CT consumes the response from the result queue.

An OCR REST application can work with both REST and Bridge queue interfaces. It validates incoming tasks, checks and consumes licenses, stores tasks in DB with the correct status.

OCR REST configuration properties​

PropertyDefault valueDescription
execution.bridge.task.queueexec.<CT_HOST>.result.ocrName of the OCR Bridge queue
execution.bridge.prefetch.count100Prefetch count of the Bridge queue
execution.bridge.thread.count20Count of threads for consuming messages of the Bridge queue

OCR bridge step​

Input parameters​

ParameterCodeDefault valueDescription
Document URL column namedocument_url_column_name`original_document_url| Document URL column name for processing by OCR.
OCR Typeocr_typeenrichedOCR Type values: Standard and Enriched (prepare output for TOD Manual Task).
S3 bucket names3_bucket_namedoc-uploadAn S3 bucket to store results.
OCR Providerocr_providerAbbyyType of the OCR provider:
  • Abbyy
  • Google Vision
  • Azure Form Recognition
OCR parameters JSONocr_parametersSee laterSee parameters in the table below.

OCR JSON. Default values​

{
"exportFormat":"xmlForCorrectedImage,xmlWithoutRecognitionVariants",
"language": "English",
"correctSkew": true,
"correctOrientation": true,
"writeRecognitionVariants": true,
"invertImage": false,
"discardColorImage": false,
"skipPreprocessing": false,
"useOnlyCustomRegions": false,
"useDefaultPattern": false,
"profile": "documentConversion",
"removeGarbageSize": 0,
"lowResolutionMode": false,
"enhanceLocalContrast": false,
"allowedRegionTypes": null,
"changeDPI": 0,
"version": "V_2",
"storePreprocessedDoc": true,
"textTypes": ["normal"],
"timeout": 60
}

OCR parameters​

ParameterValuesDescription
exportFormat
  • txt
  • xml
  • xmlWithoutRecognitionVariants
  • xmlForCorrectedImage
  • pdfSearchable
  • html
Step's export format.
language
  • English
  • German
  • , and so on
Predefined language. You can also define multiple languages using a comma as a separator: English,German,Polish
correctSkewbooleanThe page skew is detected and automatically corrected.
correctOrientationbooleanThe page orientation is detected and if differs from normal, it is rotated automatically.
writeRecognitionVariantsbooleanCauses the xml/xmlForCorrectedImage formats to include all variants of character or word, OCR considered as a possible recognition.
invertImagebooleanInverts image.
discardColorImagebooleanLeaves only black-and-white plane in the prepared image.
skipPreprocessingbooleanSkips preprocessing stage. It increases performance up to 30%.
useOnlyCustomRegionsbooleanSkips original analyzing stage and extracts information from custom regions only.
useDefaultPatternbooleanIf true, it requires to apply the default pattern from the OCR application bundle.
profiledocumentConversionConverts documents into editable formats.
textExtractionExtracts text from documents.
barcodeRecognitionExtracts barcodes.
removeGarbageSizeintegerRemoves garbage: excess dots that are smaller than a certain size from the image. Optinal, valid value > 0 and -1 for automatically detect garbage size.
lowResolutionModebooleanImproves recognition of images with low resolution.
enhanceLocalContrastbooleanSpecifies whether the local contrast of the image should be increased.
allowedRegionTypes
  • BT_Table
  • BT_Text
  • BT_Barcode
  • BT_VectorPicture
  • BT_Separator
  • BT_SeparatorGroup
  • BT_Checkmark
  • BT_CheckmarkGroup
Deprecated.

Specifies allowed region types for identified blocks classification.

NOTE: narrowing down type of regions can break page layout. Do not use it if you’re not sure you need it.

changeDPIinteger

[50 : 3200] valid range

null or 0 for disable

Specifies the new value for the resolution.
versionV_2ABBYY FRE 12
V_1ABBYY FRE 11
storePreprocessedDocbooleanSpecifies whether preprocessed documents should be saved into data storage.
textTypes
  • normal
  • typewriter
  • matrix
  • ocrA
  • ocrB
  • e13b
Specifies the type of the text in the document. This parameter can also contain several text types separated with commas, for example normal,matrix.
timeoutintegerSets a timeout in seconds for task execution.

Output parameters​

  • OCR Result. Document processing result in the JSON format.

    • Code: ocr_result

    • Example:

      {
      "originalDocument": "https://minio-host/doc-upload/1.pdf",
      "documents": {
      "xmlForCorrectedImage": "https://minio-host/doc-upload/bp-id/task-id/1- xmlForCorrectedImage.xml",
      "xmlWithoutRecognitionVariants": "https://minio-host/doc-upload/bp-id/task-id/1-xmlWithoutRecognitionVariants.xml"
      },
      "pageDetails": "https://minio-host/doc-upload/bp-id/task-id/preprocessed/links.json"
      }
  • Task id. The ID of an OCR task.

    • Code: task_id
    • Example: 066416ed-20e8-4e96-9df1-7f7e133f1211
  • Meta Info JSON: extended info for the ToD Manual Task.

    • Code: meta_info_json

    • Example:

      {
      "pages": "https://minio-host/doc-upload/bp-id/task-id/preprocessed/links.json",
      "ocrXmlUrl": "https://minio-host/doc-upload/bp-id/task-id/1-xmlWithoutRecognitionVariants.xml",
      "imageUrl": "https://minio-host/doc-upload/1.pdf"
      }
  • Process time: record's process time in milliseconds.

    • Code: _sys_ocr_process_time
    • Example: 24053

Page details json example https://minio-host/doc-upload/bp-id/task-id/preprocessed/links.json

[
{
"imgUrl": "https://minio-host/doc-upload/bp-id/task-id/preprocessed/1.png",
"charsUrl": "https://minio-host/doc-upload/bp-id/task-id/preprocessed/1.json",
"height": 3300,
"width": 2550,
"charsCount": 2216
}
]

Build BP with OCR and ToD Manual Task​

To build a Business Process with the OCR and ToD Manual Task, do the following:

  1. Create a Business Process.

  2. Create an OCR Bridge step.

  3. Configure OCR Bridge.

  4. Add IE Cognitive Bot Task, Start, End, and link all steps together

The Business Process is now ready to process incoming documents by OCR and Manual Task.

Performance​

Documents numberOCR Settings + BPOCR BridgeDiff
AVGBest TimeAVGBest TimeAVGBest Time
1002:00.801:37.300:51.100:46.058%53%
5004:34.002:56.602:03.301:53.155%36%
10006:52.306:01.905:05.204:51.926%19%
30013:07.711:35.910:10.210:01.623%14%

OCR Bridge demonstrates up to 23% performance boost compared to OCR Setting + OCR BP approach. See Bridge Perfomance.xlsx.