Downloads · 30 days
10
6% of all-time downloads
Riksarkivet/oldbertur-diplomatic-old-icelandic-ner
oldbertur-diplomatic-old-icelandic-ner is a token classification model from Riksarkivet. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as gpl-3.0.
This model performs Named Entity Recognition (NER) on diplomatic Old Icelandic texts sourced from medieval manuscripts, identifying Person and Location entities.
Downloads · 30 days
10
6% of all-time downloads
All-time downloads
165
Public
Parameters
124M
991 MB on disk
Likes
4
Public
Click a slice to open those files.
.bin495 MB · 50%
How the weights are stored.
F32124M · 100%
From the Hugging Face model README
This model performs Named Entity Recognition (NER) on diplomatic Old Icelandic texts sourced from medieval manuscripts, identifying Person and Location entities.
This model is fine-tuned for NER through token classification by using a domain-adapted version of IceBERT adapted through Masked Language Modelling (MLM) on a corpus of 15 Old Icelandic texts. The NER model is designed for diplomatic Old Icelandic texts as defined in the Menota diplomatic transcription level description.
For normalised transcriptions of Old Icelandic texts, please use oldbertur-normalised-old-icelandic-ner instead.
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("Riksarkivet/oldbertur-diplomatic-old-icelandic-ner")
model = AutoModelForTokenClassification.from_pretrained("Riksarkivet/oldbertur-diplomatic-old-icelandic-ner")
# Use aggregation_strategy="first" to properly combine subword tokens
ner_pipeline = pipeline("ner", model=model, tokenizer=tokenizer, aggregation_strategy="first")
text = "Jſland byɢþiſc fyrſt vr Norvegi a dogom Harallz Halfdanar ſonar"
results = ner_pipeline(text)
for entity in results:
# entity['word'] corrupts multi-byte UTF-8 chars; use start/end offsets instead
word = text[entity['start']:entity['end']]
print(f"{word}: {entity['entity_group']} ({entity['score']:.3f})")
Expected output:
Jſland: Location (1.000)
Norvegi: Location (1.000)
Harallz Halfdanar ſonar: Person (1.000)
This model uses the M<sup>R</sup> + I + MIM training configuration, combining:
| Source | Description |
|---|---|
| Menota (M) | Diplomatic Old Icelandic texts from the Medieval Nordic Text Archive |
| IcePaHC (I) | Icelandic Parsed Historical Corpus (normalised Old Icelandic texts) |
| MIM-GOLD-NER (MIM) | Modern Icelandic NER data for data augmentation |
The superscript <sup>R</sup> means that sentence-level class resampling (sCR) was applied to the diplomatic Menota data. This is done to increase the amount of diplomatic data, while the normalised I and MIM are used to augment the diplomatic target data.
Training set statistics:
| Configuration | Person | Location | Total |
|---|---|---|---|
| M<sup>R</sup> + I + MIM | 40,191 | 12,326 | 52,517 |
Entity breakdown by source:
| Source | Person | Location | Total |
|---|---|---|---|
| Menota (M) | 3,969 | 472 | 4,441 |
| IcePaHC (I) | 2,797 | 362 | 3,159 |
| M<sup>R</sup> after resampling | 20,485 | 2,622 | 23,107 |
| MIM-GOLD-NER | 15,587 | 9,002 | 24,589 |
Evaluation sets:
The dev and test sets consist exclusively of diplomatic Old Icelandic texts in order to reflect our target domain.
| Metric | Score |
|---|---|
| F1 | 0.79 |
| Precision | 0.77 |
| Recall | 0.81 |
The model uses BIO tagging with the following labels:
| Label | Description |
|---|---|
O | Outside any entity |
B-Person | Beginning of a person name |
I-Person | Inside/continuation of a person name |
B-Location | Beginning of a location name |
I-Location | Inside/continuation of a location name |
To adapt the underlying model, IceBERT, which is trained on modern texts, we use task-adaptive pre-training (TAPT) to facilitate model familiarity with Old Icelandic diplomatic texts prior to fine-tuning for NER. We use a corpus of 15 unannotated diplomatic Old Icelandic texts from Menota for the domain-adaptation.
Hyperparameters:
NER is framed as a token classification task, with a classification head added on top of the domain-adapted IceBERT.
Hyperparameters:
Class imbalance handling:
If you use this model, please cite:
@inproceedings{henningsson2026,
title={{OldBERTur}: Named Entity Recognition for Medieval {I}celandic},
author={Henningsson, Pontus and Pettersson, Eva and Lenas, Erik},
booktitle={{Proceedings of the Fourth Workshop on Language Technologies for Historical and Ancient Languages (LT4HALA) @ LREC-2026}},
year={2026},
address = {Palma, Mallorca, Spain},
pages = {469–481. European Language Resources Association (ELRA)},
publisher = "11 May 2026. European Language Resources Association (ELRA)",
url = {http://lrec-conf.org/proceedings/lrec2026/workshops/lt4hala/2026.lt4hala-1.0.pdf}
}
For more information on our code and data, see our GitHub repository. For more information about the work in general, see our paper.
We are grateful for the great work carried out by the projects below, and for making it possible for us to use their data in order to conduct our academic research and develop NER models for Medieval Icelandic. We thank developers, annotators, scholars, project managers, and anyone else who has contributed to these projects. We also express our sincerest gratitude to the students from Uppsala University who assisted in marking and annotating entities in the two Menota works Codex Wormianus (AM 242 fol) and Vǫluspá in Hauksbók (AM 544 4to).
This model is released under the GNU General Public License v3.0 (GPL-3.0).
For questions or issues, please open an issue on the GitHub repository or contact: [email protected]