Testing

Strategy

The OCR pipeline is tested at multiple levels:

  • Unit tests — individual stage logic (quality detection, classification rules, chunking strategies)
  • Integration tests — end-to-end pipeline runs on curated test documents
  • Quality benchmarks — OCR accuracy against ground truth, retrieval precision/recall
  • Manual review — human inspection of RAG answers with citations

Test Documents

A representative set of archive documents covering all target document types:

Document Type Count Characteristics
Printed book page 5 Clean, consistent font
Typewritten letter 5 Variable quality
Handwritten record 5 Cursive, varied hands
Ledger page 3 Tables, numbers
Invoice/Check 3 Structured, amounts
Meeting minutes 3 Paragraphs, dates
Form 2 Field groups
Poor-quality scan 3 Blur, skew, damage

Quality Metrics

  • OCR character accuracy: CER against ground truth transcription
  • Classification accuracy: % correct document type assignment
  • Metadata precision/recall: dates, people, organizations
  • Retrieval precision@k: % of top-k chunks relevant to query
  • Answer groundedness: % of RAG claims supported by source citations

See test-plan.md for strategy and test-cases.md for concrete test vectors.