DH 2026

Daejeon, July 27–31

Poster

Canonist: An Expert System for Early Medieval Canon Law

Svetlana Gorovaia
Technical University of Applied Sciences Würzburg-Schweinfurt · gorovuhacase@gmail.com
Abhinav Ramireddy
Radboud University · abhinav.ramireddy@ru.nl
Gleb Schmidt
Radboud University · gleb.schmidt@ru.nl
Ivan P. Yamshchikov
Technical University of Applied Sciences Würzburg-Schweinfurt · ivan.yamshchikov@thws.de

Introduction

From the establishment of Christianity as a permitted, and later the official, religion of the Roman Empire and until the turn of the nineteenth century, the corpus of canon law—the law created within the Church and used in ecclesiastical courts—played a significant, though historically variable, role in regulating various aspects of life not only within the Church itself but also more broadly—in shaping norms governing social interactions and private and family life in much of medieval and early modern Western Europe (Winroth / Wei 2022; Rennie 2018; Rennie / Taliadoros 2014). In the Middle Ages, a period in which secular legal systems were dissimilar from stable, rigid, and codified modern ones and were instead often localized, customary, and unevenly institutionalized, ecclesiastical jurisdiction and the canon law applied within it frequently filled this regulatory vacuum (Firey 2024).

This status of canon law contributed to its development into a complex, dynamic, and malleable system of norms drawn from various sources and characterized by varying scopes, degrees of authority, symbolic weight, applicability, and influence (Firey 2022; Firey 2024). Combined with the peculiarities of medieval transmission of these norms in handwritten books, these features make canon law in the Middle Ages notoriously difficult to navigate (McKitterick 1985). In the situation when canon law texts are spread across thousands of medieval manuscripts, uncountable scholarly editions, and reference publications, identifying a set of norms functioning in any given context may be a very challenging tasks.

The ambition of the SOLEMNE is to facilitate navigation of this corpus by providing innovative ways to interact with this complex corpus. The poster presents the early stage results of this work. Specifically, it introduces Canonist, an expert system designed to help scholars navigate and query the corpus of early medieval canon law, combining a multi-component retrieval architecture with answer generation via retrieval-augmented generation (RAG), a technique that has recently been applied with increasing regularity to similar problems in the humanities (Tran et al. 2024; Murugaraj et al. 2025; Kuan Li et al. 2025; Nagori et al. 2025) including, tellingly, legal scholarship (Wiratunga et al. 2024; Haitao Li et al. 2025).

Data

Content and structure

The dataset of the ongoing SOLEMNE (currently under construction) offers the most comprehensive corpus of canon law texts from the fourth to the twelfth century. It currently consists of 391 texts and 2,842,808 words. This encompasses: (1) published editions of councils, papal decretals, and canonical collections that are not yet digitally available; (2) transcriptions of previously unpublished manuscripts using (Clérice et al. 2025); (3) authorised contributions from comparable projects (Firey n.d.; Elliot 2015). Each text represents a canon law collection—a series of sequentially arranged atomic units, that is, indivisible chunks of Latin text that in most cases represent a single norm or regulation.

Metadata

Experts assigned dates, regions, and genre labels to each collection; detailed statistics are provided in Figures 2 and 3. Additionally, we expanded the metadata to the level of individual atomic units by generating, for each unit, (1) an English translation—to facilitate processing, despite reported capabilities of state-of-the-art commercial LLMs to work with Latin (Volk et al. 2024; Schmidt et al. 2024); (2) semantic representations of both the Latin and English texts using OpenAI embeddings (Hurst et al. 2024); (3) joint word-, document- (atomic unit), and topic-level representations using top2vec (Angelov 2020); (4) two-level topic modelling and clustering using TopicGPT (Pham et al. 2024); (5) keywords extracted with KeyBERT (Grootendorst 2020); (6) using GPT-4o, we automatically annotated each canonical norm.

Architecture

The system follows a structured multi-step pipeline (Figure 1). The query is first paraphrased 2–3 times by an LLM and keywords are extracted; if bibliographic metadata is mentioned, it constrains the retrieval pool before search begins. The processed query is passed to an ensemble retriever combining four components: a keywords retriever, a dense retriever (semantic similarity over embeddings), a sparse retriever (BM25 over texts and metadata), and a topic retriever (Top2Vec and TopicGPT). Results are aggregated by voting and passed to an LLM-based listwise reranker (Ren et al. 2024), which filters and ranks relevant documents. Duplicate text chunks are merged before a final answer generator produces a concise, source-grounded response.

Evaluation

The evaluation of Canonist at the time of submission remains at an early stage, and a full assessment of answer quality is left for future work.

Evaluation data

We evaluate the retrieval component using two datasets. The first comprises 30 expert-formulated case studies on three topics — abortion, clerical cohabitation, and usury — with ten questions per topic; experts annotated complete pools of relevant documents (on average 21 paragraphs across 10 source files per question). The second consists of 200 question–answer pairs generated by randomly sampling corpus paragraphs and prompting an LLM to formulate one question per paragraph.

Figure 1: Canon Law Expert System step-by-step architecture.

Metrics

Because expert questions require synthesising evidence across many sources, we report Precision (what fraction of retrieved documents are relevant) rather than recall. For generated questions, which have a single gold document, we report Found (was the gold document retrieved?) and MRR. Table 1 summarises results.

Discussion and planned work

Table 2 illustrates the range of query types handled by the system.

While the results of the preliminary retrieval evaluation appear promising, the absence of a larger validation dataset remains a limitation. Evaluation procedures similar to those described in (Mandikal 2024; Haitao Li et al. 2025) and involving fields experts are also planned for the generation component of the system.

References
  1. Angelov, Dimo (2020): “Top2Vec: Distributed Representations of Topics”. arXiv:2008.09470 <https://arxiv.org/abs/2008.09470> [07.05.2026]. DOI: 10.48550/ARXIV.2008.09470.
  2. Clérice, Thibault / Gabay, Simon / Vlachou-Efstathiou, Malamatenia / Pinche, Ariane / Sagot, Benoît (2025): “CoMMA, a Large-scale Corpus of Multilingual Medieval Archives” <https://inria.hal.science/hal-05299220> [07.05.2026].
  3. Elliot, Michael (2015): “Anglo-Saxon Canon Law” <https://individual.utoronto.ca/michaelelliot/index.html> [07.05.2026].
  4. Firey, Abigail (n.d.): “Carolingian Canon Law Project” <https://ccl.rch.uky.edu> [07.05.2026].
  5. Firey, Abigail (2022): “Early Medieval Canon Law”, in: Winroth, Anders / Wei, John C. (eds.): The Cambridge History of Medieval Canon Law. Cambridge: Cambridge University Press, 32–45.
  6. Firey, Abigail (2024): “Between Chaos and Codification: Consensus and the Content of Carolingian Canon Law”, in: Engh, Line Cecilie / Aavitsland, Kristin Bliksrud (eds.): Standardization in the Middle Ages. Berlin / Boston: De Gruyter, 13–42. DOI: 10.1515/9783110987126-002.
  7. Grootendorst, Maarten (2020): “KeyBERT: Minimal keyword extraction with BERT.” Zenodo, version v0.3.0 <https://doi.org/10.5281/zenodo.4461265> [07.05.2026]. DOI: 10.5281/zenodo.4461265.
  8. Hurst, Aaron / Lerer, Adam / Goucher, Adam P. / Perelman, Adam / Ramesh, Aditya / Clark, Aidan / Ostrow, AJ / Welihinda, Akila / Hayes, Alan / Radford, Alec et al. (2024): “GPT-4o System Card”. arXiv:2410.21276 <https://arxiv.org/abs/2410.21276> [07.05.2026]. DOI: 10.48550/arXiv.2410.21276.
  9. Li, Haitao / Chen, Yifan / Hu, Yiran / Ai, Qingyao / Chen, Junjie / Yang, Xiaoyu / Yang, Jianhui / Wu, Yueyue / Liu, Zeyang / Liu, Yiqun (2025): “LexRAG: Benchmarking Retrieval-Augmented Generation in Multi-Turn Legal Consultation Conversation” <https://arxiv.org/abs/2502.20640> [07.05.2026]. DOI: 10.48550/ARXIV.2502.20640.
  10. Li, Kuan / Zhang, Liwen / Jiang, Yong / Xie, Pengjun / Huang, Fei / Wang, Shuai / Cheng, Minhao (2025): “LaRA: Benchmarking Retrieval-Augmented Generation and Long-Context LLMs–No Silver Bullet for LC or RAG Routing”. arXiv:2502.09977 <https://arxiv.org/abs/2502.09977> [07.05.2026].
  11. Mandikal, Priyanka (2024): “Ancient Wisdom, Modern Tools: Exploring Retrieval-Augmented LLMs for Ancient Indian Philosophy”. arXiv:2408.11903 <https://arxiv.org/abs/2408.11903> [07.05.2026].
  12. McKitterick, Rosamond (1985): “Knowledge of Canon Law in the Frankish Kingdoms Before 789: the Manuscript Evidence”, in: Journal of Theological Studies 36: 97–117.
  13. Murugaraj, Keerthana / Lamsiyah, Salima / During, Marten / Theobald, Martin (2025): “Topic-RAG for historical newspapers: Enhancing information retrieval in humanities research through topic-based retrieval-augmented generation”, in: Computational Humanities Research 1: e15. DOI: 10.1017/chr.2025.10018.
  14. Nagori, Aditya / Casonatto, Ricardo Accorsi / Gautam, Ayush / Cheruvu, Abhinav Manikantha Sai / Kamaleswaran, Rishikesan (2025): “Open-Source Agentic Hybrid RAG Framework for Scientific Literature Review”. arXiv:2508.05660 <https://arxiv.org/abs/2508.05660> [07.05.2026]. DOI: 10.48550/arXiv.2508.05660.
  15. Pham, Chau Minh / Hoyle, Alexander / Sun, Simeng / Resnik, Philip / Iyyer, Mohit (2024): “TopicGPT: A prompt-based topic modeling framework”, in: Duh, Kevin / Gomez, Helena / Bethard, Steven (eds.): Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers). Mexico City, Mexico: Association for Computational Linguistics, 2956–2984. DOI: 10.18653/v1/2024.naacl-long.164.
  16. Ren, Ruiyang / Wang, Yuhao / Zhou, Kun / Zhao, Wayne Xin / Wang, Wenjie / Liu, Jing / Wen, Ji-Rong / Chua, Tat-Seng (2024): “Self-Calibrated Listwise Reranking with Large Language Models” <https://arxiv.org/abs/2411.04602> [07.05.2026]. DOI: 10.48550/ARXIV.2411.04602.
  17. Rennie, Kriston R. (2018): Medieval Canon Law. Past Imperfect. Leeds, UK: ARC Humanities Press.
  18. Rennie, Kriston R. / Taliadoros, Jason (2014): “Why Study Medieval Canon Law?”, in: History Compass 12, 2: 133–149. DOI: 10.1111/hic3.12131.
  19. Schmidt, Gleb / Gorovaia, Svetlana / Yamshchikov, Ivan P. (2024): “Sui Generis: Large Language Models for Authorship Attribution and Verification in Latin”, in: Proceedings of the 4th International Conference on Natural Language Processing for Digital Humanities. Miami, USA: Association for Computational Linguistics, 398–412. DOI: 10.18653/v1/2024.nlp4dh-1.39.
  20. Tran, The Trung / González-Gallardo, Carlos-Emiliano / Doucet, Antoine (2024): “Retrieval Augmented Generation for Historical Newspapers”, in: Proceedings of the 24th ACM/IEEE Joint Conference on Digital Libraries. New York: ACM, 1–5. DOI: 10.1145/3677389.3702542.
  21. Volk, Martin / Fischer, Dominic Philipp / Fischer, Lukas / Scheurer, Patricia / Ströbel, Phillip Benjamin (2024): “LLM-based Machine Translation and Summarization for Latin”, in: Sprugnoli, Rachele / Passarotti, Marco (eds.): Proceedings of the Third Workshop on Language Technologies for Historical and Ancient Languages (LT4HALA) @ LREC-COLING-2024. Torino, Italia: ELRA and ICCL, 122–128.
  22. Winroth, Anders / Wei, John C. (eds.) (2022): The Cambridge History of Medieval Canon Law. Cambridge: Cambridge University Press.
  23. Wiratunga, Nirmalie / Abeyratne, Ramitha / Jayawardena, Lasal / Martin, Kyle / Massie, Stewart / Nkisi-Orji, Ikechukwu / Weerasinghe, Ruvan / Liret, Anne / Fleisch, Bruno (2024): “CBR-RAG: case-based reasoning for retrieval augmented generation in LLMs for legal question answering”, in: International Conference on Case-Based Reasoning. Springer, 445–460.