Biblicus

Make your documents usable by your assistant, then decide later how you will search and retrieve them.

Pipeline Catalog

Complete reference of all extraction pipelines available for benchmarking in Biblicus.

Overview

Biblicus includes 8+ pre-configured extraction pipelines with different speed/accuracy trade-offs. Each pipeline is defined in a YAML configuration file under configs/.

Pipeline Comparison Table

Pipeline F1 Score Recall Speed Use Case
PaddleOCR 0.787 0.782 Medium Best overall accuracy
Docling-Smol 0.728 0.675 Slow Tables & formulas
Unstructured 0.649 0.626 Medium General documents
Baseline Tesseract 0.607 0.599 Fast Simple baseline
Layout-Aware Tesseract (PaddleOCR) 0.601 0.732 Medium High recall needs
Heron + Tesseract 0.519 0.810 Slow Maximum extraction
RapidOCR 0.507 0.467 Fast Lightweight/embedded

Basic OCR Pipelines

1. Baseline Tesseract

Simple Tesseract OCR without layout detection.

Configuration: configs/baseline-ocr.yaml

extractor_id: ocr-tesseract
config:
  min_confidence: 0.0
  lang: eng

Performance (FUNSD Forms):

Strengths:

Weaknesses:

Best for: Simple documents, baseline comparisons, speed-critical applications


2. PaddleOCR

PaddleOCR with VL model - best overall performer.

Configuration: configs/ocr-paddleocr.yaml

extractor_id: ocr-paddleocr-vl
config:
  lang: en

Performance (FUNSD Forms):

Strengths:

Weaknesses:

Best for: Production systems, complex documents, when accuracy matters most

Installation:

pip install "biblicus[paddleocr]"

3. Docling-Smol

Docling with SmolDocling-256M vision-language model for document understanding.

Configuration: configs/docling-smol.yaml

extractor_id: docling-smol
config:
  output_format: markdown

Performance (FUNSD Forms):

Strengths:

Weaknesses:

Best for: Academic papers, technical documents, tables and formulas

Installation:

pip install "biblicus[docling]"

4. RapidOCR

Fast, lightweight OCR library for resource-constrained environments.

Configuration: configs/ocr-rapidocr.yaml

extractor_id: ocr-rapidocr
config:
  use_det: true
  use_cls: true
  use_rec: true

Performance (FUNSD Forms):

Strengths:

Weaknesses:

Best for: Real-time applications, edge devices, resource constraints

Installation:

pip install "biblicus[ocr]"

5. Unstructured

Unstructured.io document parser with multi-format support.

Configuration: configs/unstructured.yaml

extractor_id: unstructured
config: {}

Performance (FUNSD Forms):

Strengths:

Weaknesses:

Best for: Mixed document types, production pipelines handling various formats

Installation:

pip install "biblicus[unstructured]"

8. MarkItDown

Microsoft's MarkItDown converter for document-to-markdown conversion.

Configuration: configs/markitdown.yaml

extractor_id: markitdown
config: {}

Strengths:

Weaknesses:

Best for: Converting Office documents, markdown workflows

Installation:

pip install "biblicus[markitdown]"

Layout-Aware Pipelines

Layout-aware pipelines use a two-stage approach:

  1. Layout detection to identify document regions and reading order
  2. OCR on each region in sequence

This improves reading order and can increase recall at the cost of precision.

6. Layout-Aware Tesseract (PaddleOCR)

PaddleOCR PP-Structure layout detection → Tesseract OCR.

Configuration: configs/layout-aware-tesseract.yaml

extractor_id: pipeline
config:
  stages:
    - extractor_id: paddleocr-layout
      config:
        lang: en
    - extractor_id: ocr-tesseract
      config:
        use_layout_metadata: true

Performance (FUNSD Forms):

Strengths:

Weaknesses:

Best for: Documents where missing content is costly, complex layouts

Trade-off: Sacrifices precision for recall - finds more text but includes more noise.


7. Heron + Tesseract

IBM Heron-101 layout detection → Tesseract OCR for maximum text extraction.

Configuration: configs/heron-tesseract.yaml

extractor_id: pipeline
config:
  stages:
    - extractor_id: heron-layout
      config:
        model_variant: "101"
        confidence_threshold: 0.6
    - extractor_id: ocr-tesseract
      config:
        use_layout_metadata: true

Performance (FUNSD Forms):

Strengths:

Weaknesses:

Best for:

Trade-off: Maximum recall at the cost of precision - extracts everything but includes more errors.

See Heron Implementation Guide for detailed information.


Vision-Language Models

Docling-Granite

Docling with IBM Granite Docling-258M VLM for high-accuracy extraction.

Configuration: configs/docling-granite.yaml

extractor_id: docling-granite
config:
  output_format: markdown

Strengths:

Weaknesses:

Best for: When maximum VLM accuracy is needed, complex technical documents

Installation:

pip install "biblicus[docling]"

Creating Custom Pipelines

Single-Stage Custom Pipeline

# configs/my-custom-ocr.yaml
extractor_id: ocr-tesseract
config:
  lang: eng
  psm: 6  # Assume uniform block of text
  min_confidence: 0.6
  oem: 3  # Default LSTM engine

Multi-Stage Custom Pipeline

# configs/my-custom-pipeline.yaml
extractor_id: pipeline
config:
  stages:
    # Stage 1: Layout detection
    - extractor_id: heron-layout
      config:
        model_variant: "101"
        confidence_threshold: 0.7

    # Stage 2: OCR
    - extractor_id: ocr-paddleocr-vl
      config:
        use_layout_metadata: true
        lang: en

    # Stage 3: Post-processing (if available)
    - extractor_id: select-longest-text
      config: {}

Testing Your Custom Pipeline

from pathlib import Path
from biblicus import Corpus
from biblicus.evaluation.ocr_benchmark import OCRBenchmark
from biblicus.extraction import build_extraction_snapshot
import yaml

# Load your config
with open("configs/my-custom-pipeline.yaml") as f:
    config = yaml.safe_load(f)

# Build extraction snapshot
corpus = Corpus(Path("corpora/funsd_benchmark"))
snapshot = build_extraction_snapshot(
    corpus,
    extractor_id=config["extractor_id"],
    configuration_name="my-custom-pipeline",
    configuration=config["config"]
)

# Evaluate
benchmark = OCRBenchmark(corpus)
report = benchmark.evaluate_extraction(
    snapshot_reference=snapshot.snapshot_id,
    pipeline_config=config
)

# View results
report.print_summary()

Adding to Benchmark Suite

Edit scripts/benchmark_all_pipelines.py:

PIPELINE_CONFIGS = [
    # ... existing configs ...
    "configs/my-custom-pipeline.yaml",
]

Then run:

python scripts/benchmark_all_pipelines.py

Pipeline Selection Guide

By Use Case

Maximum Accuracy (F1): Use PaddleOCR

Maximum Recall (Completeness): Use Heron + Tesseract

Speed-Critical: Use RapidOCR or Baseline Tesseract

Tables & Formulas: Use Docling-Smol or Docling-Granite

Multi-Format Documents: Use Unstructured

By Document Type

Forms (FUNSD-like):

  1. PaddleOCR (F1: 0.787)
  2. Docling-Smol (F1: 0.728)
  3. Layout-Aware Tesseract (F1: 0.601, Recall: 0.732)

Receipts (dense text):

  1. PaddleOCR (best for entity extraction)
  2. Docling-Smol (good structure preservation)

Academic Papers (multi-column):

  1. Docling-Granite (best layout understanding)
  2. Docling-Smol (good tables/formulas)
  3. Heron + Tesseract (strong reading order)

Simple Text Documents:

  1. Baseline Tesseract (fast, sufficient)
  2. RapidOCR (lightweight alternative)

Performance Tuning

Improving Recall

If you're missing too much text:

Improving Precision

If you're getting too much noise:

Improving Speed

If processing is too slow:

Next Steps

References