Skip to content

Add scanned math pages exercising formula extraction - #8

Merged
Goldziher merged 1 commit into
xberg-io:mainfrom
tobocop2:feat/scanned-formula-corpus
Aug 14, 2026
Merged

Add scanned math pages exercising formula extraction#8
Goldziher merged 1 commit into
xberg-io:mainfrom
tobocop2:feat/scanned-formula-corpus

Conversation

@tobocop2

@tobocop2 tobocop2 commented Aug 14, 2026

Copy link
Copy Markdown
Member

Adds scanned pages that exercise formula extraction from rasterized PDFs, the input shape reported in xberg-io/xberg#1385.

What is added

Five entries under pdf_scanned/, pinned in corpus.lock.json:

  • synthetic_math_interpolation_scanned.pdf, synthetic_math_matrix_scanned.pdf, synthetic_math_series_scanned.pdf — pages that carry display equations only as pixels: 300 DPI, bilevel, CCITT G4, no text layer.
  • synthetic_math_interpolation_skew_scanned.pdf — the interpolation page with a 1.2 degree skew before binarization.
  • memo_prose_scanned.pdf — the negative case: a scanned page with no mathematics, rasterized from the xberg benchmark-harness memo fixture.

All four math pages are generated with matplotlib mathtext for this corpus, so there is no third-party licence to carry. Provenance rows are in MATH_PROVENANCE.md and ATTRIBUTIONS.md.

Validation

Each math page yields structured LaTeX through xberg extract --layout --layout-formula-model latex_ocr on the branch behind xberg-io/xberg#1414 (for example \Delta n_{0}=-\frac{2y_{2}+n_{0}(a+b+cn_{0})}{a+b+2cn_{0}} from the interpolation page, skewed variant included). The memo page yields zero formulas.

Binaries

The objects are published to the bucket via scripts/publish_corpus.py; the lock entries in this PR match their content hashes, and each resolves from the public URL. The files are also staged at assets/scanned-formula-corpus for reference.

@tobocop2
tobocop2 requested a review from Goldziher as a code owner August 14, 2026 16:09
Four synthetic pages rendered with matplotlib mathtext, rasterized at
300 DPI, binarized, and packed as CCITT G4 PDFs with no text layer,
mirroring the shape of a scanned textbook page. One carries a 1.2 degree
skew. A rasterized memo page joins them as the negative case: a scanned
page with no mathematics must yield no formulas.

The binaries follow the storage split: corpus.lock.json pins them, and
the objects need a publish_corpus.py run to reach the bucket.
@tobocop2
tobocop2 force-pushed the feat/scanned-formula-corpus branch from 023b9c2 to 8433394 Compare August 14, 2026 16:51
@Goldziher
Goldziher merged commit 8cdebc6 into xberg-io:main Aug 14, 2026
1 of 2 checks passed
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.

2 participants