Files
kg-scr/config.yaml
Aman Nalakath a0211155fa refactor: solidify startup UX and engine-aware preprocessing
- Slim core deps: move ML stack to optional extras (paddle/tables/figures/scientific/full)
- Lazy settings proxy with config search paths (env var, cwd, user dir)
- New commands: init, demo, setup [basic|full], first-run guard on run/watch
- Engine-aware preprocessing: Paddle gets original image (fixes dark mode 0.83->0.95)
- Results table shows Skipped count; lazy run-dir creation
- kg_ocr marked experimental with extra, Docker defaults with OCR_PIPELINE_CONFIG
- 25/25 tests, ruff clean
2026-07-19 22:14:54 +02:00

106 lines
2.3 KiB
YAML

# Full-stack config used for this repo's development. New users: run
# `ocr-pipeline init` to generate a minimal config instead of copying this file.
input:
paths:
- "~/Pictures"
patterns:
- "SCR-*.png"
- "*.jpg"
- "*.jpeg"
- "*.tiff"
- "*.bmp"
recursive: true
exclude_patterns:
- "*.photoslibrary/*"
ocr:
engine: "paddleocr"
languages: ["en", "latin"]
use_gpu: false
use_angle_cls: true
det_db_thresh: 0.3
det_db_box_thresh: 0.6
det_db_unclip_ratio: 1.5
rec_batch_num: 6
cpu_threads: 4
processing:
workers: 4
batch_size: 10
retry_attempts: 2
timeout_per_image: 120
skip_existing: true
detectors:
figures:
enabled: true
model: "lp://PubLayNet/faster_rcnn_R_50_FPN_3x/config"
confidence_threshold: 0.7
tables:
enabled: true
model: "microsoft/table-transformer-detection"
confidence_threshold: 0.7
captions:
enabled: true
model: "lp://PubLayNet/faster_rcnn_R_50_FPN_3x/config"
confidence_threshold: 0.5
entities:
enabled: true
model: "en_core_sci_lg"
types:
- "GENE"
- "PROTEIN"
- "CHEMICAL"
- "SPECIES"
- "DISEASE"
- "CELL_LINE"
- "ORGANISM"
- "CELL_TYPE"
merge_entities: true
citations:
regex_enabled: true
grobid_enabled: false
grobid_url: "http://localhost:8070"
grobid_timeout: 30
chunking:
chunk_size: 1000
chunk_overlap: 200
separators: ["\n\n", "\n", ". ", " ", ""]
keep_separator: true
output:
write_consolidated: true
consolidated_filename: "all_ocr.md"
# Uses platformdirs default: ~/.local/share/ocr-pipeline (Linux), ~/Library/Application Support/ocr-pipeline (macOS), %LOCALAPPDATA%\ocr-pipeline (Windows)
format: "markdown"
organize_by: "date_run"
frontmatter:
fields:
- "source_path"
- "source_hash"
- "timestamp"
- "ocr_engine"
- "ocr_confidence_mean"
- "language"
- "detected_entities"
- "entity_extraction_backend"
- "has_figures"
- "has_tables"
- "citations_found"
- "chunk_index"
- "total_chunks"
include_raw_text: false
watch:
enabled: true
debounce_seconds: 5
# Uses platform-aware defaults from config.py
# ignore_patterns:
# - ".DS_Store"
# - "*.tmp"
# - "*.partial"
# - "*.crdownload"
poll_interval: 1.0