Connecting OCR with classification and distribution engine
Hi all!
We’re excited to share the latest enhancements in OCR Data Extraction in Alfresco AQuA, where we’ve linked OCR data extraction with our classification and distribution engine.
Integrating OCR Data Extraction in Alfresco AQuA greatly improves document processing efficiency. Moreover, it offers many benefits. Specifically, these include streamlined content processing and improved classification accuracy.
As you’re aware, we built AQuA, our AI-assisted ECM and BPM suite, on the Alfresco ADF framework. An alternative to Alfresco Digital Workspace (Enterprise edition).
In this post, I’ll discuss one of the most exciting features: OCR extraction integrated with a rules engine for content classification and distribution.
How OCR Data Extraction in Alfresco AQuA Works
Step 1. Trigger action
- Alfresco Content Services trigger the Text Extraction action based on behaviours or rules.
- As a result, this action prepares the image/document base64 encoding content and sends it to Google Vision API.
Step 2. OCR Data Extraction in Alfresco AQuA and NLP Content Processing
Cloud-Based Tagged Document Processing Workflow
A workflow for processing tagged documents using a cloud-based AI solution:
- Tagged Document: Initially, the process starts with a document that we have tagged and stored in the cloud.
- OCR (Optical Character Recognition): Next, in this step, the Cloud Vision API performs OCR on the document, converting text images into editable text.
- Vision API Object Detection: Then, the same Cloud Vision API detects objects within the image or document.
- Merge and Feature Processing: Subsequently, we combine and process the results from OCR and object detection to extract relevant features. For example, these entities may include names, places, dates, etc.
- NLP API Entity Recognition: In this step, natural language processing (NLP) techniques are used to identify entities within the extracted text. Entities may include names, places, dates, etc.
- Post Processing: Finally, we optimize or transform the processed data during post-processing before presenting it as the final output.
- Proposed Tags: Consequently, the system generates proposed tags based on all the previous processing, which are presented in JSON format for consumption by other applications.
Using the API for Object Detection in an Image
The use of the Vision API for object detection in images:
- Create JSON Request with the Image or Pointer to an Image: To begin with, the first step involves creating a JSON request that includes the image or a link/pointer to the image to be processed.
- Call the REST API: Following that, we make a call to the Vision REST API, sending the JSON request for processing.
- Process the JSON Response: Lastly, the API response, which is also in JSON format, is processed to extract information about the objects detected in the image.
Step 3. Perform classification and distributed action based on own definitions
We use the Alfresco AQuA rule engine for this task. Specifically, we define its options in an XML file as follows:
<classificator>
<typename="GasTicket">
<documental-type>veclassext:gasticket</documental-type>
<category>Ticket de Gasolina</category>
<rules>
<ruletype="keywords"percent="99">MURCIA PETROLEUM</rule>
<ruletype="keywords"percent="99">INTERCON SUPER</rule>
</rules>
<key-regexp>(MATRICULA|Matricula|Matrícula|MATRÍCULA):(\d{4})([A-Z]{3})%(MATRICULA|Matricula|Matrícula|MATRÍCULA):(\d{4})\s([A-Z]{3})</key-regexp>
<key-fullregexp>true</key-fullregexp>
<key-replaceToBlank>MATRICULA:|Matricula:|Matrícula:|MATRÍCULA:</key-replaceToBlank>
<destination-root-folder>Tickets Gasolina</destination-root-folder>
<rename-regexp></rename-regexp>
<automatic-distribution>true</automatic-distribution>
<date-classification>true</date-classification>
<date-classification-property>veclassext:fecha</date-classification-property>
<id-classification>true</id-classification>
<extractions>
<extractionproperty="veclassext:total"type="float"replaceToBlank="*** |** |TOTAL ">(\*\*\*|\*\*|TOTAL)\s[0-9,]+(.[0-9]{2})</extraction>
<extractionproperty="veclassext:fecha"type="date"conversionFormat="dd/MM/yyyy">[0-3][0-9]/[0-1][0-9]/[1-2][0-9][0-9][0-9]</extraction>
<extractionproperty="veclassext:fecha"type="date"conversionFormat="dd.MM.yy">[0-3][0-9].[0-1][0-9].[0-9][0-9]</extraction>
</extractions>
</type>
….
So its applies classification and distribution actions based on customer defined “patterns” in a very powerful way (fully extendible and self-mantained by final user).
Watch the video to see in action! (Don’t forget to enable the translation to English subtitles 😉 ).
Looking ahead, in upcoming articles, we’ll dive deep into each action to share the technical details.