Skip to content

Enumerated list not recognised by textract

0

Issue: textract identifies enumerated paragraph number as a different layout box, and misses the enumeration Example: phone contract example - layout text 2 should be part of layout text Code:

extractor = Textractor()

document = extractor.analyze_document(
    file_source=image,
    features=[TextractFeatures.LAYOUT],
    save_image=True
)
document.pages[0].layouts.visualize().convert("RGB")

Is there a fix to this?

AWS

asked 2 years ago172 views

1 Answer
1
Accepted Answer

The issue you're experiencing with Amazon Textract not recognizing enumerated lists correctly is a known limitation of the service's layout detection capabilities. Currently, there isn't a direct fix or configuration option within Textract to address this specific problem.

However, there are a few approaches you can consider to mitigate this issue:

  1. Post-processing: You can implement custom post-processing logic to merge adjacent layout elements that appear to be part of the same enumerated list. This would involve analyzing the geometric relationships between text blocks and their content to identify and combine list items.

  2. Custom queries: If your documents follow a consistent format, you might be able to use Textract's custom queries feature to more accurately extract the enumerated list structure. This approach requires defining specific queries tailored to your document layout.

  3. Alternative layout analysis: Consider using the raw text extraction (DetectDocumentText) instead of the Layout feature, and then implement your own layout analysis logic. This gives you more control over how text blocks are grouped and classified.

  4. Feedback to AWS: It's valuable to provide feedback to Amazon about this limitation. While it won't provide an immediate solution, it can help prioritize improvements to the service in future updates.

  5. Third-party libraries: You might find third-party libraries or tools that can help with post-processing Textract output to better handle enumerated lists.

Remember that machine learning-based services like Textract are continually improving, so future updates may address this limitation. In the meantime, a combination of the above approaches may help you achieve more accurate results for your specific use case.
Sources
Amazon Textract Features | AWS
Amazon Textract’s new Layout feature introduces efficiencies in general purpose and generative AI document processing tasks | AWS Machine Learning Blog
AWS Textract - Training | AWS re:Post

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.