R.K
R.K

Reputation: 1839

Form Recognizer in deep Learning with Annotation

I have regular digital forms with blanks, boxes, checkboxes, tables, and signature fields. My aim is to extract the field name along with its fillable coordinates.

For e.g. if form has a field named "Name of benificiary" and has it's corresponding blank space at (x=500,y=750), I require the field Name and it blank space coordinates.

AWS and Azure, didn't provide blank space coordinates. Please let me know if there is any existing library or model to capture the names and their corresponding blank spaces.

If in case, I have to develop a custom model, kindly suggest a baseline model i can start with and how can i tell my model which field name to map with which blank space.

Thanks in advance.

Sample forms are: enter image description here

Upvotes: 0

Views: 130

Answers (1)

Thomas
Thomas

Reputation: 701

Amazon Textract allows you to do that, it can help you extract the Key fields and the area where the value would go, even if the value is not filled.

You can use the amazon-textract-textractor package to simplify calling and parsing the Amazon Textract API.

Using your provided sample:

from textractor import Textractor
from textractor.data.constants import TextractFeatures
extractor = Textractor(profile_name="default")
document = extractor.analyze_document(
    file_source="./az0HQ.png",
    features=[TextractFeatures.FORMS],
)
document.visualize()

enter image description here

You can access the bounding box of the value field that way:

document.key_values[1]
> Date of issue : 

This is a key value with "Date of issue:" as the key, you can access the fillable value bbox like this:

document.key_values[1].value.bbox
> x: 0.4474363923072815, y: 0.10488211363554001, width: 0.02369014546275139, height: 0.01737912744283676

Upvotes: 1

Related Questions