Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions manual/workflow/ocr-accuracy-evidence.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Local-Only OCR Accuracy Evidence Workflow

This document describes the process for measuring OCR accuracy against a local, private corpus of copyrighted PDF files. The goal is to generate redacted, structural metrics that can be used for equivalence testing without committing any sensitive or copyrighted material to the repository.

## 1. Private Corpus Location

The private PDF files are stored in the following directory:

```
/tests/copyrighted_fixtures_for_realities
```

**CRITICAL:** This directory is listed in `.gitignore`. Its contents **must never** be committed to the repository. It should contain a small, representative set of high-resolution PDF scans.

## 2. Generating the Baseline

The structural metrics are generated by the `tools/derive_private_baseline.py` script. This script runs the full `mineru` OCR pipeline on each PDF in the private corpus and aggregates the results into a single JSON file.

### Command

To run the harness, execute the following command from the repository root:

```bash
uv run python tools/derive_private_baseline.py \
--private-fixtures-dir /path/to/your/tests/copyrighted_fixtures_for_realities \
tests/fixtures/private_page_baseline.json
```

This will overwrite the existing placeholder fixture with a new baseline derived from your local private files.

**CRITICAL:** The output file `tests/fixtures/private_page_baseline.json` **must not** be committed to the repository if it contains data derived from the private corpus. The version in the repository should always be the generic, placeholder version. This workflow is for local-only validation.

## 3. Current Status: BLOCKED

As of 2026-04-23, the execution of this harness is **BLOCKED**. The underlying `mineru` OCR process hangs indefinitely when processing the private PDF files.

This issue is tracked in **[#70](https://github.com/Seongho-Bae/newsdom-api/issues/70)**.

Until this blocker is resolved, generating a new `private_page_baseline.json` from the local corpus is not possible. The harness script and tests have been merged so that the tooling is in place once the blocker is fixed.
5 changes: 4 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ nav:
- 시작하기: index.md
- 설치 가이드: installation.md
- 사용 방법 및 API: api-reference.md
- 개발 및 기여: development.md
- 개발 및 기여:
- development.md
- 워크플로우:
- workflow/ocr-accuracy-evidence.md
Loading