Phase 7: ground-truth export (JSONL + stats) + CLI tool
- GET /api/v1/ground-truth/export streaming JSONL (approved_only, since, until, has_corrections, limit) - GET /api/v1/ground-truth/stats total / approved / corrections counts + top-N most-corrected field paths - python -m ocr_sprint.tools.export_ground_truth operator CLI with the same filters + optional --print-stats - Ground-truth sample reconstructs the pipeline's original output by replaying job_corrections in reverse - docs/ground-truth-format.md schema + fine-tuning guidance - 17 new tests (service replay, endpoint filters, CLI) - 201 total tests passing, ruff / mypy --strict clean Co-Authored-By: adrian kuman firmansah <adriancuman@gmail.com>
This commit is contained in:
@@ -7,7 +7,7 @@ from fastapi import FastAPI
|
||||
from ocr_sprint import __version__
|
||||
from ocr_sprint.api.errors import register_error_handlers
|
||||
from ocr_sprint.api.metrics import MetricsMiddleware, metrics_endpoint
|
||||
from ocr_sprint.api.routes import documents, health
|
||||
from ocr_sprint.api.routes import documents, ground_truth, health
|
||||
from ocr_sprint.config import get_settings
|
||||
from ocr_sprint.db import models as _models # noqa: F401 (register ORM tables)
|
||||
from ocr_sprint.db.base import Base, get_engine
|
||||
@@ -43,6 +43,7 @@ def create_app() -> FastAPI:
|
||||
app.add_middleware(MetricsMiddleware)
|
||||
app.include_router(health.router, prefix="/api/v1")
|
||||
app.include_router(documents.router, prefix="/api/v1")
|
||||
app.include_router(ground_truth.router, prefix="/api/v1")
|
||||
app.add_api_route("/metrics", metrics_endpoint, methods=["GET"], include_in_schema=False)
|
||||
return app
|
||||
|
||||
|
||||
Reference in New Issue
Block a user