Skip to main content

Module quality

Module quality 

Source
Expand description

Per-page conversion-confidence scoring (#183) — the Rust port of docling’s confidence plumbing: rate_text_quality from the page-preprocessing stage (parse quality of the extracted text layer) and the layout/OCR score aggregation the layout-postprocessing and OCR stages assign.

Functions§

layout_score
The page layout_score: mean confidence of the final (postprocessed) layout regions — Some(0.0) for a region-less page, exactly like docling’s float(np.mean(...)) if clusters else 0.0.
ocr_score
The page ocr_score: mean recognition confidence over the page’s OCR’d cells; unset when nothing on the page came from OCR (docling only assigns it when OCR cells exist).
page_confidence
Assemble the page’s PageConfidence (table_score stays unset — docling never assigns it either).
parse_score
The page parse_score: the 10th-percentile rate_text_quality over the extracted text-layer cells (the quantile emphasises problem cells, matching docling’s page-preprocessing stage). Unset when the page has no text layer (a scanned page — docling’s nanquantile([]) is NaN there too).
rate_text_quality
docling’s rate_text_quality: score one text cell’s extraction quality. Hard garbage (replacement chars, GLYPH<..> references, /G123-style glyph ids, mostly-slash-number content) is a 0.0; otherwise fragmented-word runs (W/or.ds/sp.lit artifacts) are penalised 0.1 each once at least three appear.