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

linearize_table False doesn't exclude table

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

Description

When passing `TextLinearizationConfig(linearize_table=False` to into `document.get_text` with a document that includes a table, the linearized output still includes the table.

Ex code:
```
document = extractor.analyze_document(
file_source=image,
features=[
TextractFeatures.TABLES,
TextractFeatures.FORMS,
TextractFeatures.LAYOUT
],
save_image=True,
)
config = TextLinearizationConfig(
linearize_table=False,
)
print(document.get_text(config=config))
```

ex form:
[Fillable CMS-1500.pdf](https://github.com/aws-samples/amazon-textract-textractor/files/13824743/Fillable.CMS-1500.pdf)

Contributor guide

Open the contributing guide

Research direction

Start with TextLinearizationConfig and document.get_text, reproducing the issue using the shown analyze_document configuration and the linked Fillable CMS-1500.pdf example. Trace how linearize_table is applied when TABLES are present, then add coverage showing that the linearized output excludes the table when the option is false.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.