Blog post by Niek Verhoeff (source: amsterdamintelligence.com)

The breakthrough of ChatGPT and other Large Language Models open up a new range of possibilities for the archival sector, because most of the archival practice is analyzing text and creating access to the sources. In this blog we will explore the practical application of GPT models on indexing the civil registry for the period 1811-1922.

Last year we posted a blog about the use of AI within the Amsterdam City Archives. We use it for text recognition, mostly handwritten, and for information retrieval, especially Named Entity Recognition. 

Indexing the Civil Registry

Large Language Models like GPT can generate text on a given input. The input can be a prompt to freely generate a piece of text on a given subject, but you can also deliver a piece of text and let the model analyze it and return requested information about the text you offered: like a summarization or some extracted information. In 2022, we were still working on Named Entity Recognition models, which are capable of finding entities like people and locations in running text. But it seemed much more difficult to also recognize the role of the person or location. For example, whether the person is the sender of a letter, or whether a location is a place of birth. GPT models seem to be much better at dealing with the context in which an entity appears.

Many of the customers of the Amsterdam City Archives are doing genealogical research and are looking for information about their ancestors. Most of this information is kept in registries often recorded by local and religious authorities. For as long as the Amsterdam City Archives people have been working on indexes for these registries. First on card systems and the past few decades they have been digitized, mostly manually by just retyping the cards into a computer. The civil registry of the municipality for the period 1811-1922 is the biggest hiatus that we have.

It contains over 3 million deeds of birth, death and marriage for the period 1811-1922. The deeds contain a lot of information about the people that were born, died or got married, for example who their parents or relatives were, what their occupation was, where they lived and their age. A few years ago we calculated how much time it would take us to make the digital index manually and estimated it would take us over 9 years. So we did not start yet. All the deeds are digitally available on our website, but not searchable, because they are just images of pages from the physical registries. For the record: it may seem like a sensitive matter to work with personal data and AI (platforms), but we only work with data from people that were born more than a century ago. The archival law requires that all governmental information, that is relevant for historical reconstruction, is published. To be sure we are respecting the privacy of people, personal information is always restricted for hundred years after the presumable birthdate of the concerned persons. Since 2022 the Centraal Bureau voor Genealogie has a registry of deceased people which can be used to check if someone is really dead before publishing their personal information.

Handwritten Text Recognition

 

Our project starts with making digital transcriptions of all the deeds. So we started to use Handwritten Text Recognition on all the images of the deeds in the civil registry. We finetuned a model on the layout recognition so that the individual deeds with marginalia on a double page can be recognized and the text stays in order. We also finetuned a text recognition model to be better at recognizing both written and typed text, because these registries were pre printed and filled in by hand. Processing of the images will start very soon. For the HTR processing, we work with Transkribus. It’s a cooperative organization governed by mostly European public institutions like libraries, universities and archives. The Amsterdam City Archives is also a member.

On their website, you can take a look at all the documents that we already made searchable through Transkribus via the following link.

 

Structured data

As stated, ChatGPT was able to recognize persons and their roles in a description. But what can it do with a transcript of a birth deed? When prompted, ChatGPT can provide all personal data from the transcript it gives you a nice list.

This is already a world of difference from what we could do with the NER models in 2022. The models from spaCy are able to recognize dates and ages, but they can’t differentiate between the birthdate and the date of the deed, or recognize which age belongs to which person. What’s even more interesting is that ChatGPT can return structured data formats like JSON that we could reuse and add to our existing indexes. When we prompted ChatGPT to  return a JSON object of the document with specified fields and date fields as dates, ages as numbers, and the geographic coordinates of the birth address.

It is fascinating to see that the model can translate 'des na middags ten vier ure' (four o'clock in the afternoon) into 16:00:00. When asked, ChatGPT explains that it is trained on the data of Google Maps and OpenStreetMap and that it got the coördinates from its training data. When checked with OpenStreetMap the coördinates are a few seconds off. Google Maps brings you to a whole other coördinate when you search for it. ChatGPT is known for making stuff up, so it would be wise to do some extra research on this. What’s for sure is that ChatGPT does not (yet) take into account any street renumbering in the past. For example, it would be wonderful if we could connect an LLM to a database of historical addresses like AdamLink to get the coordinates for a given address in the 19th century.

Scaling up

It would still be a hassle to prompt every deed to ChatGPT manually, but OpenAI also provides a paid API service. With this service it should be possible to process the 3 million deeds in about 150 days. Thus is much faster than the 9 years it would take by hand. However, the Municipality of Amsterdam would rather not share its data with companies such as OpenAI. Therefore we are researching open-source solutions that can be run locally. With a framework like LangChain and models on Hugging Face, it would seem that there are some possibilities. We are looking into what resources are needed to process the deeds in a considerable amount of time. During the yearly congres for archival institutions in the Netherlands on Monday 12th of June 2023, we reached out to fellow institutions to work together on a public platform for language processing. This was our first invitation to cooperate and we have a lot to work out before we have a publicly available searchable index. If you are a public organization that wants to join forces, let us know and contact me at n.verhoeff@amsterdam.nl!

 


*This article was initially posted as a blog (in Dutch) in the blogseries Bronnen in Bytes from the Amsterdam City Archives We translated and updated it with the most recent insights.

Credits ©

    Icon/thumbnail

  • Sorting based on urban heritage