Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Training web API: list ongoing trainings (`GET /api/allTraining`) and interrupt a running training (`DELETE /api/killTraining`). Killing a training releases the per-model lock so the model can be retrained; interruption is best-effort for native (Wapiti/DeLFT) back-ends.

### Changed
- Updated pdfalto to 0.6.1. Notable for GROBID: deterministic output (an uninitialised read and a use-after-free made line/block grouping depend on heap contents, so the same PDF could yield different `<TextLine>`/`<TextBlock>` structure across runs), bounded peak memory on very large or vector-heavy documents, and several text-extraction fixes. The command-line options GROBID passes are unchanged.
- pdfalto is now given GROBID's configured temp directory (`grobid.temp`, by default `grobid-home/tmp`) through `TMPDIR`. Since 0.6.1 pdfalto streams large page DOMs to a scratch file to bound peak memory and picks its location from `TMPDIR`, falling back to `/tmp` — which is tmpfs in most containers, so spilling there leaves peak memory unchanged and risks ENOSPC.
- Lexicon: introduced `Lexicon.builder()` to optionally pre-load chosen gazetteers *eagerly* (`.withDefaults()`, `.withJournals()`, `.withFunders()`, `.withOrganisations()`, etc.). Loading stays **lazy by default**: any gazetteer not named in the builder loads transparently on first lookup, so a `Lexicon` from any entry point is always fully functional and never throws for a missing gazetteer — `withX()` only controls *when* a gazetteer loads, not whether a lookup succeeds. `withDefaults()` eagerly loads the original constructor's set (wordforms, people, countries). `Lexicon.getInstance()` is now `@Deprecated` (prefer the builder) but its behavior is unchanged: eager wordforms/people/countries, everything else lazy.
- Lexicon: added 4 missing ISO 3166-1 country codes (BQ, CW, SS, SX) and migrated AN (Netherlands Antilles) to its ISO 3166-3 transitional form ANHH.
- Documentation: expanded the End-to-end evaluation guide (dedicated multi-dataset runner-script section for `run_evaluation.sh` with an options table and more invocation examples) and the Configuration reference; recorded the Hugging Face DOI (10.57967/hf/9553) for the `grobid-evaluation` dataset.

### Fixed
- Handle the exit codes pdfalto 0.6.1 introduced. Code 5 reports that the ALTO was written correctly but page streaming was disabled mid-run, so peak memory was no longer bounded; both execution paths rejected any non-zero exit and would have discarded these successful conversions. It is now a logged warning. Codes 4 (ALTO write failed) and 98 (allocation failure) are reported as `PDFALTO_CONVERSION_FAILURE` instead of falling through to `BAD_INPUT_DATA`, which blamed the PDF for a pdfalto-side failure.

### Security
- Prevent command injection through crafted PDF file names in the non-server `pdfalto` path: the command is no longer interpolated into a `bash -c` string but passed as positional parameters and exec'd via `"$@"` (GHSA-mgxf-7mg7-qpmf).
- Stop leaking a JVM thread per request on the `/api/modelTraining` endpoint by shutting down the per-request executor (GHSA-g2r5-4c8r-c84f).
Expand Down
302 changes: 151 additions & 151 deletions doc/benchmarks/Benchmarking-biorxiv.md

Large diffs are not rendered by default.

217 changes: 109 additions & 108 deletions doc/benchmarks/Benchmarking-elife.md

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions doc/benchmarks/Benchmarking-plos.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Evaluation on 1000 random PDF files out of 998 PDF (ratio 1.0).
| keywords | 0 | 0 | 0 | 0 |
| title | 95.18 | 94.7 | 94.94 | 1000 |
| | | | | |
| **all fields (micro avg.)** | **24.02** | **25.18** | **24.59** | 4861 |
| **all fields (micro avg.)** | **24.02** | **25.18** | **24.58** | 4861 |
| all fields (macro avg.) | 61.27 | 61.26 | 61.26 | 4861 |

#### Soft Matching (ignoring punctuation, case and space characters mismatches)
Expand All @@ -58,13 +58,13 @@ Evaluation on 1000 random PDF files out of 998 PDF (ratio 1.0).
| label | precision | recall | f1 | support |
|-----------------------------|-----------|-----------|-----------|---------|
| abstract | 49.34 | 50.94 | 50.13 | 960 |
| affiliation_linked | 73.43 | 78.47 | 75.87 | 963 |
| affiliation_linked | 73.43 | 78.49 | 75.87 | 963 |
| authors | 98.97 | 98.97 | 98.97 | 969 |
| first_author | 99.17 | 99.17 | 99.17 | 969 |
| keywords | 0 | 0 | 0 | 0 |
| title | 98.79 | 98.3 | 98.55 | 1000 |
| | | | | |
| **all fields (micro avg.)** | **77.52** | **81.27** | **79.35** | 4861 |
| **all fields (micro avg.)** | **77.52** | **81.28** | **79.36** | 4861 |
| all fields (macro avg.) | 83.94 | 85.17 | 84.54 | 4861 |

#### Levenshtein Matching (Minimum Levenshtein distance at 0.8)
Expand All @@ -74,13 +74,13 @@ Evaluation on 1000 random PDF files out of 998 PDF (ratio 1.0).
| label | precision | recall | f1 | support |
|-----------------------------|-----------|-----------|--------|---------|
| abstract | 75.28 | 77.71 | 76.47 | 960 |
| affiliation_linked | 78.35 | 83.74 | 80.95 | 963 |
| affiliation_linked | 78.35 | 83.75 | 80.96 | 963 |
| authors | 99.38 | 99.38 | 99.38 | 969 |
| first_author | 99.28 | 99.28 | 99.28 | 969 |
| keywords | 0 | 0 | 0 | 0 |
| title | 99.3 | 98.8 | 99.05 | 1000 |
| | | | | |
| **all fields (micro avg.)** | **83.04** | **87.06** | **85** | 4861 |
| **all fields (micro avg.)** | **83.04** | **87.07** | **85** | 4861 |
| all fields (macro avg.) | 90.32 | 91.78 | 91.03 | 4861 |

#### Ratcliff/Obershelp Matching (Minimum Ratcliff/Obershelp similarity at 0.95)
Expand All @@ -90,14 +90,14 @@ Evaluation on 1000 random PDF files out of 998 PDF (ratio 1.0).
| label | precision | recall | f1 | support |
|-----------------------------|-----------|-----------|-----------|---------|
| abstract | 64.78 | 66.88 | 65.81 | 960 |
| affiliation_linked | 76.05 | 81.27 | 78.57 | 963 |
| affiliation_linked | 76.07 | 81.31 | 78.61 | 963 |
| authors | 99.28 | 99.28 | 99.28 | 969 |
| first_author | 99.17 | 99.17 | 99.17 | 969 |
| keywords | 0 | 0 | 0 | 0 |
| title | 98.99 | 98.5 | 98.75 | 1000 |
| | | | | |
| **all fields (micro avg.)** | **80.58** | **84.48** | **82.49** | 4861 |
| all fields (macro avg.) | 87.66 | 89.02 | 88.32 | 4861 |
| **all fields (micro avg.)** | **80.6** | **84.51** | **82.51** | 4861 |
| all fields (macro avg.) | 87.66 | 89.03 | 88.32 | 4861 |

Note: the "affiliation_linked" field above is a linking-aware metric (each author is paired with its gold counterpart
and their attached affiliations compared). Its support column reports the number of articles the metric is computed
Expand Down Expand Up @@ -244,10 +244,10 @@ Total expected references: 48449 - 48.45 references per article
Total predicted references: 47775 - 47.77 references per article

Total expected citation contexts: 69755 - 69.75 citation contexts per article
Total predicted citation contexts: 73296 - 73.3 citation contexts per article
Total predicted citation contexts: 73298 - 73.3 citation contexts per article

Total correct predicted citation contexts: 57033 - 57.03 citation contexts per article
Total wrong predicted citation contexts: 16263 (wrong callout matching, callout missing in NLM, or matching with a bib. ref. not aligned with a bib.ref. in NLM)
Total correct predicted citation contexts: 57034 - 57.03 citation contexts per article
Total wrong predicted citation contexts: 16264 (wrong callout matching, callout missing in NLM, or matching with a bib. ref. not aligned with a bib.ref. in NLM)

Precision citation contexts: 77.81
Recall citation contexts: 81.76
Expand All @@ -273,14 +273,14 @@ Evaluation on 1000 random PDF files out of 998 PDF (ratio 1.0).
| conflict_stmt | 92.57 | 91.89 | 92.23 | 962 |
| figure_title | 0.18 | 0.09 | 0.12 | 8943 |
| funding_stmt | 5.79 | 31.12 | 9.77 | 1507 |
| reference_citation | 87.98 | 94.53 | 91.13 | 69741 |
| reference_citation | 87.97 | 94.53 | 91.13 | 69741 |
| reference_figure | 74.11 | 85.79 | 79.52 | 11010 |
| reference_table | 70.21 | 94.32 | 80.5 | 5159 |
| section_title | 72.98 | 66.28 | 69.47 | 17540 |
| section_title | 72.97 | 66.29 | 69.47 | 17540 |
| table_title | 0 | 0 | 0 | 6092 |
| | | | | |
| **all fields (micro avg.)** | **74.56** | **76.95** | **75.74** | 121733 |
| all fields (macro avg.) | 51.28 | 58 | 53.4 | 121733 |
| all fields (macro avg.) | 51.28 | 58.01 | 53.4 | 121733 |

#### Soft Matching (ignoring punctuation, case and space characters mismatches)

Expand All @@ -292,13 +292,13 @@ Evaluation on 1000 random PDF files out of 998 PDF (ratio 1.0).
| conflict_stmt | 95.6 | 94.91 | 95.25 | 962 |
| figure_title | 93.18 | 45.82 | 61.43 | 8943 |
| funding_stmt | 7.33 | 39.35 | 12.35 | 1507 |
| reference_citation | 87.98 | 94.54 | 91.14 | 69741 |
| reference_citation | 87.97 | 94.54 | 91.14 | 69741 |
| reference_figure | 74.35 | 86.07 | 79.78 | 11010 |
| reference_table | 70.37 | 94.53 | 80.68 | 5159 |
| section_title | 78.78 | 71.56 | 75 | 17540 |
| section_title | 78.77 | 71.56 | 75 | 17540 |
| table_title | 52.96 | 7.49 | 13.12 | 6092 |
| | | | | |
| **all fields (micro avg.)** | **79.25** | **81.79** | **80.5** | 121733 |
| **all fields (micro avg.)** | **79.24** | **81.79** | **80.5** | 121733 |
| all fields (macro avg.) | 71.79 | 68.92 | 66.06 | 121733 |

**Document-level ratio results**
Expand All @@ -311,5 +311,5 @@ Evaluation on 1000 random PDF files out of 998 PDF (ratio 1.0).
| **all fields (micro avg.)** | **99.71** | **99.83** | **99.77** | 1741 |
| all fields (macro avg.) | 99.69 | 99.89 | 99.79 | 1741 |

Evaluation metrics produced in 123.164 seconds
Evaluation metrics produced in 102.355 seconds

Loading
Loading