---
title: "Post-OCR Correction of Digitized Swedish Newspapers with ByT5"
description: "Löfgren and Dannélls test how well ByT5 corrects OCR errors in Swedish newspapers and whether training on literature or blackletter helps."
canonical: "https://research.elamur.ai/free/en/papers/lofgren-2024-post-ocr-correction-digitized-swedish/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/lofgren-2024-post-ocr-correction-digitized-swedish/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2024](https://md.research.elamur.ai/free/en/papers/2024/) / Post-OCR Correction of Digitized Swedish Newspapers with ByT5

# Post-OCR Correction of Digitized Swedish Newspapers with ByT5

Paper · 2024 · Viktoria Löfgren and Dana Dannélls

**Authors:** Viktoria Löfgren and Dana Dannélls · **Year:** 2024 · **Venue:** Proceedings of the 8th Joint SIGHUM Workshop on Computational Linguistics for Cultural Heritage, Social Sciences, Humanities and Literature (LaTeCH-CLfL 2024) · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

[**0** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W6966737849|W7126410232) · [Proceedings of the 8th Joint SIGHUM Workshop on Computational Linguistics for Cultural Heritage, Social Sciences, Humanities and Literature (LaTeCH-CLfL 2024)](https://aclanthology.org/volumes/2024.latechclfl-1/) · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2024.latechclfl-1.23/)
- [PDF](https://aclanthology.org/2024.latechclfl-1.23.pdf)
- [DOI 10.18653/v1/2024.latechclfl-1.23](https://doi.org/10.18653/v1/2024.latechclfl-1.23)
- [OpenAlex](https://openalex.org/W7126410232)

Citations: OpenAlex, 2026-10-14.

## Summary

A digitized newspaper can be easy to view and hard to search. The page image preserves the printed text, while optical character recognition, or OCR, supplies the text a search system can use. Faded print, stains and ink showing through the page can all leave mistakes in that transcription. In Swedish historical newspapers, the resulting text also contains words whose unfamiliar forms come from the original printing. A correction system therefore has to recover what the newspaper said while preserving spellings that belong to its period.

Löfgren and Dannélls use ByT5, a pretrained system that reads and writes text as bytes, to correct Swedish newspaper transcriptions. They train it on pairs of passages, each consisting of OCR output and a matching human transcription. Working with bytes gives ByT5 access to the details of a damaged word even when the complete word is unfamiliar. The authors compare training on newspapers alone with training that also includes Swedish literature or, separately, older texts printed in blackletter. Their evaluation uses held-out newspaper passages from material published between 1818 and 2018, with OCR output from Tesseract and Abbyy Finereader.

The best result at the character level comes from adding blackletter training material. On the full newspaper evaluation set, character error rate falls from 3.20% in the raw OCR to 2.04%, a 36% reduction. The newspaper-only version gives the best result at the word level, lowering word error rate from 13.21% to 7.17%, a 46% reduction. The literature mixture has higher overall error rates than the other corrected versions on both measures. By publication period, the gains are especially visible in the oldest newspapers, which start with the poorest OCR.

The improvement across the collection comes with a risk for individual passages. The blackletter mixture raises character error rate in 7.7% of evaluation samples, and the paper shows how a system can fix several words while introducing a fresh mistake nearby. The correction uses OCR text alone, so it has no access to the engine’s confidence about particular characters. The authors released the version that scored best on character error rate and announced plans to integrate it into Språkbanken Text’s automatic processing pipeline.

## Deep dive: Post-OCR Correction of Digitized Swedish Newspapers with ByT5

Löfgren and Dannélls test how well ByT5 corrects OCR errors in Swedish newspapers and whether training on literature or blackletter helps. · about 32 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### The image and the transcription serve different purposes

When a historical newspaper is digitized, an image lets a reader inspect the page, while a transcription lets software work with its contents. OCR produces that transcription by recognizing print in the image. The two forms of access can diverge. A person who knows where to look may be able to read a name in the scan even though it has been transcribed into a string that a search for the name will miss. Errors can also make a passage harder to read when it is presented as text and disrupt analysis that relies on the transcription. These are problems for [information retrieval and search](https://md.research.elamur.ai/free/en/topics/information-retrieval/) and for [natural language processing](https://md.research.elamur.ai/free/en/concepts/natural-language-processing/).

The authors identify several reasons why recognition is difficult on historical material. Type can fade, stains can obscure the print, and ink on another page can show through. The typography also changes across the newspaper collection. Much of the nineteenth-century material is printed in blackletter, a family of typefaces associated in the paper with poorer recognition and different kinds of mistakes from those in modern type. Some pages are difficult because of what has happened to the paper, others because of the printing itself. A text correction stage receives the transcribed result of those difficulties.

Spelling introduces a separate problem. The authors point to the Swedish spelling reforms of 1889 and 1906 to explain why their newspaper collection contains historical and modern forms side by side. A printed `hvad` and a printed `vad` can each be faithfully transcribed. The same applies to `qvarn` and `kvarn`. If a correction system replaces an old spelling with a familiar current spelling, it can produce a readable word while departing from the source. That distinction matters because the newspapers document changes in language as well as reporting events. Where the transcription is used to study spelling, the form on the page is part of the evidence for [historical linguistics and language change](https://md.research.elamur.ai/free/en/topics/language-change/).

The task is thus to reconstruct the text represented in a human transcription of the source. Correcting OCR and normalizing historical spelling would set different targets for the same input. In a normalization task, a period spelling might deliberately be replaced with its modern counterpart. In this study it should survive whenever it is what the newspaper printed. The difference becomes practical when the system faces a rare form. Familiarity with current Swedish can help it recognize a plausible repair, but current usage alone cannot determine which string the newspaper actually used.

The authors describe the task by analogy with translation. A damaged passage is the source and its corrected transcription is the target. Both are Swedish, and many parts of the passage already match. The useful idea from translation is that the whole input can inform the output. A distorted word may be hard to interpret by itself, while the surrounding phrase can suggest which letters are missing or mistaken. Training on paired strings gives the system examples of where to preserve the source, where to alter it, and how the surrounding text bears on those decisions. The analogy concerns the input–output setup used in [machine translation](https://md.research.elamur.ai/free/en/topics/machine-translation/).

#### Earlier approaches to Swedish OCR

Previous Swedish work tackled the problem at several stages. To find and fix recognition errors in historical Swedish, Persson paired a word list with a classifier known as a support vector machine. A word list gives the procedure a way to use information about which forms are expected, while classification gives it a way to decide how to treat a candidate. This line of work places explicit error detection at the center of correction under [machine learning](https://md.research.elamur.ai/free/en/concepts/machine-learning/).

Dannélls and colleagues pursued a different source of evidence by combining the outputs of separate OCR engines. One engine may recognize a passage where the other makes a mistake. Having both readings permits a procedure to exploit such disagreements. That earlier project also prepared the Swedish newspaper reference material used here. Löfgren and Dannélls retain both readings in their dataset, but present each reading to ByT5 on its own. The earlier combination procedure and the new correction procedure therefore use the paired engine outputs in different ways.

Lundberg and Torstensson used the same reference material to investigate an LSTM trained from scratch. An LSTM is a recurrent neural network designed to carry information across positions in a sequence. Their study found the available reference material too small for satisfactory results with that approach. For Löfgren and Dannélls, that history makes the starting point of training consequential. A system that begins with knowledge acquired from other text can use the aligned newspaper examples to specialize in OCR correction, whereas a system trained from scratch has to acquire its text-processing behavior from the task data.

The paper also discusses work that combined convolutional and recurrent components. Drobac and Lindén applied deep CNN–LSTM networks to historical newspapers in Finnish and Swedish and reported strong results in both languages. Brandt Skelbye and Dannélls used a related hybrid approach to improve character recognition within the Swedish OCR engine. The present study operates downstream of the engine. A method that changes the recognition stage acts while the page is being read. A text-only correction method acts on a transcription that could already be stored in an archive. The authors treat the results of the engine-level study as a separate kind of evidence because of this difference.

#### Why use a pretrained byte-level system?

The authors situate their work alongside neural translation approaches to OCR correction in other languages. The winning approach in the 2019 ICDAR post-correction competition had been trained on European languages that did not include Swedish. The paper also discusses work on Icelandic and English, as well as a Finnish study that considered both correcting OCR and normalizing spelling. These examples establish the wider setting for the Swedish experiment. They supply reasons to try the approach, while the Swedish newspaper pairs supply the evidence needed to evaluate it on Swedish material. [An Unsupervised Method for OCR Post-Correction and Spelling Normalisation for Finnish](https://md.research.elamur.ai/free/en/papers/duong-2021-unsupervised-method-ocr-post-correction/)

The challenge highlighted in the paper’s survey of previous research is that neural correction can require substantial training data. A historical collection may have a great deal of machine-transcribed text, yet only the portions checked against human transcriptions can directly teach the system the desired corrections. A mistaken OCR string by itself leaves open what was printed. The valuable examples are the ones with a trustworthy corresponding passage. At the same time, the cited work on large pretrained systems suggested that the correction task could benefit from training already performed on general text. The architecture underlying this approach is the [Transformer](https://md.research.elamur.ai/free/en/concepts/transformer/), introduced in [Attention Is All You Need](https://md.research.elamur.ai/free/en/papers/vaswani-2017-attention-all-need/).

A second reason to choose ByT5 has to do with how a system represents unfamiliar strings. Word-level processing assigns an identifier to a whole word. In the fixed-vocabulary example discussed by the authors, an unknown word receives a generic marker. That can hide the difference between a rare historical spelling and a familiar word damaged by OCR. The paper illustrates the issue with the distorted newspaper name `HandelstidniDgens` and the old spelling `hvalfisken`. Even when neither complete form is familiar to the system, the surviving letters carry information about what it is reading. The choice of units is a question of [tokenization](https://md.research.elamur.ai/free/en/concepts/tokenization/).

Breaking a word into smaller pieces can preserve more structure than assigning it a single unknown-word marker. The paper illustrates this intermediate option with sub-words, then contrasts both approaches with processing individual letters or bytes. ByT5 works at the byte level. It receives the encoded details of the input regardless of whether a word appears in any dictionary. A string affected by poor recognition still arrives with its distinctive sequence of bytes, so a correction can use the parts that survived. This is particularly pertinent when the difference between an error and a valid historical form rests on a small part of the word. [Subword tokenization](https://md.research.elamur.ai/free/en/concepts/subword-tokenization/)

The paper points to earlier successes with byte-level processing on tasks where details inside words matter, including transliteration, predicting pronunciation from spellings, restoring diacritics, and correcting OCR in Sanskrit. Those precedents give the design a rationale. They do not supply Swedish training pairs or identify which historical Swedish spellings to retain. The question for this study was whether a pretrained byte-level system could learn to perform that correction from aligned Swedish data, and whether adding examples from related collections would help. The broader approach draws on [language models and pretraining](https://md.research.elamur.ai/free/en/topics/language-models/).

### The method, step by step

#### From OCR output to a proposed transcription

The method starts after a recognition engine has read a page. Its working input is a passage of OCR text. During training, the passage comes with a human transcription of the corresponding print. ByT5 learns to emit the reference text from the OCR input. When the trained system is given an evaluation passage, it sees the OCR reading and generates a proposed correction. The reference remains available for scoring. The same pair of texts thus plays different roles during training and evaluation. In training it supplies the desired output, and in evaluation it supplies an independent standard for judging the output.

This setup allows the system to handle more than a substitution at a marked position. It generates the corrected sequence from the input sequence, which means it can preserve an intact phrase, replace a damaged form, restore missing text within a passage, or remove spurious characters. That flexibility is also a reason to prepare the pairs carefully. If the human transcription contains a line that the OCR input never included, the pair may appear to teach the system to insert text when the real cause is that the passages cover different material. The supervised task therefore depends on establishing which pieces correspond before asking ByT5 to learn from them.

Training and evaluating Swedish newspaper OCR correction The steps in order.

#### The source material and its intended role

The main collection draws on a portion of the newspapers digitized by the National Library of Sweden that was transcribed by hand. The underlying collection comprises nearly 44,000 text segments identified through layout analysis on 400 pages. Layout analysis divides the page into regions of text before the subsequent preparation of training pairs. The pages span 1818–2018. Each original segment has a Tesseract reading and an Abbyy Finereader reading, and the reference gives the researchers a way to assess the two machine readings against the print.

Having both engine outputs broadens the material available for learning. Two attempts to read the same passage can preserve different details or make different mistakes, while the target transcription stays the same. It also creates a dependency between records. Where both outputs survive preparation, the examples are alternative readings of the same underlying text. A split that assigned those alternatives independently could put a passage into training through one engine and expose it again in evaluation through the other. The paper takes steps to keep those alternatives together.

The literature collection consists of 79 titles from the Swedish Literature Bank. The paper dates it to 1836–2001 and describes its size as about 7.3M characters. It covers much of the time span of the newspaper collection and offers training material from Swedish writing of related periods. Its print and layout generally yield better OCR, which the authors suggest could reflect better print quality and simpler pages. From a training perspective, the collection offers a way to broaden the range of Swedish writing seen during specialization while introducing a different balance of correct and damaged text.

The blackletter collection joins Swedish fraktur, dated 1626–1816, with Then swänska Argus, dated 1732–1734. Swedish fraktur contains material from 199 pages in Gothenburg University Library’s collections. The second source comprises 25 issues of Olof von Dalin’s periodical. Both come with ground truth, meaning that a reference reading is available for the OCR text. These materials give the authors examples of recognition errors on blackletter printing from outside the newspaper collection. They are older than the newspaper material the system is ultimately evaluated on.

The supplemental sources address different needs. The literature mixture was intended to give the system more examples of nineteenth- and early twentieth-century Swedish from a broadly overlapping period. The blackletter mixture was intended to supply examples of the OCR mistakes associated with typefaces also found in older newspapers. A book can be close to a newspaper in date while presenting a different recognition problem. An older blackletter text can be distant in date while containing relevant examples of how print is misread. The experiments compare these two ways of selecting useful supplementary material.

#### Putting the corresponding lines together

The authors first align the OCR text and the reference line by line using an adaptation of Myers’ difference algorithm. In ordinary text comparison, two lines can be treated as matching when their contents are identical. Here such a test would overlook precisely the lines useful for training, since a correct correspondence can contain recognition errors. The adapted comparison accepts lines as a match when their character error rate, or CER, is low enough. CER measures the amount of character editing needed to make a candidate text agree with a reference relative to the reference length. The authors choose the matching threshold manually for each dataset.

The distinction between correspondence and exact agreement is central to this step. A line can contain a mistaken letter and still be the OCR reading of the line in the reference. An alignment procedure needs to recognize that relationship before the pair can teach a repair. At the same time, matching is meant to protect against pairing unrelated text, which might encourage arbitrary additions and deletions. The allowed amount of disagreement is therefore part of the procedure for constructing reliable examples. The resulting alignment identifies material represented in both readings, with differences left in place for the training task.

The authors then use line breaks to divide the aligned texts into short passages, typically 1-2 lines. The input and reference must cover the same passage. This keeps the training objective focused on recognizable edits within a small amount of local context. The preparation also means the system learns from pieces of newspaper text rather than complete pages in their original layout. A piece can include neighboring words that aid a repair, but any continuation beyond the piece is outside the current input.

The paper applies another check after alignment and segmentation. Both sides of a pair must have at least four characters, and the pair’s CER must be below 50%. A reference that includes `@` is excluded because the transcriptions use that symbol to mark illegible text. These conditions serve different purposes. The length rule removes very short pieces, the CER rule removes pairs with too much disagreement, and the marker rule removes passages for which the human transcription signals an unresolved reading. They determine which prepared examples are admitted to training and, for the newspaper data, to evaluation.

The line matching threshold and the sample filter are distinct decisions. The first is tuned by dataset so the alignment procedure can identify corresponding lines. The second applies a stated eligibility criterion to the resulting passage pair. A low disagreement score can support a proposed correspondence without implying that the resulting example is error-free. Training depends on retaining disagreement inside valid pairs. Otherwise the dataset would mostly teach the system to reproduce what the OCR engine had already recognized.

#### Reserving passages for evaluation

The authors randomly assign the prepared newspaper examples to train (70%), test (15%), and evaluation (15%) splits. The two OCR versions of the same newspaper sample are assigned to the same split. This protects the evaluation specifically against seeing the other engine’s rendering of the same material in training. It still allows the correction procedure to confront text produced by either engine. The paper reports 125,637 newspaper training examples, 26,456 newspaper test examples, and 26,960 newspaper evaluation examples after preparation.

The literature and blackletter collections each use train (85%) and test (15%) splits. Literature supplies 63,867 training examples and 11,271 test examples, and blackletter supplies 4,881 training examples and 861 test examples. Neither supplemental collection contributes examples to the final newspaper evaluation. That design keeps the evaluation target constant when the training mixture changes. A version that sees literature or blackletter during training still has to show its value on newspaper passages.

The sample counts describe the prepared datasets, whereas the nearly 44,000 newspaper segments describe the material identified by layout analysis before this preparation. A layout segment and a short aligned passage are different units. A layout segment can provide several usable passages, and the two OCR engines supply separate readings. The sample counts give the scale of what the systems train and evaluate on. The page and layout counts describe where those examples originated.

The authors report results for the set specifically designated for evaluation. Their dataset breakdown also names a separate test split. Keeping those names distinct matters when reading the reported numbers. The error rates in the results describe the 26,960 newspaper evaluation samples. The other split counts describe the construction of the datasets and do not enlarge the evaluation behind those figures.

#### What ByT5 receives and what training changes

All the variants begin with `byt5-small`, the smallest version of ByT5 discussed in the paper. Its pretraining used mC4, a large multilingual web collection. The Swedish OCR training is a second stage in which the already pretrained system learns to turn a particular kind of input into a particular kind of output. The distinction matters because pretraining can provide familiarity with Swedish and with text structure, while paired newspaper passages show what the corresponding clear and damaged versions look like. The paper identifies mC4 through the work on [mT5](https://md.research.elamur.ai/free/en/papers/xue-2021-mt5-massively-multilingual-pre-trained/). The task-specific training is [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/).

A byte is a unit of the encoding that represents the characters in a digital string. ByT5 uses UTF-8, in which a character can occupy more than a single byte. In Swedish, `å`, `ä` and `ö` are examples the authors identify as requiring multiple bytes. Calling ByT5 character-level describes its ability to process text below the word or sub-word level. Its actual input and output units are bytes. This matters when translating a length limit into the amount of Swedish text that can be handled in a single example.

The maximum input length and maximum output length are both 128 UTF-8 bytes. The same byte budget can fit different amounts of visible text depending on which characters occur. A fragment with accented Swedish letters uses the budget faster than a fragment in which the characters each occupy a single byte. The limit keeps an individual sequence short, which fits the earlier choice to construct samples from aligned lines. It also gives a precise meaning to the context available at a generation step. The system can use the passage represented within that budget.

The authors access `byt5-small` and carry out training using the Trainer interface from Hugging Face’s Transformers library. They fine-tune for three epochs, where an epoch is a pass over the training set. They use the Adafactor optimizer, which updates the trainable parameters, at a constant learning rate of 0.001. The learning rate controls the scale of the updates during training. The paper describes this setup as following the approach taken in earlier fine-tuning work on ByT5 and T5. [Transformers: State-of-the-Art Natural Language Processing](https://md.research.elamur.ai/free/en/papers/wolf-2020-transformers-state-art-natural-language/), [Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer](https://md.research.elamur.ai/free/en/papers/raffel-2019-exploring-limits-transfer-learning-unified/)

The batch size is 32 examples. With the stated length limit, the paper expresses the batch budget as follows.

```
128 · 32 = 2¹²
```

The value `128` is the maximum number of UTF-8 bytes in a sequence, and `32` is the number of examples in a batch. The centered dot denotes multiplication and the equals sign gives the resulting budget in byte tokens. The right side expresses that budget as a power of `2`, with the superscript `¹²` giving the exponent. The calculation uses the configured maximum length, so it describes a batch in terms of its byte capacity. The passages themselves are short strings of varying lengths.

The common starting point and training settings let the authors focus the comparison on the data supplied during fine-tuning. Model 1 sees only the newspaper training material, described in the training discussion as 126,000 samples. Model 2 sees newspapers and literature, described together as 190,000 training samples. Model 3 sees newspapers and blackletter, described together as 131,000 training samples. The mixed training sets retain the newspaper examples. The added material changes the volume of training as well as the kinds of examples available. Both aspects matter when interpreting the comparison.

#### Producing a correction

During evaluation, each version receives the same prepared newspaper inputs. It produces a candidate transcription by greedy decoding. At each step, the system chooses the byte token with the highest probability given the input and the output it has produced so far. It then proceeds from that choice. The procedure constructs a correction one step at a time. An early choice can influence later choices because the partial output becomes part of what the next prediction depends on.

The decoding rule has a concrete implication for this task. A locally plausible repair can lead to a plausible-looking word that differs from the one in the newspaper. A sequence constructed by selecting the most probable token at every step is also a different objective from minimizing the edit distance to the unknown human transcription. The experiment evaluates the complete generated passage against that transcription after decoding. The authors use the Python library `jiwer` to calculate the character and word error rates. The paper names the correction release and makes a demonstration available for trying the system on OCR text.

### Experiments and results

#### The baseline and the measures

The baseline is the text supplied by the OCR engines before post-correction. The experiment asks how far that text is from the human reference and how that distance changes when each ByT5 variant is applied. Because the same newspaper evaluation material is used throughout, the comparison puts the unchanged OCR and the generated corrections against a common target. The raw OCR is a relevant baseline for an archive deciding whether a correction stage improves its existing text. The comparison with previously published systems plays a different role in the paper’s discussion.

Character error rate measures the amount of editing required at the character level. Substitutions change a character, deletions remove one, and insertions supply one that is missing. A correction can improve this measure by restoring part of a damaged word while leaving the word different from the reference. Word error rate, or WER, applies the same idea using words as the units. An incorrect word can count as a word substitution even if many of its letters are right. Both measures use the reference as the basis for expressing the edit count as a rate.

Using both measures gives the results two distinct interpretations. CER captures how closely the output matches the surface form of the printed text at a fine scale. WER captures how frequently the sequence of whole words needs repair. If a system makes several changes that bring damaged words closer to the reference without completing them, much of that progress can show up in CER. A system that fully recovers more words can rank better on WER despite leaving more erroneous characters elsewhere. These are scoring possibilities, and the overall results show that the choice between the two measures changes which variant ranks highest.

The evaluation covers newspaper material over 1818–2018 and uses 26,960 prepared passages. They have been aligned and filtered in the same manner as the training passages. The period comparisons give a view across newspaper eras within that evaluation. The supplemental sets contribute no evaluation passages. The resulting figures measure the value of each training choice for newspaper correction, including the value of transferring training examples drawn from other kinds of print.

#### Overall newspaper performance

All the corrected versions improve on raw OCR in both metrics across the full evaluation set. On CER, the version trained on newspapers and blackletter has the lowest rate, 2.04%. Its comparison point is the full-set raw OCR CER of 3.20%, and the paper reports a 36% relative reduction. The newspaper-only version follows at 2.06%, and the version trained with literature records 2.20%. The three values are close enough that the difference between introducing post-correction and choosing a particular training mixture deserves separate attention.

Character error rate across the full newspaper evaluation set All correction variants improve on raw OCR, with newspapers and blackletter giving the lowest character error rate.

**The numbers**

| System or setting | CER % |
| --- | --- |
| Raw OCR | 3.20 |
| Newspapers only | 2.06 |
| Newspapers and literature | 2.20 |
| Newspapers and blackletter (this paper) | 2.04 |

For WER, the newspaper-only version leads at 7.17%, compared with 13.21% for raw OCR. The authors report this as a 46% relative reduction. Newspapers with blackletter give 7.23%, and newspapers with literature give 7.42%. The version released by the authors is the character-error winner. Someone reading the results for a task concerned primarily with complete words should also see the overall ranking on WER, which favors training on the target collection alone.

Word error rate across the full newspaper evaluation set All correction variants improve on raw OCR, with newspapers alone giving the lowest word error rate.

**The numbers**

| System or setting | WER % |
| --- | --- |
| Raw OCR | 13.21 |
| Newspapers only (this paper) | 7.17 |
| Newspapers and literature | 7.42 |
| Newspapers and blackletter | 7.23 |

The authors describe the Swedish correction results as comparable to those reported for historical Icelandic with the larger `byt5-base`. They take the comparison as an indication that `byt5-small` can be adequate for this task. The figures directly measured in the Swedish experiment are the before-and-after comparison and the rankings among the Swedish training mixtures. The Icelandic study gives context for the scale of the result across related tasks. The Swedish evaluation does not include a run of the larger version on the same passages.

#### How performance changes across publication periods

The oldest evaluation period, 1818–1859, starts with a CER of 8.39% and a WER of 32.46% for the raw OCR. With blackletter training, CER reaches 4.30%, the best corrected character result for that period. Training on newspapers alone produces its best word result at 15.34%. The two measures therefore favor different mixtures in the oldest material as well as in the overall evaluation. Residual errors remain substantial in this period even after the largest visible gains. The collection starts from a much harder OCR problem there.

In 1860–1899, raw OCR has a CER of 4.04% and a WER of 16.51%. The newspaper-only version leads on both measures in this band, with a CER of 2.29% and a WER of 8.06%. The blackletter mixture also improves on raw OCR, reaching 2.38% CER and 8.22% WER. The outcome distinguishes overall performance on the oldest newspaper subset from a general rule about all nineteenth-century material. Including blackletter is associated with the best character result in the earliest band, while the next band favors the target-domain-only training.

For 1900–1939, raw OCR begins at 2.60% CER and 11.24% WER. The blackletter mixture reaches 1.92% CER and 6.99% WER, the lowest values among the corrected versions for that period. It also leads on both measures in 1940–1979, at 1.29% CER and 4.39% WER, against raw OCR rates of 1.46% and 6.45% respectively. The blackletter mixture’s good results therefore extend beyond the periods that motivated the addition. The period figures establish where it scored well. They do not identify which training examples were responsible for those corrections.

The 1940–1979 band also contains an exception to the general pattern of lower character error after correction. The literature mixture records 1.49% CER, above the raw OCR’s 1.46% for the same passages. On WER it improves to 4.54% from the raw 6.45%. Those scores are compatible because the number of characters at issue and the number of words at issue can move differently across a set of corrections. The published totals describe those movements. A more detailed account of which words were repaired and which character errors remained would require an analysis beyond the two rates.

In the 1980–2018 band, raw OCR has the lowest starting error rates of any period, at 0.83% CER and 3.74% WER. Newspaper-only training produces the best CER at 0.67%. All the corrected versions reach 2.67% WER at the displayed precision. This band has a different starting point from the oldest pages. The raw OCR already preserves much more of the reference, leaving fewer recognition errors to remove and more recognized text to carry through the correction unchanged.

Across the period breakdown, the early newspaper results show that the system remains useful on material whose typography and spelling differ from much of the text it might have encountered during pretraining. The authors suggest that error patterns in older material could be more predictable, which would make them easier to learn from paired examples. The experiment measures improvements by publication period. It does not measure the predictability of the errors or quantify the amount of historical Swedish in pretraining. Those are possible explanations for the pattern of scores.

#### What happens within a passage

The paper illustrates the correction behavior using a newspaper fragment about the king’s recovery. One OCR form appears as `ko»unqen«`. The blackletter-trained version recovers the recognizable form `Konungens`, while the other variants produce different forms. The human transcription uses `konungens` with a lower-case initial, so the character-level comparison still has a difference to count. This example shows how a substantial repair of a damaged word and a remaining character error can coexist.

The same fragment includes `alk`, for which the intended form is `att`. The newspaper-only and literature variants restore `att`, while the blackletter variant outputs `all`. Elsewhere in the passage, the OCR has `sä` in a position where the reference reads `så`. The newspaper-only variant generates `få`, a different Swedish word. The example gives concrete cases of complementary behavior among the training variants. A system that is strongest on one damaged word can leave a different word wrong, and a replacement that looks like ordinary Swedish can still be a poor transcription of this passage.

The discussion also reports a collection-level measure of such regressions. The blackletter mixture increases CER in 7.7% of the evaluation samples. This statistic counts passages that are farther from their reference after correction than before. The overall CER of 2.04% instead measures the remaining character error across the full evaluation set. Together, the figures show that the total improvement includes individual passages that move in the opposite direction. The fraction of worsened passages and the error rate over the whole set answer different questions about how the correction behaves.

### What the ablations show

#### Changing the training mixture

The paper’s controlled comparison changes the composition of the fine-tuning data while keeping the ByT5 starting point, the principal training settings and the newspaper evaluation fixed. In that sense the study tests the contribution of adding out-of-domain data. The newspaper-only result provides a strong basis for the comparison because each mixed version also receives newspaper training. The experiment asks what happens when the authors supplement it with one of two collections selected for different reasons.

Adding literature yields a system that improves overall on uncorrected OCR but trails the newspaper-only version on both aggregate metrics. It also trails the blackletter mixture on both. The literature samples provide relatively clean OCR and Swedish prose from periods that overlap the newspaper collection. Their addition tests whether broader linguistic exposure during fine-tuning gives better newspaper corrections. In the mixture used here, that broader exposure does not translate into stronger overall newspaper scores. In the period results there are individual settings where its character score is competitive, so the aggregate result describes the mixture’s overall effect.

Adding blackletter yields the lowest full-set CER and the lowest CER in the earliest period. Those observations are consistent with the initial rationale that historical blackletter material could provide more examples of relevant recognition mistakes. The newspaper-only version nonetheless leads on overall WER and on WER in the earliest period. The mixture therefore supports a narrower conclusion than a uniform improvement of OCR correction. It helps the best observed character score under the tested setup, while the stronger word score comes from the training data specific to newspapers.

The comparison also makes clear why a result about CER is worth stating separately from a result about WER. With byte-level generation, the output can recover a meaningful portion of a damaged form while leaving a character or capitalization error. It can also improve a whole word in one place while adding character mistakes elsewhere. The newspaper fragment supplies examples of such partial and uneven repairs. The study does not attribute the aggregate difference between CER and WER to a measured frequency of these behaviors. It shows that the overall choice of mixture depends on which unit is scored.

#### What changes along with the source

The mixtures vary in size as well as composition. The literature source contributes 63,867 training examples, while blackletter contributes 4,881. With the same number of epochs, the versions process different amounts of data over their training runs. The additions also differ in typical OCR quality and in the kinds of source text they represent. The study establishes the effect of the mixtures as assembled. A causal claim about typography alone would require separating typography from those other properties.

The literature result is particularly helpful for understanding this distinction. Its time range makes it a plausible source of additional examples of Swedish from periods relevant to the newspapers. Its OCR, however, is generally much cleaner. A training pair with few recognition errors gives a different learning signal from one with several damaged forms. The authors suggest that the larger out-of-domain component may help explain why the literature mixture tends to score slightly worse. That remains an interpretation of the observed comparison. The experiment does not isolate the balance between clean and difficult examples, or the amount of literature a different mixture might use.

The opposite issue applies to the blackletter sample. It is smaller and contains material from a different time range, yet its OCR problems may be relevant to old newspapers. The best CER is consistent with some transfer of useful corrections. The bands in which the blackletter system leads also include twentieth-century newspapers. A period is a grouping by publication date and can bring together multiple differences in text, printing and recognition quality. The improvement on a period can therefore be established from the reported scores without assigning all of it to a specific printing style.

The authors inspected outputs and did not identify a clear general difference in the quality of the corrections among the variants. Their worked example illustrates why such differences can be hard to see passage by passage. On the word referring to the king, the blackletter variant is visibly closer to the transcription. On the infinitive marker, the newspaper-only and literature variants produce the expected form. The example is an inspection of possible outcomes, and the full-set error scores establish the rankings. Neither provides a frequency breakdown of the particular repair types responsible for those rankings.

#### What the other comparisons can establish

Grouping the evaluation by period tests whether the full-set improvement conceals weak performance on older material. The oldest band has a high starting rate and supports substantial improvement on both measures. The newest band has relatively low raw OCR error and still sees gains. The authors’ suggestion that older recognition mistakes could be more regular is compatible with the observed results. Treating regularity as an explanation would require a way to identify recurring error patterns and compare their prevalence or correction rates across groups.

The study keeps byte representation, pretraining and greedy decoding fixed. There is no separate experiment that changes the unit of representation while holding the training pairs constant, starts the same architecture without pretraining, or compares greedy decoding with another search strategy. Earlier work gives reasons to believe these choices are sensible. The measured comparison establishes how the complete procedure performs with each training mixture. The paper’s suggestion that another decoding strategy could improve the outputs is a hypothesis motivated by the errors the authors observe.

A further distinction emerges from the two aggregate views of performance. The reductions in CER and WER indicate that the procedure recovers considerable text from the OCR. The percentage of deteriorating passages indicates that occasional harmful edits remain a feature of the released version. The paper uses the passage example to inspect that behavior and the 7.7% result to establish that it occurs beyond the example. These analyses identify where the method succeeds and where it needs closer examination, while leaving the causes of individual new errors open.

### Limitations

#### Limits the authors state

The authors emphasize that the procedure receives only the text output by an OCR engine. It can therefore accept text without relying on an engine-specific format. That flexibility comes at a cost. Some OCR outputs can include confidence scores describing how certain the engine was about a recognized character. A correction system receiving only the string cannot use such a score to distinguish a doubtful reading from a character the engine recognized confidently. It must decide from the text itself where to intervene.

This matters where a plausible correction differs from text that was already correct. Surrounding words may make a replacement seem likely without resolving what the page actually contains. Confidence information could offer additional evidence at that point. The input design gives ByT5 access to the character sequence and the context within the passage, while the engine’s evidence for a particular reading remains outside that input. The authors identify the lack of confidence metadata as a limit of the text-only approach. The study does not measure how large an improvement confidence information would bring.

The authors also call attention to the new errors introduced by correction. Their best CER version makes 7.7% of newspaper evaluation samples worse on that measure. They raise the possibility of trying a different decoding strategy and describe plans to use context to reduce unwanted changes. They also propose further evaluation of the types of errors the system makes, especially on newly digitized resources. These are stated directions for future work. The published measurements concern greedy decoding and the newspaper evaluation as described.

#### Limits visible in the experimental setup

The reported accuracy applies to passages that could be aligned with a human transcription and pass the filters. Samples with CER at or above the limit, references marked as illegible, and very short pairs fall outside that evaluation. A collection-wide run on raw newspaper OCR could encounter all those cases. The reported rates answer how well correction works on the prepared, eligible passages. The setup leaves open how it would perform on the most damaged passages or on material for which the printed reading is uncertain.

The procedure also operates within a short passage and a fixed byte budget. A difficult reading may depend on context elsewhere in an article, such as a repeated name or the continuation of a sentence in another region of the page. This evaluation cannot determine what the system would recover with that extra context. It also evaluates post-correction after layout analysis. Recovering text regions omitted by layout processing or reconstructing a newspaper page’s reading order falls outside what these scores measure. The direct evidence is agreement between textual passages and their matching references.

The split protects against an obvious source of leakage by keeping corresponding OCR outputs from the two engines together. The paper describes random assignment of samples rather than a separate holdout of whole newspaper titles or publication periods. As a consequence, the scores characterize correction within the sampled collection. They leave open performance on an unseen title, a different archive, or a historical period held out in its entirety. The use of two engines broadens the origins of the OCR inputs, while the reported overall and period scores do not show the size of the improvement for each engine separately.

The supplemental data are evaluated through their effect on newspapers. That design supports an answer about newspaper correction, including the value of blackletter data for that goal. It does not establish accuracy on the Swedish Literature Bank titles or the older blackletter collections themselves. It also leaves open whether other additions, or a different balance among the tested sources, would improve newspaper results. The paper compares the assembled mixtures, and the small gaps between some variants are reported as observed differences without uncertainty estimates that would establish how stable their order is across repeated runs.

The error rates assess fidelity to the references at the character and word levels. Improved fidelity is relevant to reading, search and analysis, which motivate the work, but the experiments do not directly measure those downstream outcomes. A missed name can matter to a search even when the surrounding article scores well, while a minor character error can contribute to CER without preventing a reader from understanding the passage. A separate task evaluation would be needed to quantify those consequences. The paper shows how post-correction changes transcription accuracy and supplies an example of the kinds of errors that can remain.

The comparisons with earlier systems also have a limit. The strongest direct baseline is the original OCR for the same passages. Earlier Swedish work includes an intervention inside the OCR engine, and the cited Icelandic work operates on a different language with a larger ByT5 variant. These comparisons help place the result in its research setting. They do not give a ranking of all approaches on the same Swedish newspaper benchmark. The experiment’s strongest quantitative claim is the improvement over the uncorrected newspaper text in the held-out evaluation.

### What came after

The documented follow-through is the release of the blackletter-trained version and a demonstration for trying the correction. Its selection follows the study’s priority on character error rate. The paper also describes planned integration into Språkbanken Text’s automatic processing pipeline. Integration is presented as a future step. The evaluation in the paper concerns held-out newspaper passages rather than the results of running the released correction throughout that pipeline.

The authors’ research plans follow from the difference between improving the collection overall and protecting individual passages. They want to investigate the use of context to curb new errors and to study the correction errors that emerge on newly digitized material. The proposed investigations would extend the paper’s measurements from aggregate accuracy toward the circumstances in which a particular edit should be trusted. No subsequent study is documented here as having tested those proposals or built on the release.

## Cite

Cite as Viktoria Löfgren and Dana Dannélls. 2024. Post-OCR Correction of Digitized Swedish Newspapers with ByT5. Proceedings of the 8th Joint SIGHUM Workshop on Computational Linguistics for Cultural Heritage, Social Sciences, Humanities and Literature (LaTeCH-CLfL 2024).

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.18653/v1/2024.latechclfl-1.23](https://doi.org/10.18653/v1/2024.latechclfl-1.23)

```bibtex
@inproceedings{lofgren2024post,
  title = {{Post-OCR Correction of Digitized Swedish Newspapers with ByT5}},
  author = {Viktoria Löfgren and Dana Dannélls},
  booktitle = {Proceedings of the 8th Joint SIGHUM Workshop on Computational Linguistics for Cultural Heritage, Social Sciences, Humanities and Literature (LaTeCH-CLfL 2024)},
  year = {2024},
  doi = {10.18653/v1/2024.latechclfl-1.23},
  url = {https://doi.org/10.18653/v1/2024.latechclfl-1.23}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
