Repository navigation
gotex-worddiff: which words moved, read through the extractor the score uses - #773
Merged
Merged
Conversation
…re uses gotex-refdiff says a paper fell 0.1 points of word recall. It does not say which words, so there is no way to tell a regression from an improvement the metric mis-counts — which is #716's subject, and which #772 ran into head-on. gotex-worddiff reports the multiset difference between two of OUR PDFs: the words one holds that the other lacks, and the reverse. No reference; measuring against the oracle is gotex-refdiff's job. Exit 0 same words, 1 different, 2 an error. ⛔⛔ AND ITS FIRST ACT WAS TO CATCH ITS OWN AUTHOR, WHICH IS WHY THE EXTRACTOR IS SHARED The scratch probe this replaces read the PDFs with `pdfops text` and reported that a revtex affiliation block had set as `CenterforTheoretical`, `QiluNormalUniversity` — words with no spaces between them — and that #772 had repaired it. That was published on #772 and on #716 before it was checked. Reading the same two files through poppler's pdftotext, which is what gotex-refdiff SCORES with, there is no such difference; and the engine's own line dump shows the spaces present in both files, at identical coordinates. The finding was two extractors disagreeing, dressed as an engine defect. Both comments are corrected. So the extraction itself — which binary, how it is found on PATH or through pkgx, the poppler project pin that stops `pkgx pdftotext` failing with MultipleProjects — moves into internal/pdftext, and gotex-refdiff is rewired onto it. What does NOT move is what refdiff makes of the text: word recall, and its genuine-empty versus tool-error distinction. Those are scoring semantics, not extraction. WHAT IS TESTED - the shapes a line-breaking change makes: a word split across a hyphen on one side and whole on the other, a fused token - a word both files hold is not a difference, and the same words in a different order exit 0 - it is a MULTISET: three occurrences against two IS a difference - ⛔ a failed extraction is an error, never an empty page — otherwise a missing poppler reports every word of the other file as a difference, a maximal and confident meaningless answer - an absent or zero-byte file, likewise - internal/pdftext: the poppler pin, a tool found on PATH, and a missing tool that must error rather than return no text The repository's own gate caught the missing .gitignore row (TestEveryCommandIsIgnoredAtTheRoot). Refs #716, #772. Co-Authored-By: Claude Opus 5 <[email protected]>
…egression #772 lost 0.1 and 0.2 points of word recall on two revtex papers and I could not say why. The new tool says why, and most of it is not the engine. ⛔ pdftotext WITHOUT -layout READS A TWO-COLUMN PAGE AS ONE STREAM and fuses the end of one column's line onto the start of another's. These are real tokens from 2607.14549: disFigure distribhe participaentire quaThe respecIn transforlution matTo quag quasiof reperiodic WHICH boundaries fuse depends on where the lines break, so a line-breaking change moves them. On that paper the plain extraction reports 36 and 37 words differing between the two builds; with -layout it reports 23 and 18, and every fused token above is gone. What is left is the change itself: char-/acterized → characterized, follow-/ing → following, in-/dicated, repre-/sent, respec-/tively, sys-/tems, transfor-/mations. ⭐ AND THE SCORE MOVES WITH IT. Re-scoring #772's two papers with -layout extraction (a throwaway build of gotex-refdiff, not this commit): 2607.14914 plain -0.2 -> -layout 1327 vs 1327 words, NO difference 2607.14549 plain -0.1 -> -layout 1020 vs 1019 words, ONE word So one of the two regressions was the extractor fusing columns, and the other is a single word. ⚠⚠ THIS IS NOT A PROPOSAL TO SWITCH THE SCORER. -layout moves the ABSOLUTE scores by nine points on BOTH sides (2607.14549: 96.5% -> 87.6%), because the padding it inserts changes tokenisation everywhere, including the reference's. Every historical number would move. It is a diagnostic for reading a delta, and gotex-refdiff is untouched here. The flag is on gotex-worddiff; internal/pdftext.CaptureRunner takes opts and places them BEFORE the file, where pdftotext takes its options. The mutation was run: with the opts appended after the path instead, the test goes red (`cat -u` becomes `cat f - -u`, which reads a file that is not there). Refs #716, #772. Co-Authored-By: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gotex-worddiff: which words moved, read through the extractor the score uses
gotex-refdiffsays a paper fell 0.1 points of word recall. It does not sayWHICH words, so there is no way to tell a regression from an improvement the
metric mis-counts — #716's subject, and what #772 ran into head-on.
gotex-worddiffreports the multiset difference between two of OUR PDFs: thewords one holds that the other lacks, and the reverse. No reference — measuring
against the oracle is
gotex-refdiff's job and this does not duplicate it.Exit 0 same words, 1 different, 2 an error.
⛔⛔ Its first act was to catch its own author, and that is why the extractor is shared
The scratch probe this replaces read the PDFs with
pdfops text. It reportedthat a revtex affiliation block had set as
CenterforTheoretical,QiluNormalUniversity— words with no spaces between them — and that #772 hadrepaired them. I published that on #772 and on #716 before checking it.
Reading the same two files through poppler's
pdftotext, which is whatgotex-refdiffSCORES with, there is no such difference. The engine's own linedump shows the spaces present in both files at identical coordinates:
The finding was two extractors disagreeing, dressed as an engine defect. Both
comments are corrected.
So the extraction itself — which binary, how it is found on PATH or through
pkgx, and the poppler project pin that stops
pkgx pdftotextfailing withMultipleProjects— moves intointernal/pdftext, andgotex-refdiffisrewired onto it. One extractor, so the diff and the score cannot disagree about
what a word is.
⚠ WHAT DOES NOT MOVE:
extraction,extractTextand the genuine-empty versustool-error distinction stay in
gotex-refdiff. Those are its scoringsemantics, not extraction, and dragging them into a shared package would make
the next tool inherit decisions it has no use for.
Tested
internal/pdftextThe repository's own gate caught the missing
.gitignorerow(
TestEveryCommandIsIgnoredAtTheRoot). README has a row for the new command.Refs #716, #772.
🤖 Generated with Claude Code