Introduction
Optical Character Recognition (OCR) is the foundation of document digitization, yet it remains prone to noise. Traditional post-OCR correction typically relies on supervised learning, which requires expensive pairs of noisy and ground-truth text. Furthermore, generative models (e.g., seq2seq) pose a significant "hallucination" risk in sensitive domains like law or finance, where a model might "guess" a plausible but incorrect value. This paper proposes an unsupervised alternative: using a Language Model (LM) to reconcile outputs from multiple OCR engines.
Methodology: The LM as a Referee
The proposed pipeline avoids text generation, instead selecting the most probable segments from existing OCR outputs. This "safety through selection" ensures that the model never invents text that wasn't present in at least one OCR view.
- Alignment: Multiple OCR sequences (e.g., $S_1$ and $S_2$) are aligned using the Myers edit script algorithm to identify "difference chunks" where engines disagree.
- Scoring: For each disagreement, the system evaluates the perplexity of the resulting text using a pretrained LM (like GPT-2).
- Selection: A beam search algorithm navigates the possible combinations, choosing the path with the lowest overall perplexity—the one the LM deems most "natural."
The authors also utilize unsupervised domain adaptation, fine-tuning LMs on raw, in-domain text to improve performance on specialized vocabularies, such as those found in receipts or legal documents.
Experimental Evaluation
The method was tested on two distinct datasets:
- RETAS: 20 English books with 100 OCR views, representing a literary domain.
- ICDAR 2019 (SROIE): 625 scanned receipts, which are challenging due to complex layouts and heavy reliance on numerical data.
Key Results and Insights
The system achieved significant Word Error Rate (WER) reductions: an 8% improvement on RETAS and a 15% improvement on the more difficult ICDAR dataset.
The Role of Domain Adaptation
General-purpose LMs often struggle with the symbolic nature of receipts. Fine-tuning on domain-specific text proved crucial, especially for numerical accuracy. On the ICDAR dataset, standard GPT-2 improved numeric accuracy by only 2%, whereas the domain-adapted version saw a 13% jump. As shown in the performance data, larger models like GPT-2 XL generally provide better reconciliation across both numeric and non-numeric categories.
The Power of Diversity
The core assumption is that different OCR engines make independent errors; if one engine fails on a specific font or character, another may succeed. However, simply merging views is insufficient; the LM's role as a "referee" is essential, as random merging often performs worse than the best single OCR engine.
Limitations and Future Work
The current approach uses auto-regressive models (GPT-2), meaning an early error can propagate through the sequence. Future work may explore bidirectional models like BERT for greater robustness. Additionally, the method's effectiveness is capped by the quality of the input views; if all OCR engines fail on a segment, the "referee" cannot produce a correct result. The authors suggest investigating methods to generate "synthetic" diverse views to provide more options for the LM when only one OCR engine is available.
Summary updated