aws-samples / aws-samples/amazon-textract-textractor

`get_text_from_layout_json` throws `'NoneType' object is not subscriptable` for a specific PDF

Open
#411 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
493
Forks
163
PR merge metrics
No merged PRs in 30d

Description

`get_text_from_layout_json` throws `'NoneType' object is not subscriptable` for a specific PDF.

Unfortunately, I can't share the specific PDF for privacy reasons — but this line seems to be the cause: https://github.com/aws-samples/amazon-textract-textractor/blob/9fb7d2286a12cadcaf43ae41ef7806591415b079/prettyprinter/textractprettyprinter/t_pretty_print_layout.py#L173
Might also be an issue with Textract's output itself, rather than this library's parsing. This issue seems isolated to a specific PDF, and other pdfs work fine. Notes: seems to be something related to the metadata / structure of the file itself, multiple runs + changing orientiation + deleting pages does not seem to fix the issue.

Is this an error than anyone else has encountered / figured out a resolution for?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.