By Janna Katharina Müller
In my last blog post, I wrote about the source corpus for my master’s thesis – the journal “Monatliche Correspondenz zur Beförderung der Erd- und Himmelskunde” (MC) – and my plan to subject it to digital analysis. The main thing I needed for my analysis was a digital text. Thanks to the Thuringian University and State Library in Jena, the scanned originals of the MC are available online, but only as non-machine-readable PDF files. The first step towards usable data was thus to generate a text from image files.
However, it was essential to consider the type of writing used in the MC: As can be seen from the example page below, the MC was printed in a font that uses, among other things, the long s (“ſ”), an archaic form of the lower-case letter s. Unlike most German publications of the early 19th century, however, this is not a fractional font such as Fraktur, but rather an Antiqua font with serifs, which contains rounded arcs and was used primarily for Latin, Italian, and French texts, but was rather uncommon in German prints.
OCR with Tesseract
One of the best-known ways to recognize text is Optical Character Recognition (OCR), the electronic or mechanical conversion of images into machine-coded text based on the recognition of individual characters. One software that uses OCR is Tesseract. This is available free of charge and an open-source program. Tesseract needs language add-ons for text recognition, in my case for German. Here, I already encountered the first difficulties: The module for German text recognition “deu” is mainly intended for modern printing. However, as described above, my source is an older print. Therefore, I attempted text recognition with the additional module “deu” as well as “deu_frak” (for German Fraktur fonts).
If you are familiar with the use of the command line and have installed Tesseract, a simple short command is sufficient for transcription:
tesseract example_page.tif output_page.txt -l deu
Tesseract now provides the following text of my sample page using the German add-on:
556 Monatl. Correfp. 1801. $VNIVS.
die Glaskugel hätte machen können. Es [cheintauch,
dafs man leichter zwey Stahlcylinder einander voll-
kommen gleich wird machen köunen, als man zwey
Glaskugeln gleich grofs und gleich dick blafen kann:
fo dafs man allo bey Stahlcylindern leichter zwey voll-
kommen vergleichbare Thermometer wird erhalten
können,
XLIV.
Über die
beym April-Hefte’ befindliche
Perfifche Karte.
(Befchlufs zu S. sız des III B.)
Mau hat mir den Vorwurf machen’ wollen, dals
ich die Anpreifungen und Empfehlungen Yadley’fcher
Spiegel-Sextanten übertreibe und bis zum Ekel wie-
derhole. Aber die vielfältigen Beyfpiele, welche mir
mehr, als jedem andern bekannt werden, beweilen
mir, dals ich lie bey weiten noch nicht genug em-
pfohlen habe; ich werde allo noch lange damit fort-
fahren. Dies kann doch ‚wol niemanden Verdrufs
oder Schaden bringen ? Ich habe erfahren, dafs [eit-
dem diefes nicht genug zu lobende Inftrument, durch
gegenwärtige Zeitfchrift, auch unter Laien, oder tın-
ter f[olchen Gelehrten bekannter geworden ift, deren
Beruf es nicht mit fich (bringt , aftronomifche Werke
zu lefen, der Gebrauch diefes nützlichen Werkzen-
ges
As you can see, this text is already quite readable, although full of errors. The long s “ſ” is not recognized as such, but transcribed as “f”, “l” or even “[“. There were also problems with the recognition of the word “JUNIUS” in italic capital letters, and the translation of “ſs” as “ß”.
Therefore, here is another try with the Fraktur module:
556 Umsatz«- coyrejp MU. FPNIZS
die Glaskugel hätte machen können. Es scheint auch,
dass man leichter zwey stahlcylinder einander voll-
kommen gleich wird machen können . als man zwey
Glaskugeln gleich gross und gleich dick blasen kann-
so dass man also bey stahlcylindern leichter zwey voll-
kommen vergleichbare Thermometer wird erhalten
können.
XLIV.
Über die
bcym April—Hefte’besindliche
Perlische Karte.
(Beschluss zu s. 513 des lll B.)
Man hat mir den Vorwurf machen· wollen« das-
ich die Anpreisungen und Empfehlung-en flmlzey’scher
spiegel-sextanten übertreibe und bis zum Ekel wie-
derhole. Aber die vielfältigen Beyspiele . welche mir
mehr, als jedem andern bekannt werden, beweisen
mir, dass ich sie bey weiten noch nicht genug em-
Psohlen habe; ich werde also noch lange damit fort-
fahren. Dies kann doch wol niemanden Verdruss
oder schaden bringen ? lch habe erfahren, dass seit-
dem dieses nicht genug zu lobende Instrument , durch
gegenwärtige Zeitschrift, auch unter Laien, oder lin-
ter solchen Gelehrten bekannter geworden ist, deren
Beruf es nicht mit lich bringt . astronomische Werke
tu lesen, der Gebrauch dieses nützlichen Werkzeu—
ges
Here, the “ſ” was partially recognized, but all sorts of incomprehensible things were produced. This is explained by the fact that the “deu_frak” module contains the typical long s for fractional font, but the MC was printed in a rounder, non-fractional font, similar to Antiqua scripts. Since these are unusual for the German speaking area in the early 19th century, however, I could not find a German Antiqua module and thus a suitable module for my project – so I had to look for other ways. These difficulties in applying OCR to historical prints are not particularly uncommon, and I quickly came across another option:
HTR with Transkribus
Another method that was originally closely linked to the development of OCR is Handwritten Text Recognition (HTR). It combines pattern recognition methods with artificial intelligence to produce machine-readable text. Originally developed for handwritten material, HTR can be applied just as well to printed text that, as in my case, is too complex for OCR processing.
One platform developed by the “READ” project (Recognition and Enrichment of Archival Documents) of the European Commission’s Seventh Framework Program that works with HTR is Transkribus [https://readcoop.eu/transkribus/?sc=Transkribus]. Here, Deep Neural Network Models are applied to manuscript material to decipher (historical) manuscripts or printed texts using digital images and transcriptions, and automatically generate transcripts of similar material. Based on the input documents, users train an HTR model, which is thus language and script independent. Baselines and corresponding text form the input of the learning algorithms of the neural network (see figure 2).
For full transparency, I should address the accessibility of the program: The software itself is free, and the use of the HTR was free for a long time. In October 2020, however, Transkribus switched to a partial payment model, so that users could still download the software for free and train an HTR model but had to pay for the application of this to subsequent materials with so-called “credits”, which have to be purchased. For the realization of my project, I received a scholarship of 3000 credits from the READ project, for which I am very grateful.
To feed Transkribus with baseline data (called ground truth), I uploaded the first issue of MC (January 1800). To mark the baselines, Transkribus offers an automatic layout analysis, where the images are segmented into single lines. These then have to be transcribed manually (see also Figure 2). To train an HTR model, about 15,000 words (approx. 75 pages) are required as a ground truth data set; for printed texts, 5000 words or 25 pages are sufficient. With a few clicks and a little time, HTR models can be trained that achieve a character error rate (CER, average percentage of incorrectly transcribed characters) of less than 5% (handwritten texts), respectively 1–2% for printed texts.
As a ground truth data set, I completely transcribed the first issue of MC and used it to train a first HTR model. In a second step, I let this model transcribe the February 1800 issue, corrected it manually and fed this data into my model as well. Thus, I ended up with my model “MC 1800 German” with a CER of 1.29% (see Figure 3). The transcriptions can then be exported as xml, pdf or txt files.
Now, we can compare the transcriptions with my model with those of Tesseract and the example above:
Monatl. Corresp. 1800. JUNIUS.
556
die Glaskugel hätte machen können. Es scheint auch,
daß man leichter zwey Stahlcylinder einander voll¬
kommen gleich wird machen können, als man zwey
Glaskugeln gleich groß und gleich dick blasen kann:
so daß man also bey Stahlcylinder leichter zwey voll¬
kommen vergleichbare Thermometer wird erhalten
können.
XIIV.
Über die
beym April-Hefte’ befindliche
Persische Karte.
(Beschluß zu S. 513 des III B.)
Man hat mir den Vorwurf machenwollen, daß
ich die Anpreisungen und Empfehlungen Hadley’scher
Spiegel-Sextanten übertreibe und bis zum Ekel wie¬
derhole. Aber die vielfältigen Beyspiele, welche mir
mehr, als jedem andern bekannt werden, beweisen
mir, daß ich sie bey weiten noch nicht genug em¬
pfohlen habe; ich werde also noch lange damit fort¬
fahren. Dies kann doch wol niemanden Verdruß
oder Schaden bringen? Ich habe erfahren, daß seit¬
dem dieses nicht genug zu lobende Instrument, durch
gegenwärtige Zeitschrift, auch unter Laien, oder hn.
ter solchen Gelehrten bekannter geworden ist, deren
Beruf es nicht mit sich bringt, astronomische Werke
zu lesen, der Gebrauch dieses nützlichen Werkzeu¬
ges
This transcription is now almost flawless. However, minor corrections were necessary, especially for numbers and symbols. In particular, mathematical formulas and elaborate calculations as well as tables with observational data, which occur repeatedly in the MC, were particularly difficult to transcribe: Rare symbols were not recognized or were confused, fractions longer than two lines were segmented and thus deprived of their reference. The quality of the digitized material itself also led to errors: print-through of the backs, pale or blurred writing or stains affected the correct transcription. Nevertheless, and despite the relatively large amount of time that had to be invested in collecting ground truth data, Transkribus ultimately produced a text that was for the most part very close to the original text and machine-readable, and thus could form the basis for my further processing with digital tools.
Sources
Akhlaghi, Andrew. “OCR and Machine Translation.” Programming Historian 10 (2021). https://doi.org/10.46430/phen0091.
Eisenstein, Elizabeth L. The Printing Revolution in Early Modern Europe. Cambridge: Cambridge University Press, 1983.
Graves, Alex, and Jürgen Schmidhuber. “Offline Handwriting Recognition with Multidimensional Recurrent Neural Networks.” In Advances in Neural Information Processing Systems, Vol. 21, 2009. https://papers.nips.cc/paper/2008/hash/66368270ffd51418ec58bd793f2d9b1b-Abstract.html.
Mazal, Otto. Paläographie und Paläotypie. Zur Geschichte der Schrift im Zeitalter der Inkunabeln. Vol. 8. Bibliothek des Buchwesens. Stuttgart: Anton Hiersemann Verlag, 1984.
Muehlberger, Guenter, Louise Seaward, Melissa Terras, Sofia Ares Oliveira, Vincente Bosch, and Maximilian Bryan. “Transforming Scholarship in the Archives Through Handwritten Text Recognition.” Journal of Documentation 75, no. 5 (2019): 954–76.
Smith, Ray. “An Overview of the Tesseract OCR Engine.” Ninth International Conference on Document Analysis and Recognition (ICDAR 2007), 2007, 629–33.
Tappert, Charles C., Ching Yee Suen, and Toru Wakahara. “The State of the Art in Online Handwriting Recognition.” IEEE Trans. Pattern Anal. Mach. Intell. 12 (1990): 787–808.