Repository navigation
Fix two reference-scoring errors (metrics v7) and recover two kinds of lost DOI - #294
Draft
thesanogoeffect wants to merge 3 commits into
Draft
thesanogoeffect wants to merge 3 commits into
thesanogoeffect wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #294 +/- ##
=======================================
Coverage 91.14% 91.15%
=======================================
Files 344 344
Lines 73647 73688 +41
Branches 13667 13677 +10
=======================================
+ Hits 67125 67167 +42
Misses 4041 4041
+ Partials 2481 2480 -1 🚀 New features to boost your workflow:
|
thesanogoeffect
force-pushed
the
thesanogoeffect/improvements
branch
from
November 27, 2026 19:08
4e5c174 to
f78fb95
Compare
…ences nothing can match ref_matching_f1 was wrong in two ways no extraction could do anything about. A gold record made from publisher XML holds an empty entry for each reference the XML gives as plain text. The entry counted as a missed reference and the extraction of that very reference as a spurious one, so a perfect extraction scored below 1.0. Such an entry is now set aside from the recall, precision and per-field denominators; the per-paper count is ref_field_counts.gold_refs_unmatchable. A gold record may carry the printed string as bib[].unstructured instead. A reference printed as authors, journal, year, volume and page could only match on first author and year, and that level read the first word of the author string: an initial for 'J. M. Smith'. The first author is now compared by name words, and the same year, volume and first page match at 0.8. Two rules are stricter: a shared first initial is not a shared first author, and the citation-string level needs the author's name as a whole word. metrics_version goes from 5 to 7 (6 was used for another counter). On stored predictions for the 300 papers of the public JATS benchmark the answer key scored against itself passes 100% of both sets (96.5% and 93.0% before), and no paper scores lower. The CHANGELOG has the per-tool shifts.
Two ways a paper lost a DOI that its pages print, both found in a uniform sample of PubMed Central papers. Older BioMed Central articles print the DOI once: on a line of its own after the last reference, directly above 'Cite this article as: ...'. That line was read as the last reference's DOI, so the paper had none and its last reference carried the paper's. A DOI whose label opens its sentence and that the article's citation cue follows directly is now the paper's own, unless the citation block prints a DOI itself. A DOI that ends a reference entry does not qualify, and a DOI the first page labels still outranks it. A running footer prints the DOI and then the page number. Where the text layer leaves no gap, every such page gave a DOI of its own and the real one was rejected as cut short, so the selection abstained. Two or more header or footer DOIs that extend one printed DOI by digits alone, with ends as close together as page numbers, are now rejected as line_join_overrun. Applied to the stored candidates of that sample's run, the rules give 4 of 7 papers without a DOI their DOI and change no other paper; neither applies to any of the 300 papers of the public JATS benchmark.
The DOI entry gave an estimate from stored DOI candidates. It now also gives what runs with --fast before and after the change measured: on the public JATS benchmark, and on a second sample of 320 PubMed Central papers that was not used to write the rules. The build that was measured also carried a corresponding-author rule that is not on this branch. That rule is in the author address pass; the DOI selection does not read the corresponding-author flag. The scorer entry's sentence about the uniform sample now gives counts for 168 papers scored with version 5 and version 7.
thesanogoeffect
force-pushed
the
thesanogoeffect/improvements
branch
from
November 27, 2026 19:46
f78fb95 to
5c74d53
Compare
This branch has not been deployed
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.
What this changes
Two independent changes, one commit each, and a changelog commit with the measured numbers. Both were found by running
--faston a uniform sample of PubMed Central papers and reading the failures against the publisher XML.1. Reference scoring,
metrics_version5 to 7 (853b5abf).ref_matching_f1was wrong in two ways that no extraction could do anything about.Two rules are stricter: a shared first initial is not a shared first author, and the citation-string level needs the author's name as a whole word.
2. DOI (
a80b465e).line_join_overrun.Measured
Scorer. On stored predictions for the 300 papers of the public JATS benchmark, the answer key scored against itself passes 100% of both sets; under version 5 it passed 96.5% and 93.0%. Papers passing all four floors, version 5 to version 7:
--fastNo paper scores lower. Scores made with versions 5 and 7 do not compare; benchmark scores published before this change were made with version 5.
DOI rules.
--faston CPU, run onmainas it was before 0.9.2 was prepared (3b7753a9) and on a build with the DOI rules on top of it, both scored with version 7:The rules only fill a DOI where none was extracted, so a wrong DOI would score 0 before and after and would not show as worse. Counted on the exports instead: in the second sample a DOI was added in 6 papers, each the DOI of the publisher XML, and no other paper's DOI changed.
The rules were written on a first sample of 168 PubMed Central papers, where 7 of 163 papers with a DOI had none extracted; the changelog has those counts.
Not measured
mainafter Prepare 0.9.2: Wave 4 speed-ups, uv tool setup, demo UX, version bump, and dependency updates #285 (0.9.2). The runs above predate it. Prepare 0.9.2: Wave 4 speed-ups, uv tool setup, demo UX, version bump, and dependency updates #285 does not touch the files this PR changes, but its Wave 4 changes touch the--fasttext-layer path (the layout render resolution), and the rebased head was not rerun.Relation to #292
This PR first carried a third commit that flags the corresponding author from a paper's only printed address. It conflicted with #292 in
bibr/extract/author_email_harvester.py, and its counts were againstmainwithout #292. The commit was taken out of this branch on 27 November and is being rerun on top of #292's head. It will be proposed separately if it still adds enough.What is left overlaps with #292 only in
CHANGELOG.md, where both add entries under Unreleased.Tests
5,093 tests pass locally in the evaluation, extraction and pipeline test directories and the docs sync test;
ruff checkandruff format --checkare clean on the changed files. New tests use made-up names and DOIs.