Scrambled text: training Language Models to correct OCR errors using synthetic data

Jonathan Bourne
9/29/2024
cs.CL

No official code found. Best implementation: JonnoB/scrambledtext (9 stars, MIT, last commit 2025-04-30). 2 more below.

Abstract

OCR errors are common in digitised historical archives significantly affecting their usability and value. Generative Language Models (LMs) have shown potential for correcting these errors using the context provided by the corrupted text and the broader socio-cultural context, a process called Context Leveraging OCR Correction (CLOCR-C). However, getting sufficient training data for fine-tuning such models can prove challenging. This paper shows that fine-tuning a language model on synthetic data using an LM and using a character level Markov corruption process can significantly improve the ability to correct OCR errors. Models trained on synthetic data reduce the character error rate by 55% and word error rate by 32% over the base LM and outperform models trained on real data. Key findings include; training on under-corrupted data is better than over-corrupted data; non-uniform character level corruption is better than uniform corruption; More tokens-per-observation outperforms more observations for a fixed token budget. The outputs for this paper are a set of 8 heuristics for training effective CLOCR-C models, a dataset of 11,000 synthetic 19th century newspaper articles and scrambledtext a python library for creating synthetic corrupted data.

View on arXivView PDF

Code Implementations(3)

MIT

A python library for creating synthetic corrupted OCR text using a markov process

91PythonSep 23, 20241 years agoMIT
nlpocrsynthetic-data
MIT

A repo for training Language models to correct errors in OCR text

22Shell, PythonSep 21, 20241 years agoMIT
llama3llmnlpocrsynthetic-data
MIT

Can synthetic corrupted data be used to train LLM's to correct OCR text?

10PythonAug 11, 20241 years agoMIT
llmnlpsynthetic-data

Similar Papers

Cite this paper

@article{bourne2024scrambled,
  title  = {Scrambled text: training Language Models to correct OCR errors using synthetic data},
  author = {Jonathan Bourne},
  year   = {2024},
  eprint = {2409.19735},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2409.19735v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2409.19735.svg)](https://codeofpaper.com/paper/2409.19735)

Discussion