Skip to content

Commit b6a37b7

Browse files
committed
change to sentence-level OCR
Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
1 parent 0447a92 commit b6a37b7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

docling/datamodel/pipeline_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ class NemotronOcrOptions(OcrOptions):
351351
"because it maps most directly to Docling OCR cells."
352352
)
353353
),
354-
] = "word"
354+
] = "sentence"
355355
model_config = ConfigDict(
356356
extra="forbid",
357357
)

docs/examples/full_page_ocr.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
TesseractCliOcrOptions,
3737
)
3838
from docling.document_converter import DocumentConverter, PdfFormatOption
39+
from docling.pipeline.legacy_standard_pdf_pipeline import LegacyStandardPdfPipeline
3940

4041

4142
def main():
@@ -53,17 +54,18 @@ def main():
5354
# TesseractCliOcrOptions, OcrMacOptions (macOS only), RapidOcrOptions,
5455
# NemotronOcrOptions (Linux x86_64, Python 3.12, CUDA 13.x only)
5556
# ocr_options = EasyOcrOptions(force_full_page_ocr=True)
56-
# ocr_options = NemotronOcrOptions(force_full_page_ocr=True)
57+
ocr_options = NemotronOcrOptions(force_full_page_ocr=True)
5758
# ocr_options = TesseractOcrOptions(force_full_page_ocr=True)
5859
# ocr_options = OcrMacOptions(force_full_page_ocr=True)
5960
# ocr_options = RapidOcrOptions(force_full_page_ocr=True)
60-
ocr_options = TesseractCliOcrOptions(force_full_page_ocr=True)
61+
# ocr_options = TesseractCliOcrOptions(force_full_page_ocr=True)
6162
pipeline_options.ocr_options = ocr_options
6263

6364
converter = DocumentConverter(
6465
format_options={
6566
InputFormat.PDF: PdfFormatOption(
6667
pipeline_options=pipeline_options,
68+
# pipeline_cls=LegacyStandardPdfPipeline,
6769
)
6870
}
6971
)

0 commit comments

Comments
 (0)