pub struct ConfidenceReport {
pub pages: BTreeMap<usize, PageConfidence>,
/* private fields */
}Expand description
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’s
pages map (#171), --pages windows included. (docling keys by its
0-based internal page index; ours is the more useful spelling and the
difference is documented in docs/MIGRATION.md.)
Fields§
§pages: BTreeMap<usize, PageConfidence>Implementations§
Source§impl ConfidenceReport
impl ConfidenceReport
Sourcepub fn from_pages(pages: BTreeMap<usize, PageConfidence>) -> Self
pub fn from_pages(pages: BTreeMap<usize, PageConfidence>) -> Self
Build from per-page scores keyed by 1-based page number.
Sourcepub fn with_ocr_cells(
self,
page_no: usize,
cells: Vec<OcrCellConfidence>,
) -> Self
pub fn with_ocr_cells( self, page_no: usize, cells: Vec<OcrCellConfidence>, ) -> Self
Attach the per-cell OCR confidences of a page (1-based). Empty lists are not stored.
Sourcepub fn ocr_cells(&self, page_no: usize) -> &[OcrCellConfidence]
pub fn ocr_cells(&self, page_no: usize) -> &[OcrCellConfidence]
The OCR cells of a page with their recognition confidence, in the order the pipeline produced them; empty when the page was not OCR’d.
Sourcepub fn low_confidence_cells(
&self,
threshold: f32,
) -> impl Iterator<Item = (usize, &OcrCellConfidence)>
pub fn low_confidence_cells( &self, threshold: f32, ) -> impl Iterator<Item = (usize, &OcrCellConfidence)>
The cells of every page whose confidence is below threshold,
as (page_no, cell).
Sourcepub fn layout_score(&self) -> Option<f64>
pub fn layout_score(&self) -> Option<f64>
Document layout_score: mean of the per-page values.
Sourcepub fn parse_score(&self) -> Option<f64>
pub fn parse_score(&self) -> Option<f64>
Document parse_score: 10th percentile of the per-page values
(docling: quantile here too, to emphasise problem pages).
Sourcepub fn table_score(&self) -> Option<f64>
pub fn table_score(&self) -> Option<f64>
Document table_score: mean of the per-page values.
Sourcepub fn mean_score(&self) -> Option<f64>
pub fn mean_score(&self) -> Option<f64>
Document mean_score: mean of the per-page mean scores.
Sourcepub fn low_score(&self) -> Option<f64>
pub fn low_score(&self) -> Option<f64>
Document low_score: mean (sic — docling’s override uses nanmean,
not a quantile) of the per-page low scores.
pub fn mean_grade(&self) -> QualityGrade
pub fn low_grade(&self) -> QualityGrade
Sourcepub fn to_json(&self) -> Value
pub fn to_json(&self) -> Value
The full report as JSON — docling’s ConfidenceReport dump shape
(unset scores as null, grades as lowercase strings, pages keyed by
stringified page number).
Sourcepub fn summary_json(&self) -> Value
pub fn summary_json(&self) -> Value
The document-level scores/grades only (no pages) — compact enough
for a response header.