aws-samples / aws-samples/amazon-textract-textractor
Mistake a text field above a table as table title
- Dominant language
- Jupyter Notebook
- Stars
- 493
- Forks
- 163
- PR merge metrics
- No merged PRs in 30d
Description
# Problem
Mistaking a text field as table title.
## Environment
```
import textractor
textractor.__version__
-----
'1.7.4'
from platform import python_version
print(python_version())
-----
3..10.10
```
## Reproduction
```
import os
import pathlib
from textractor import Textractor
from textractor.data.constants import TextractFeatures
import textractor
textractor.__version__
from platform import python_version
print(python_version())
DATA_DIR=pathlib.Path.home().joinpath("home/repository/data/ml/medical_report/pdf")
FILEPATH=DATA_DIR.joinpath("MedicalExaminerReportExample_13.pdf")
extractor = Textractor(profile_name="eml-ap-southeast-2")
document = extractor.analyze_document(
file_source=str(FILEPATH),
features=[
TextractFeatures.LAYOUT,
TextractFeatures.FORMS,
TextractFeatures.TABLES
],
save_image=True, # To use images property and visualize of the document instance.
)
table = document.tables[0]
table.visualize()
print(table.title.text)
-----
'Addendum: On 02/28/2012 at approximately 1230 hours, FI Malphurs received a fax from Sanford Police Department confirming positive identification as: Trayvon Martin, 17yoa B/M, DOB: 02/05/1995. The Identification was made by his father from a crime scene photograph. ECC and MEO staff were notified and an Identification sheet was completed. TSM'
```
* [MedicalExaminerReportExample_13.pdf](https://github.com/aws-samples/amazon-textract-textractor/files/14457466/MedicalExaminerReportExample_13.pdf)
Contributor guide
Research direction
Reproduce the behavior with MedicalExaminerReportExample_13.pdf using the shown Textractor.analyze_document call and the TABLES and LAYOUT features. Inspect document.tables[0].title and compare its text with the table visualization; done means the text field above the table is not reported as the table title while the actual table title remains available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100