Drop rotated/vertical text runs from PDF extraction#55
Conversation
Drop rotated/vertical text runs from PDF extraction
Academic PDFs with a rotated left-margin stamp (arXiv:
"arXiv:1706.03762v7 [cs.CL] 2 Aug 2023") had that vertical text read in
reverse and it survived as junk headings/titles — the document title
became "3202 guA" (reversed "Aug 2023") and sections like "]LC.sc["
(reversed "[cs.CL]") and "7v26730.6071:viXra".
pdftable already classifies each word run: extractPDFRows now skips runs
that are not Upright or whose reading Direction is vertical ("ttb"/"btt")
via isRotatedRun. This removes margin stamps, page-edge watermarks, and
rotated figure labels — page furniture, never body prose — while keeping
upright LTR and RTL text untouched.
Verified on the arXiv "Attention Is All You Need" PDF: title now
"Attention Is All You Need", zero reversed-stamp sections, clean outline
(Abstract / 1 Introduction / 2 Background / 3 Model Architecture).
@
|
Warning Review limit reached
Next review available in: 53 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@
What
extractPDFRowsnow skips word runs that pdftable classifies as rotated/vertical (notUpright, orDirectionttb/btt) via a newisRotatedRunhelper. Upright LTR and RTL prose is untouched.Why
Academic PDFs with a rotated left-margin stamp — arXiv
arXiv:1706.03762v7 [cs.CL] 2 Aug 2023— had that vertical text read in reverse, surviving as junk headings/titles:3202 guA(reversed “Aug 2023”)]LC.sc[(“[cs.CL]”),7v26730.6071:viXraThese are page furniture (margin stamps, watermarks, rotated labels), never body prose. This is the root-cause fix for the weakness the ingest
titleoverride (PR #54) only masked.Verified
Parsing the real arXiv Attention Is All You Need PDF after the fix:
3202 guA)Tests
TestIsRotatedRuncovers upright LTR/RTL kept, non-upright + vertical dropped (case-insensitive).go build ./...+go test ./...green.@