Spaces:
Sleeping
Sleeping
Commit History
-
Sprint 13: comprehensive test fixtures and end-to-end hardening
ClaudeUnverified signature6 test fixtures covering all scenarios from §28.5: - paddle_ocr_sample.json: simple page (existing) - double_column.json: 4 items in 2 columns — tests reading order inference - noisy_page.json: negative coords, low confidence, skewed polygons — tests bbox clamping and repair - title_body.json: title + body paragraphs - hyphenation_sample.json: "patri-" + "moine" — tests hyphenation detection - text_only_blocks.json: structured text without geometry — tests text_only adapter, ALTO refusal, viewer degraded mode End-to-end tests run full pipeline for each fixture: raw → normalize → enrich → validate → ALTO + PAGE + viewer Bug fix: word_box_json adapter now clamps negative coordinates from noisy OCR data before creating Geometry objects (real-world PaddleOCR can produce bbox vertices outside image bounds). 20 new tests. 497 total passing. https://claude.ai/code/session_01Cuzvc9Pjfo5u46eT3ta2Cg84ced9b -
Sprint 9: complete provider system — runtimes, adapters, registry, resolver
ClaudeUnverified signatureThree runtimes (skeleton for V1, actual execution deferred): - local_runtime.py: for locally installed models - hub_runtime.py: for HF Hub models (detects huggingface_hub availability) - api_runtime.py: for external HTTP endpoints (configurable timeout/retries) Two new adapters: - line_box_json: handles providers returning lines with bboxes but no word segmentation. Converts xyxy→xywh. Each line becomes one word. Block inferred - text_only: handles mLLM providers (Qwen, etc.) returning text without geometry. Geometry marked 'unknown' — honest about data absence. Splits text into paragraphs and lines. ALTO will be refused, PAGE may be partial Provider infrastructure: - registry.py: central index of adapters (3 families) and runtimes (3 types) with get_adapter(), get_runtime(), list_*() functions - resolver.py: ResolvedProvider — resolves ProviderProfile into concrete runtime + adapter pair. No magic: profile declares family + runtime_type - normalization/pipeline.py: updated…0580de5 -
Sprint 3: vertical slice — PaddleOCR adapter, normalization pipeline, ALTO serializer
ClaudeUnverified signatureFirst end-to-end flow: image provider output → CanonicalDocument → ALTO XML. Provider system skeleton: - BaseRuntime ABC (execute, is_available) - BaseAdapter ABC (family, version, normalize) - ProviderProfile model (runtime_type, family, capabilities, auth, timeouts) - CapabilityMatrix model (11 boolean capabilities) Normalization: - CanonicalBuilder: fluent builder pattern for constructing CanonicalDocuments (builder.add_page → page.add_text_region → region.add_line → line.add_word) - WordBoxJsonAdapter: converts PaddleOCR 4-point polygon format to canonical model with full provenance (native for words, inferred for block) - NormalizationPipeline: resolves adapter by family, runs normalization ALTO XML serializer (lxml): - Deterministic mapping: Page→Page, TextRegion→TextBlock, TextLine→TextLine, Word→String with HPOS/VPOS/WIDTH/HEIGHT/CONTENT/WC attributes - Hyphenation support (SUBS_TYPE, SUBS_CONTENT) - SP elements between words - Description with MeasurementUnit, fileNam…1cbec06