Expand description
Conversion-confidence report — the Rust counterpart of docling’s
ConfidenceReport / PageConfidenceScores (docling.datamodel.base_models,
surfaced per conversion by Python docling-serve v1.25+, #183).
Semantics mirror docling exactly:
- Four per-page scores, each in
[0, 1]or unset (docling usesNaN; hereOption<f64>so JSON serializes asnullinstead of an invalidNaNliteral):layout_score(mean confidence of the kept layout clusters),ocr_score(mean confidence of OCR-recognized cells),parse_score(10th-percentile text-layer quality — the quantile emphasises problems),table_score(unset; docling never assigns it either, the field exists for wire compatibility). - A page’s
mean_score/low_scoreare the NaN-ignoring mean / 5th percentile of its four scores; document-levelmean_score/low_scoreare the plain means of the per-page values (docling’sConfidenceReportoverrides — note: mean, not quantile, for both). - Document-level per-field aggregation: mean for layout/table/ocr, 10th percentile for parse.
- Grades:
< 0.5poor,< 0.8fair,< 0.9good,≥ 0.9excellent, unset → unspecified.
Structs§
- Confidence
Report - The document-level report (docling’s
ConfidenceReport): the four scores aggregated across pages, plus the per-page breakdown. Page keys are the real 1-based page numbers — the same numbering as the JSON export’spagesmap (#171),--pageswindows included. (docling keys by its 0-based internal page index; ours is the more useful spelling and the difference is documented indocs/MIGRATION.md.) - Page
Confidence - One page’s confidence scores (docling’s
PageConfidenceScores).
Enums§
- Quality
Grade - docling’s
QualityGrade: a score bucketed for human consumption.
Functions§
- nanmean
- NaN-ignoring mean (docling’s
np.nanmean):Noneentries are skipped; all-unset yieldsNone(where numpy would warn and returnNaN). - nanquantile
- NaN-ignoring quantile with numpy’s default linear interpolation
(docling’s
np.nanquantile(..., q)).