Skip to content

Preserve empty and literal text fields in Tesseract TSV - #232

Open
yushuosun wants to merge 1 commit into
Layout-Parser:mainfrom
yushuosun:fix/preserve-tesseract-tsv-text-fields
Open

yushuosun wants to merge 1 commit into
Layout-Parser:mainfrom
yushuosun:fix/preserve-tesseract-tsv-text-fields

Conversation

@yushuosun

Copy link
Copy Markdown

Summary

Pandas 3.1 can convert empty OCR text fields and literal OCR output such as NA to missing values. Layout aggregation then drops the structural rows that contain paragraph bounds. Disable the default NA conversion when parsing Tesseract TSV so those rows and literal words are preserved.

Fixes #231.

Verification

The regression test uses the OCR agent with a synthetic Tesseract TSV and checks that the empty paragraph row and both literal word fields survive parsing and that the result retains its full rectangle. The test failed on the original parser and passes on pandas 3.1.0 after the change.

Copilot AI balanced review requested due to automatic review settings November 28, 2026 11:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Declare a tested pandas range: pandas 3.1.0 shrinks Tesseract paragraph boxes

2 participants