1. Tasks
  2. Analyze Document

Tasks

Analyze Document

The Analyze Document task will allow you to OCR PDFs and Images & do some more advanced Analytics

Basic usage

loading...

Parameters

document_processor_type

required
string

The type of analysis that you would like to perform on the file.

Current Options are:

  • ocr
    Extract text from a document with optical character recognition. The document can be a pdf or an image.
  • entity_extraction
    Extract entities and form fields from a document. The document can be a pdf or an image.
  • id_proofing
    Id proof a document, getting verification signals on image manipulation, verification of an id document and checking for suspicious words. The document can be a pdf or an image.
  • classifier
    Classify a proof of payment document as belonging to a specific bank in South Africa. The document can be a pdf or an image.

ocr

required
json object

This object key must correspond with the document_processor_type. This object will contain all the options and params for the selected document_processor_type


files

required
json array

This array containers objects. Each object contains file meta data. The most important key for these objects is the fileuuid


Result

loading...

Properties

payload

object

The returned payload


total_pages

integer

Number of pages analyzed


ocr

json object

Contains all the analysis data for the ocr document_processor_type. This object with change to correspond to the document_processor type.


ocr.full_text

string

Contains all the text the analysis could get from the file


ocr.detected_languages

json array

An array of objects. Each object in the array is a page of the file and indicates which languages were detected on that page of the document.


ocr.all_languages

json array

An array containing language codes for all languages detected in the document.


OCR

Shown in the Basic Usage

Entity Extraction

This document_processor_type processor type is used to extract entity and form fields from a document.

Example would be a document that has an organization and fields that have information in them like a receipt, invoice, application form, etc.

It will attempt to identify the field name and the value of that field and create a key value pair. It will do this for each form field that it detects.

Here is an example of a form. Its a Fax Cover Sheet with a form with fields and entries for each field. Form Extraction Example

On the left is what it has extracted from the image displayed on the right.

loading...

You will notice the document_processor_type is now entity_extraction and so there should be the corresponding object with the same name referring to the file it should analyze.

Result

The result returned would look something like this. The returned data is quite large so only showing a sample of the important data that is returned.

loading...

The result payload is similar to the first example with a few additions:

entity_extraction

json object

Contains all the analysis data for the ocr document_processor_type. This object with change to correspond to the document_processor type.

Please see above OCR example for explanations for the detected_languages and full_text objects & key values.


entity_extraction.entities

array

Contains an object for each entity detected. eg. organization is: Staples


entity_extraction.form_fields.pages

array

Contains an object for each pages.

Each page is an object in the array and each page object contains an object for each field detected. eg. Date: 04/12/2021 From: Jane Doe


ID Proofing

This is used to extract all the information from South African Identity documents, ie. Green bar code ID Book, Smart ID Card or Passports.

It doesn't only extract the information, it also does fraud checks to indicate if the document is valid or fraudulent.

loading...

You will notice the document_processor_type is now id_proofing and so there should be the corresponding object with the same name referring to the file it should analyze.

Result

The result returned would look something like this. The returned data is quite large so only showing a sample of the important data that is returned.

loading...

The result payload is similar to the first example with a few additions:

id_proofing

json object

Contains all the analysis data for the id_proofing document_processor_type. This object with change to correspond to the document_processor type.

Please see above OCR example for explanations for the detected_languages and full_text objects & key values.


id_proofing.id_proofing_signals

object

Contains an entry for each id proofing check performed and its result. eg. fraud_signals_suspicious_words: PASS

This indicates the the suspicious words check passed inspection. No suspicious words found.


id_proofing.all_signals_passed

boolean

Indicates if all the id proofing checks passed. If one check fails, this will be false.


Classifier