Skip to content

Pipeline options

Pipeline options allow to customize the execution of the models during the conversion pipeline. This includes options for the OCR engines, the table model as well as enrichment options which can be enabled with do_xyz = True.

This is an automatic generated API reference of the all the pipeline options available in Docling.

pipeline_options

Classes:

EasyOcrOptions

Bases: OcrOptions

Options for the EasyOCR engine.

Attributes:

bitmap_area_threshold class-attribute instance-attribute

bitmap_area_threshold: float = 0.05

download_enabled class-attribute instance-attribute

download_enabled: bool = True

force_full_page_ocr class-attribute instance-attribute

force_full_page_ocr: bool = False

kind class-attribute instance-attribute

kind: Literal['easyocr'] = 'easyocr'

lang class-attribute instance-attribute

lang: List[str] = ['fr', 'de', 'es', 'en']

model_config class-attribute instance-attribute

model_config = ConfigDict(
    extra="forbid", protected_namespaces=()
)

model_storage_directory class-attribute instance-attribute

model_storage_directory: Optional[str] = None

use_gpu class-attribute instance-attribute

use_gpu: bool = True

OcrEngine

Bases: str, Enum

Enum of valid OCR engines.

Attributes:

EASYOCR class-attribute instance-attribute

EASYOCR = 'easyocr'

OCRMAC class-attribute instance-attribute

OCRMAC = 'ocrmac'

RAPIDOCR class-attribute instance-attribute

RAPIDOCR = 'rapidocr'

TESSERACT class-attribute instance-attribute

TESSERACT = 'tesseract'

TESSERACT_CLI class-attribute instance-attribute

TESSERACT_CLI = 'tesseract_cli'

OcrMacOptions

Bases: OcrOptions

Options for the Mac OCR engine.

Attributes:

bitmap_area_threshold class-attribute instance-attribute

bitmap_area_threshold: float = 0.05

force_full_page_ocr class-attribute instance-attribute

force_full_page_ocr: bool = False

framework class-attribute instance-attribute

framework: str = 'vision'

kind class-attribute instance-attribute

kind: Literal['ocrmac'] = 'ocrmac'

lang class-attribute instance-attribute

lang: List[str] = ['fr-FR', 'de-DE', 'es-ES', 'en-US']

model_config class-attribute instance-attribute

model_config = ConfigDict(extra='forbid')

recognition class-attribute instance-attribute

recognition: str = 'accurate'

OcrOptions

Bases: BaseModel

OCR options.

Attributes:

bitmap_area_threshold class-attribute instance-attribute

bitmap_area_threshold: float = 0.05

force_full_page_ocr class-attribute instance-attribute

force_full_page_ocr: bool = False

kind instance-attribute

kind: str

lang instance-attribute

lang: List[str]

PdfBackend

Bases: str, Enum

Enum of valid PDF backends.

Attributes:

DLPARSE_V1 class-attribute instance-attribute

DLPARSE_V1 = 'dlparse_v1'

DLPARSE_V2 class-attribute instance-attribute

DLPARSE_V2 = 'dlparse_v2'

PYPDFIUM2 class-attribute instance-attribute

PYPDFIUM2 = 'pypdfium2'

PdfPipelineOptions

Bases: PipelineOptions

Options for the PDF pipeline.

Attributes:

artifacts_path class-attribute instance-attribute

artifacts_path: Optional[Union[Path, str]] = None

create_legacy_output class-attribute instance-attribute

create_legacy_output: bool = True

do_ocr class-attribute instance-attribute

do_ocr: bool = True

do_table_structure class-attribute instance-attribute

do_table_structure: bool = True

document_timeout class-attribute instance-attribute

document_timeout: Optional[float] = None

generate_page_images class-attribute instance-attribute

generate_page_images: bool = False

generate_picture_images class-attribute instance-attribute

generate_picture_images: bool = False

generate_table_images class-attribute instance-attribute

generate_table_images: bool = Field(
    default=False,
    deprecated="Field `generate_table_images` is deprecated. To obtain table images, set `PdfPipelineOptions.generate_page_images = True` before conversion and then use the `TableItem.get_image` function.",
)

images_scale class-attribute instance-attribute

images_scale: float = 1.0

ocr_options class-attribute instance-attribute

ocr_options: Union[
    EasyOcrOptions,
    TesseractCliOcrOptions,
    TesseractOcrOptions,
    OcrMacOptions,
    RapidOcrOptions,
] = Field(EasyOcrOptions(), discriminator="kind")

table_structure_options class-attribute instance-attribute

table_structure_options: TableStructureOptions = (
    TableStructureOptions()
)

PipelineOptions

Bases: BaseModel

Base pipeline options.

Attributes:

create_legacy_output class-attribute instance-attribute

create_legacy_output: bool = True

document_timeout class-attribute instance-attribute

document_timeout: Optional[float] = None

RapidOcrOptions

Bases: OcrOptions

Options for the RapidOCR engine.

Attributes:

bitmap_area_threshold class-attribute instance-attribute

bitmap_area_threshold: float = 0.05

cls_model_path class-attribute instance-attribute

cls_model_path: Optional[str] = None

det_model_path class-attribute instance-attribute

det_model_path: Optional[str] = None

force_full_page_ocr class-attribute instance-attribute

force_full_page_ocr: bool = False

kind class-attribute instance-attribute

kind: Literal['rapidocr'] = 'rapidocr'

lang class-attribute instance-attribute

lang: List[str] = ['english', 'chinese']

model_config class-attribute instance-attribute

model_config = ConfigDict(extra='forbid')

print_verbose class-attribute instance-attribute

print_verbose: bool = False

rec_model_path class-attribute instance-attribute

rec_model_path: Optional[str] = None

text_score class-attribute instance-attribute

text_score: float = 0.5

use_cls class-attribute instance-attribute

use_cls: Optional[bool] = None

use_det class-attribute instance-attribute

use_det: Optional[bool] = None

use_rec class-attribute instance-attribute

use_rec: Optional[bool] = None

TableFormerMode

Bases: str, Enum

Modes for the TableFormer model.

Attributes:

ACCURATE class-attribute instance-attribute

ACCURATE = 'accurate'

FAST class-attribute instance-attribute

FAST = 'fast'

TableStructureOptions

Bases: BaseModel

Options for the table structure.

Attributes:

do_cell_matching class-attribute instance-attribute

do_cell_matching: bool = True

mode class-attribute instance-attribute

TesseractCliOcrOptions

Bases: OcrOptions

Options for the TesseractCli engine.

Attributes:

bitmap_area_threshold class-attribute instance-attribute

bitmap_area_threshold: float = 0.05

force_full_page_ocr class-attribute instance-attribute

force_full_page_ocr: bool = False

kind class-attribute instance-attribute

kind: Literal['tesseract'] = 'tesseract'

lang class-attribute instance-attribute

lang: List[str] = ['fra', 'deu', 'spa', 'eng']

model_config class-attribute instance-attribute

model_config = ConfigDict(extra='forbid')

path class-attribute instance-attribute

path: Optional[str] = None

tesseract_cmd class-attribute instance-attribute

tesseract_cmd: str = 'tesseract'

TesseractOcrOptions

Bases: OcrOptions

Options for the Tesseract engine.

Attributes:

bitmap_area_threshold class-attribute instance-attribute

bitmap_area_threshold: float = 0.05

force_full_page_ocr class-attribute instance-attribute

force_full_page_ocr: bool = False

kind class-attribute instance-attribute

kind: Literal['tesserocr'] = 'tesserocr'

lang class-attribute instance-attribute

lang: List[str] = ['fra', 'deu', 'spa', 'eng']

model_config class-attribute instance-attribute

model_config = ConfigDict(extra='forbid')

path class-attribute instance-attribute

path: Optional[str] = None