Instructions to use mschonhardt/ius-commune-citations-ner with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Flair
How to use mschonhardt/ius-commune-citations-ner with Flair:
from flair.data import Sentence from flair.models import SequenceTagger tagger = SequenceTagger.load("mschonhardt/ius-commune-citations-ner") sentence = Sentence("George Washington went to Washington.") tagger.predict(sentence) print(sentence) - Notebooks
- Google Colab
- Kaggle
Citations and named entities in Latin texts of the ius commune
A Flair sequence tagger that finds allegations of the learned law and the named entities in Latin legal prose of the 13th to 16th centuries. It marks citations of the Corpus iuris civilis and the Corpus iuris canonici in their abbreviated medieval form ("ff. de pac. l. tale pactum. ยง. fi.", "extra de proba. c. cum causam."), citations of the Libri feudorum and other works, the jurists and glosses invoked by siglum ("Bar.", "Inno.", "Io. And.", "gl. ord."), and statutes, persons, places, institutions and dates.
The model was built for the machine-assisted study of the legal cultures of the late Middle Ages and the early modern period. Once the citations and names are marked, a corpus of consilia, commentaries or tractatus can be indexed by the authorities it cites, the jurists it follows and the parties and places it concerns, and the argumentative texture of the ius commune becomes searchable at scale. The tagger annotates the texts of the Consilia portal.
Developed in the project Embedding the Past (LOEWE-Exploration, TU Darmstadt, AdWL Mainz), funded by HMWK Hessen, PI Prof. Dr. Michael Schonhardt.
Labels
| label | meaning | examples as printed |
|---|---|---|
CIT_CIV |
citation of the Corpus iuris civilis (Digest, Codex, Institutes, Authenticum and Novels) | ff. de ver. ob. l. 1., C. de testa. l. hac consultissima, insti. de inoffi. te. ยง. mater, in Auth. vt cum de appe. cogno. |
CIT_CAN |
citation of the Corpus iuris canonici (Decretum, Liber Extra, Sextus, Clementines) | extra de proba. c. cum causam., xxx. q. v. c. nostrates, Clem. vnica de testib. |
CIT_FEUD |
citation of the Libri feudorum | in vsib. feu. ti. de capi. qui cur. vend. |
CIT_OTHER |
other cited work (Scripture, philosophy, literature) | Matth. xix., Arist. in v. Ethico. |
JURIST |
jurist or gloss cited by name or siglum | Bar., Inno., Cyn., Io. And., glo. ord. |
STATUTE |
statute or local law referred to | statuto communis Perusii, sub rub. quod mulieres habentes |
PERSON |
party or other person of the case | Nicolina, dominus Ioannes de Angelo |
PLACE |
place | castrum Sauigliani, Paduฤ |
ORG |
institution, commune or church | commune Eug., communitas Senarum |
DATE |
date | anno domini 1388., Anno Domini Millesi. 383. indictione 6. |
A span is the whole reference as the print gives it, from the first siglum to the last element of the same reference, while chains of references joined by "et" are separate spans. Spelling and abbreviation follow the print.
Architecture
Flair SequenceTagger with a CRF over stacked embeddings:
mschonhardt/MediBerta, a continued pre-training ofFacebookAI/xlm-roberta-largeon medieval Latin, fine-tuned during training with first-subtoken pooling and document context,mschonhardt/latin-legal-forwardandmschonhardt/latin-legal-backward, contextual string embeddings (Flair character language models trained on Latin legal text), kept frozen.
The tags are in BIOES format, with 10 span types and 43 tags.
Training data
The training data are made from the texts of the Consilia edition: Baldus de Ubaldis, Consilia (Venice 1575, five volumes, 2,514 consilia) and Nicolaus de Tudeschis (Panormitanus), Consilia (Venice 1571, 226 consilia). All 10,322 text units of the edition were annotated by Gemini 4 Argon, which was asked to mark every citation and name as a verbatim quotation. A check of a stratified sample of 150 consilia by reading found that this annotation misses hardly any citation (recall about 99.9 % in the sample). The quotations were located in the text and converted to BIOES tags. The split is by consilium, so that no document appears in two sets.
| split | sentences | tokens | spans |
|---|---|---|---|
| train | 89,250 | 2,358,486 | 91,088 |
| dev | 11,990 | 307,665 | 11,689 |
| test | 10,511 | 264,367 | 9,777 |
Spans per label in the training set: CIT_CIV 42,546, PERSON 17,302, JURIST 13,907, CIT_CAN 11,101, PLACE 2,360, ORG 1,699, STATUTE 802, CIT_FEUD 786, DATE 295, CIT_OTHER 290.
Training
The model was trained for 20 epochs with a learning rate of 5e-5 (linear schedule with 10 % warm-up), mini-batches
of 16 sentences, shuffling and mixed precision, and a checkpoint after every epoch. The best model was chosen by
the span F1 on the dev set. Training took 5.1 hours on one GPU on 29 October 2026, about 15 minutes per epoch.
The dev F1 (micro) rose from 0.850 after the first epoch to 0.912 after the last, which was also the best. The
training log (training.log) and the losses and dev scores per epoch (loss.tsv) are in this repository.
Evaluation
The scores are span-level, with an exact match of boundaries and label, on the held-out test split (10,511 sentences, 9,777 spans).
| label | precision | recall | F1 | support |
|---|---|---|---|---|
| CIT_CIV | 0.950 | 0.953 | 0.952 | 4,861 |
| PERSON | 0.903 | 0.903 | 0.903 | 1,871 |
| JURIST | 0.932 | 0.929 | 0.930 | 1,447 |
| CIT_CAN | 0.881 | 0.890 | 0.885 | 915 |
| PLACE | 0.636 | 0.643 | 0.640 | 272 |
| ORG | 0.727 | 0.747 | 0.737 | 178 |
| STATUTE | 0.579 | 0.619 | 0.598 | 118 |
| CIT_FEUD | 0.820 | 0.820 | 0.820 | 50 |
| DATE | 0.625 | 0.714 | 0.667 | 35 |
| CIT_OTHER | 0.364 | 0.267 | 0.308 | 30 |
| micro avg | 0.911 | 0.914 | 0.912 | 9,777 |
| macro avg | 0.742 | 0.748 | 0.744 | 9,777 |
The citations of the two corpora, the jurists and the persons, which make up most spans, are found reliably. The rare types (statutes, dates, other works) have few training examples and are less reliable.
Use
from flair.models import SequenceTagger
from flair.data import Sentence
tagger = SequenceTagger.load("mschonhardt/ius-commune-citations-ner")
s = Sentence("Item exclusa filia videtur excludi omnis descendens per filiam. ar. ff. de colla. bo. l. dedit dotem. "
"et C. de nat. lib. l. fi. vt eleganter no. Bar. in l. 1. ff. vti possi.")
tagger.predict(s)
for span in s.get_spans("ner"):
print(span.tag, round(span.score, 2), span.text)
tag_text.py in this repository tags a text file and returns the spans with character offsets. The input should
be tokenised like the training data (runs of letters or digits and single punctuation marks, which Flair's default
tokenizer comes close to), with the abbreviations as printed. The model expects the transcription conventions of
the Consilia edition, that is "et" for the ampersand, "s" for the long s, "ae" for the ligature and abbreviation
marks expanded (nรต becomes non).
Limitations
The model was trained on two authors and two prints (Venice 1571 and 1575, roman type, consilia). Other genres such as commentaries, glosses or statutes and other orthographies need a check and probably further fine-tuning. Nested references, for example a gloss on a lex, form one span of the outer type.
Environmental impact
The following is an estimate and not a measurement, since no power meter was attached.
| step | GPU time | assumed draw | energy incl. host and cooling (PUE 1.4) |
|---|---|---|---|
| training (20 epochs) | 5.1 h | 400 W average on a 600 W card | about 2.9 kWh |
| tagging the corpus (10,322 units) | 4 min | 400 W | under 0.1 kWh |
The hardware was one NVIDIA RTX PRO 6000 Blackwell Server Edition (96 GB) in a university server in Darmstadt, Germany. With the German grid average of about 0.38 kg CO2e per kWh (Umweltbundesamt, 2024 mix) the training amounts to roughly 1.1 kg CO2e. The estimate follows the method of the Machine Learning Impact calculator (Lacoste et al. 2019), multiplying hours, power and carbon intensity with a PUE factor. The silver annotation by Gemini 4 Argon ran as a cloud service, whose energy use is not published and is not included here.
Citation
Schonhardt, Michael: ius-commune-citations-ner. Citations and named entities in Latin texts of the ius commune (Flair sequence tagger). Embedding the Past (LOEWE-Exploration, TU Darmstadt, AdWL Mainz), 2026. https://huggingface.co/mschonhardt/ius-commune-citations-ner
@misc{schonhardt2026iuscommune,
author = {Schonhardt, Michael},
title = {ius-commune-citations-ner: Citations and named entities in Latin texts of the ius commune (Flair sequence tagger)},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/mschonhardt/ius-commune-citations-ner}},
note = {Developed in the project Embedding the Past (LOEWE-Exploration, TU Darmstadt, AdWL Mainz), funded by HMWK Hessen}
}
Related
- The Consilia portal: https://dekm-tud.github.io/coding-consilia/ , code and data: https://github.com/dekm-tud/coding-consilia
- kraken models for the same prints:
mschonhardt/consilia-baldus-venice1575-kraken-segand-kraken-rec - PageXML ground truth:
mschonhardt/consilia-baldus-venice1575-pagexml
- Downloads last month
- 58
Model tree for mschonhardt/ius-commune-citations-ner
Evaluation results
- span F1 (micro) on Consilia held-out test split (silver standard, 10,511 sentences)self-reported0.912
- span F1 (macro) on Consilia held-out test split (silver standard, 10,511 sentences)self-reported0.744