# Textual Transmission without Borders: Multiple Multilingual Alignment and Stemmatology of the "Lancelot en prose" (Medieval French, Castilian, Italian)

Matthias Gille Levenson, Lucence Ing, Jean-Baptiste Camps

► To cite this version:

Matthias Gille Levenson, Lucence Ing, Jean-Baptiste Camps. Textual Transmission without Borders: Multiple Multilingual Alignment and Stemmatology of the "Lancelot en prose" (Medieval French, Castilian, Italian). Computational Humanities Research 2024, Dec 2024, Aarhus, Denmark. pp.65-92, 2024. hal-04759151

HAL Id: hal-04759151

https://enc.hal.science/hal-04759151v1

Submitted on 29 Oct 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Textual Transmission without Borders: Multiple Multilingual Alignment and Stemmatology of the “Lancelot en prose” (Medieval French, Castilian, Italian)

Matthias Gille Levenson<fnref n="1" />,<fnref n="2" />,<fnref n="3" />,*, Lucence Ing<fnref n="1" />,<fnref n="3" />,\* and Jean-Baptiste Camps<fnref n="1" />,<fnref n="3" />

## Abstract

This study focuses on the problem of multilingual medieval text alignment, which presents specific challenges, due to the absence of modern punctuation in the texts and the non-standard forms of medieval languages. In order to perform the alignment of several witnesses from the multilingual tradition of the prose *Lancelot*, we first develop an automatic text segmenter based on BERT and then align the produced segments using Bertalign. This alignment is then used to produce stemmatological hypotheses, using phylogenetic methods. The aligned sequences are clustered independently by two human annotators and a clustering algorithm (DBScan), and the resulting variant tables submitted to maximum parsimony analysis, in order to produce trees. The trees are then compared and discussed in light of philological knowledge. Results tend to show that automatically clustered sequences can provide results comparable to those of human annotation.

## Keywords

Multilingual alignment, Text segmentation, Medieval Arthurian literature, Stemmatology

## 1. Introduction

The production and transmission of written texts during Antiquity and the Middle Ages involved a process of manual copying. During this process, the text was progressively transformed by errors and innovations as it circulated, each copy introducing successive modifications. Since the 19th century, philologists have taken to study the transmission of texts, based on innovations, using the genealogical tree (*stemma codicum*) as a metaphor to visually represent this transmission process. Yet, the study of textual transmission is still often limited to the copies produced in a given language (e.g. Medieval French) and do not necessarily encompass all the translations, in other medieval languages, that were part of the history of a given work. This is due in part to stark difficulties in aligning and analysing multilingual traditions, but

<figure><img src="image_2.png" /></figure>

<footnote n="1">¹Centre Jean Mabillon, École nationale des chartes, Paris Sciences & Lettres, France</footnote>

<footnote n="2">²CIHAM, UMR 5648, École Normale Supérieure de Lyon, France</footnote>

<footnote n="3">³ÉquipEx Biblissima+</footnote>
poses the risk of giving us a very limited and partial view of medieval cultures, constrained by
linguistic “frontiers” that were actually quite blurry and porous at the time.

**1.1. The challenge of multilingual traditions**

Multilingual collation of texts has attracted a few contributions, mostly focused on encoding or displaying editions of widely circulated texts [1, 2, 3, 4]. Yet, due to technical and modelling challenges, most critical editions are limited to a single language. National academic traditions, and the relative rarity of comparative studies in, for instance, current Romance Philology might be a factor, since research is often focused on editing either the source text or a specific language version. This philological reality can also be explained by material issues, namely the great difficulty of taking into account a large number of witnesses in the editorial process, the elaboration of a stemma, and the production of editions. Already true for large unilingual traditions alone, this is even more acute for multilingual traditions of widely circulated works, since adding distinct language versions only increases the complexity of the task.

The use of computer tools can help to overcome some of these limitations and pave the way for global studies of multilingual traditions, and even for the production of multilingual editions of textual traditions in the longer term.

The interest of this approach lies in the history of the text, in a global romanistic approach:
the aim is to consider the textual tradition as a whole, and to contribute to the progress of
knowledge on the text in general. Connecting local traditions will be profitable in order to
produce global knowledge on the reception of these multiply translated texts, while possibly
improving local knowledge on a specific tradition. Multilingual collation could, for example,
help clarify the history of the text in cases where one translation is the direct prototype of
another.

This paper focuses on computational multilingual alignment and collation (subsection 2.2), at “sentence” level and on *similar* fragments, on the classification of aligned sequences into distinct variants (subsection 2.3), and on their subsequent stemmatological analysis (section 3).<fnref n="1" /> To perform the alignment, due to the nature of the textual data we use, a first step of automatic segmentation of the text is necessary (subsection 2.1). The paper concentrates on the study of the multilingual tradition of the *Lancelot* en prose, in order to understand the history of the text and its translations. We take this text as a case study, which enables us to present a new methodology that can help the study of various multilingual medieval traditions.

**1.2. The multilingual tradition of the *Lancelot***

The study is based on a few witnesses of a complex medieval tradition, that of the *Lancelot en prose*, an anonymous text composed in the first third of the 13th century which enjoyed great success throughout the medieval period, with at least 126 manuscript witnesses, followed by many printed editions from 1488 onwards [5, 6]. This great success is also evidenced by the translations it has undergone (into Castilian, Catalan, Italian, High German, and Dutch). The

<footnote n="1">¹This article sets apart the identification of macroscopic displacement of large and medium-sized fragments (at paragraph level, for example) that can occur in complex traditions (see subsection 1.2).</footnote>
alignment of texts in a multilingual framework allows, through the recording of variants, to
establish the tradition of these translations.

In this paper, we focused solely on the Romance tradition, in particular the French source,
and the translations in Castilian and Italian (with the exclusion of the Catalan translation, of
which only small fragments remain). For both of these translations, only one complete witness
is preserved: in a manuscript produced in Florence in the last quarter of the 14th century, for the
Italian *Lancellotto* (Firenze, Biblioteca della Fondazione Ezio Franceschini 1); in a 16th century
manuscript, copied from a 1414 exemplar according to its colophon, for the Castilian *Lanzarote*
(Madrid, Biblioteca Nacional de España, 9611). Both texts have been edited [7, 8].

Given the extremely large number of witnesses of the French *Lancelot*, we have selected a
sample of five witnesses. They have been chosen on the basis of their supposed relationships
with the translations, according to existing philological knowledge: Paris, BnF, fr. 111 (15th c.)
is supposed to be close to the *Lancellotto* [9], while Paris, BnF, fr. 751 (13th c., 2nd half), or more
precisely the family of which it is a part, would be close to the *Lanzarote* [8]. In addition, due
to their easy availability and well known versions, we added several reference points, in the
form of the edition by Sommer, based on ms. London, BL, Add. 10293 (beg. 14th c.) [10, 11] and
Micha, based on mss Cambridge, Corpus Christi College, 45 (13²/<fnref n="2" />) for volume 2 and Oxford,
Bodleian Library, Rawlinson D. 899 (14th c.) for volume 4 [12, 13]. Finally, as a representative of
the late French tradition, whose place in the genealogy remains to be elucidated, we included
the *incunabula* edition of 1488 (from exemplar Paris, BnF, RES-Y2-46 and RES-Y2-47; Rouen,
Jean le Bourgois et Paris, Jean Dupré, 1488). For a list of the witnesses, see Appendix A.

The *Lancelot* is a very long prose text, and therefore it can be highly unstable from one
witness to another. The witnesses containing the translations are not spared from this insta-
bility, and they are also fragmentary. *Lancellotto* is especially so, as it presents only three non-
consecutive episodes of the text. To enable alignment, the first step was therefore to identify
corresponding passages from one witness to another (Appendix B), and to retain only what
could be compared. This is why the studied text segments have identifiers: ii-48, ii-61, and
iv-75, corresponding to the sections of the text as they appear in Micha edition.<fnref n="2" />

**1.3. State of the art on sentence alignment**

While multilingual alignment is a fairly active field in NLP, relatively little work has been done
on the production and use of alignment methods for philological, stemmatological and ecdotic
purposes, in the field of heritage text with pre-orthographic languages.

Birnbaum and Eckhoff [14] are considering the creation of a multilingual alignment tool,
based on parts of speech only, which works in cases of literal translations, such as the Old
Church Slavonic and an original Greek version of the *Codex Supralensis*. The work of Meinecke
et al. [15] on French epic literature, explores the possibilities offered by the use of semantic

<footnote n="2">²The first part of the identifier corresponds to the volume, the second to the number of the first segment according to Micha [12, 13] Due to significant textual variation and the current capabilities of the aligner, we have subdivided the longest sections, ii-61 and iv-75, into two and six parts respectively, so that none of the segments exceed 1,000 tokens. Despite this choice, the translations exhibit a significant number of omissions that are difficult to detect automatically. For example, *Lanzarote* contains the episode of the sparrowhawk (segment ii-61-2), but in an extremely shortened version, only a few sentences (Appendix C).</footnote>
representations of words through embeddings, from a unilingual perspective only. However, nothing is said about the definition and identification of “sentences” in the source texts, as the unit chosen to compare the versions seems to be the verse. Yet, embedding-based similarity calculations seem to be a promising venue for text alignment [16].

Recently, Liu and Zhu [17] have published a tool called Bertalign, a two-steps algorithm that makes use of sentence-transformers and multilingual sentence embeddings, based on the LaBSE model (“Language agnostic BERT Sentence Embeddings”) [18]. In particular, it allows to align 1 to *n* and *n* to 1 texts fragments. Bertalign works with segments fixed upstream and is designed for modern language states.<fnref n="3" />

## 2. Methodology

In this paper, we use the fixed fragments method designed by Liu and Zhu and we make use of Bertalign to perform the global alignments, while at the same time proposing a specific segmentation approach prior to the alignment.<fnref n="4" /> We describe our processing chain: segmentation, pseudo-sentences alignment, classification into distinct variants and stemmatological analysis.

### 2.1. Segmentation

The alignment task requires fixed segments, as the tool we rely on, Bertalign, is designed for contemporary languages for which sentence segmentation is not a problem (the period “.” is enough to split the corpus, as modern translations tend to reproduce the same divisions sentence by sentence). It can be an issue for medieval languages, where the notion of a modern sentence, which begins with a capital letter and ends with a period, doesn't really exist. Punctuation is highly variable depending on the copyist, even if a global and comparative study has yet to be carried out. Let's take the following two sentences as examples:

**BnF fr. 111**: *ains sem part si tost qu'il leut commandee a dieu et cheuauche en telle maniere iucqua tierce tant qu'il uient a lissue de la fourest. et il tourne a destre vers ung chemin uieil et ancien.*

**BnF fr. 751**: *Ains sen part si tost comme il lot comandee a dieu. et cheuauche en tel maniere. tant qu'il uient a lissue de la forest et il torne a destre uers le chemin uiez et ancien*

**Translation** (for both passages): [*But he goes away as soon as he commanded her to God and rides [until 9 a.m.], until he comes to the entrance of the forest, and he turns right towards an old pathway.*]

The punctuation of these two transcriptions is original: it shows that it is not a reliable marker for syntactic segmentation, as it can vary greatly depending on the source, and this

<footnote n="3">³A more recent preprint picks up on this work and compares Bertalign to a new architecture [19], but we haven't had time to look at how the algorithm works and how good it performs on our data.</footnote>

<footnote n="4">⁴The word-alignment phase, because it requires its own methodology, will not be dealt with in this article: we're only interested in the "macroalignment" phase, at the sentence or syntagm level.</footnote>
variability increases during the transcription and editing of the text. Moreover, original punctuation is still very little taken into account by editors, who re-punctuate the text and can make highly variable choices. It is therefore necessary to divide the texts into equivalent segments that can then be compared and aligned. To do this, we have decided to base our approach on sentence syntax. The assumption here is that there is a certain degree of correspondence between syntactic and semantic units, and that the syntactic tokenisation should be an efficient way to approach the different semantic units of the text. Let's take an example (Table 1): in the second line, "si" is translated by "e" in Castilian, but the syntactic units are preserved, allowing the alignment of segments that are formally quite different but share the same overall meaning.

<caption>**Table 1**</caption>

A correspondence between syntactic and semantic segments in fragment ii-48, on two following segments. The first one corresponds to the end of the preceding example. Each cell represents an alignment segment

<table><thead><tr><th>Micha</th><th>Sommer</th><th>Lanzarote</th><th>Lancellotto</th></tr></thead><tbody><tr><td>et il torne a destre vers un chemin viés et ancien;</td><td>et torne a destre en vn petit chemin viez</td><td>e dexo el camino e tomo a mano derecha vn camino pequeño | e biejo lleno de yerba</td><td>Ed e torna a destra inverso uno camino vecchio e antico,</td></tr><tr><td>si ne demora gueres</td><td>Si ne demora gaires</td><td>e non andubo mucho</td><td>si non dimora guari</td></tr></tbody></table>

### 2.1.1. Segmentation methods

To segment the texts, we try, compare and evaluate two methods: the first uses regular expressions, the second one uses AutoModelForTokenClassification BERT models.

**Using regular expressions** The first method we tried was based on the identification of function words, which required a language-by-language analysis of syntactic delimiters. Regular expressions have been developed to facilitate this identification and manage the high degree of graphical variation. Here are a few examples of such markers in French:

"[Tt]ant que", "[Aa]nsi", "[Ss]i est car", "[Ss]i est que", "[Ss]i", "[Ee]t", "mais", "qu[ie] si", "[kc]ar", "[Qq]u?ant", "quar", "[Qq]u',", "[Qq]u[ei]", "[Qq]uel", "[Dd]on[ct]", "[pP]uis"

In Spanish:

"[Pp]ues que", "[pP]or?que", "[pP]er", "[Qq]ue", "a que", "si", "[Dd]o", "[Ee]", "commo quier que", "mas", "ass?i como", "como", "[Aa]n?ss?i", "para", "aquel que"

And in Italian:

"[mM]a si", "[Ss]i", "tanto che", "che", "e", "donde", "ch'?"
This regular expression method is limited, however, as it doesn't allow for fine segmentation in the case of repeated markers (you have to think of all possible combinations), which leads to over-segmentation of the text, as we'll see below.

### Creating an ad hoc segmenter
Another problem with rule-based segmentation is that it relies solely on the identification of character strings. Besides the fact that this leads to a proliferation of rules for languages with significant graphical variation (ainsi, insi, einsi for thus, for instance), it also identifies tokens that do not serve to delimit coherent syntactic units. Indeed, for example, the coordinating conjunction *et* (*and*) is a good delimiter of clauses and sentences, but it also serves to coordinate elements within the same syntactic units.

Let's have a look at the following two sentences:

* "dont n'est a il mie merveille, se vos en estes couroucie et je vos pri que vos me diez que ce est" [so it is not a surprise if you are angry and I beg you to tell me for what]: the conjunction *et* (*and*) coordinates two propositions and can be used as a delimiter;

* "si me parti ier matin dolante et couroucie" [I left yesterday morning sad and angry]: the conjunction coordinates two adjectives; it must not be used as a delimiter.

This is why the use of language models for identifying delimiters seemed relevant. Indeed, these models allow for capturing the semantics of different tokens, and thus differentiating the uses of the same words. It was decided to use AutoModelForTokenClassification BERT models [20], with the aim of identifying tokens that can serve as delimiters of these textual units. These models are usually trained on contemporary languages, but, as we will see, the large amount of data used to train them allows for good generalization and good results on our ancient language states.<fnref n="5" />

To produce specific training data for our corpus, tokens identified as delimiters were labeled with the value 1, all other tokens with the value 0, based on human evaluation and a specific set of grammatical rules.<fnref n="6" />

### 2.1.2. Segmenter train corpus

The models were trained on three languages: French, Castilian and Italian, in their medieval forms. The medieval Castilian corpus comprises around 8,000 tokenised lines (about 36,200 words), half of which are various texts from the 13th to 15th centuries, retrieved from the CORDE linguistic database [23]. The other half of the corpus consists of fragments taken from the *Lanzarote*, which are not included in the corpus dealt with in this paper. The French and Italian models were trained solely on data from the *Lancelot*, which is debatable from a model generalization perspective but was motivated by the desire to quickly achieve effective models for our texts. They were trained on 12,700 and 28,000 words (1,000 and 1,500 lines),

<footnote n="5">⁵The models which were used are: for the Castilian, the BETO model [21]; for the French and for the Italian, the models from the MDZ Digital Library [22].</footnote>

<footnote n="6">⁶We retain a certain number of specific tokens, such as coordinating conjunctions between two clauses, relative pronouns, certain adverbs that begin sentences or clauses, etc., trying to segment appropriately without over-segmenting, for example, when two delimiter tokens appear consecutively (in the clause "et qui trop bien se defren-doient", we only retain the conjunction *et*).</footnote>
respectively. The difference in the number of words required to produce convincing models is due to the size of the initially used BERT models (the French BERT model is much larger as it was trained on a much larger dataset, making it more efficient for the given task).

### 2.1.3. Results

The results of the best segmentation models are presented in Table 2, Table 3 and Table 4, one for each language, according to classic measures of accuracy, precision, recall, and F1 score<fnref n="7" />. Each table displays the results of a model established using regex and a BERT-based model. The results show a substantial improvement in the text segmentation task, thanks to the use of a BERT-based model compared to the use of simple regexes.

The best model for each language is chosen on the basis of a weighted average between precision and recall, on a test corpus that has never been used for training. Given the whole workflow, recall is the important metric. It's more important to identify as many true delimiters as possible than to be precise in identifying delimiters. This is because the alignment phase that follows enables the alignment units to be merged, thereby compensating for false positives. Conversely, false negatives (failure to identify a delimiter) will not be compensated for later on, and will lead to an alignment of poorer quality. In view of this, it was decided to produce a weighted average between recall and precision for the selection of the best model, and to assign a weight of 2 to recall, and 1 to precision. Accuracy is high because it computes the total number of correct label assignments, both for labels 0 (non-delimiter tokens) and 1 (delimiter tokens), across the texts.

It is the second label, “Delimiter”, corresponding to the results of identifying tokens labeled 1, that is relevant. Between the F1 scores of the regex and BERT-based models, we observe a significant improvement, with an increase of over 0.20 for French, 0.24 for Italian, and 0.23 for Spanish. Our models thus successfully segment the text according to a syntactic (and semantic) logic.<fnref n="8" />

<caption>**Table 2**</caption>

French model results of the segmentation models

<table><thead><tr><th></th><th colspan="2">Regexp</th><th colspan="2">BERT-based</th></tr></thead><tbody><tr><th>Accuracy</th><td colspan="2">0.954</td><td colspan="2"><strong>0.984</strong></td></tr><tr><th></th><th>None</th><th>Delimiter</th><th>None</th><th>Delimiter</th></tr><tr><th>Precision</th><td>0.940</td><td>0.812</td><td><strong>0.990</strong></td><td><strong>0.874</strong></td></tr><tr><th>Recall</th><td>0.978</td><td>0.611</td><td><strong>0.978</strong></td><td><strong>0.941</strong></td></tr><tr><th>F1-score</th><td>0.959</td><td>0.670</td><td><strong>0.984</strong></td><td><strong>0.906</strong></td></tr></tbody></table>

We can see a short example of the segmentation produced by both methods:

**BERT-based:** *et bien paroit a ses iauz* [SEP] *qu'ele avoit rouges et anflez* [SEP] *qu'ele eust ploré*

<footnote n="7">⁷The evaluation was performed on test sets consisting of 4,300 words in Spanish, 1,340 words in French and 2,500 words in Italian.</footnote>

<footnote n="8">⁸Due to the small size of the training corpus, it was decided to produce adhoc models for each of the languages in the corpus. A multilingual model with language metadata injection experiments will be produced and evaluated in an article dedicated to segmentation. These results provide a baseline for future in-depth studies.</footnote>
<table><caption>**Table 3**
Italian model results</caption><thead><tr><th></th><th colspan="2">Regexp</th><th colspan="2">BERT-based</th></tr></thead><tbody><tr><th>Accuracy</th><td colspan="2">0.961</td><td colspan="2"><strong>0.983</strong></td></tr><tr><th></th><th>None</th><th>Delimiter</th><th>None</th><th>Delimiter</th></tr><tr><th>Precision</th><td>0.937</td><td>0.711</td><td><strong>0.981</strong></td><td><strong>0.827</strong></td></tr><tr><th>Recall</th><td>0.971</td><td>0.523</td><td><strong>0.976</strong></td><td><strong>0.866</strong></td></tr><tr><th>F1-score</th><td>0.954</td><td>0.602</td><td><strong>0.978</strong></td><td><strong>0.846</strong></td></tr></tbody></table>

<table><caption>**Table 4**
Castilian model results</caption><thead><tr><th></th><th colspan="2">Regexp</th><th colspan="2">BERT-based</th></tr></thead><tbody><tr><th>Accuracy</th><td colspan="2">0.951</td><td colspan="2"><strong>0.981</strong></td></tr><tr><th></th><th>None</th><th>Delimiter</th><th>None</th><th>Delimiter</th></tr><tr><th>Precision</th><td>0.942</td><td>0.688</td><td><strong>0.981</strong></td><td><strong>0.869</strong></td></tr><tr><th>Recall</th><td>0.962</td><td>0.584</td><td><strong>0.982</strong></td><td><strong>0.863</strong></td></tr><tr><th>F1-score</th><td>0.952</td><td>0.632</td><td><strong>0.981</strong></td><td><strong>0.866</strong></td></tr></tbody></table>

Regex: et bien paroit a ses iauz qu'ele avoit rouges [SEP] et anflez qu'ele eust ploré

The regex segmentation cut the sentence once, in the middle of a phrase ("rouges et an-flez" that is "red and swollen"), whereas the BERT-based segmentation correctly segments the sentence twice, in accordance with the grammatical structure, based on relative pronoun and subordinative conjunction (qu'). The method chosen also has an influence on segment size, which is not shown in the evaluation above, and which has an impact on the quality of the alignments produced, in favor of the BERT-based method, as we'll see below.

## 2.2. Alignment

Once the BERT-based models are trained and selected, they are integrated into the alignment workflow, producing text segmentation based on the recognition of the good delimiters, before the actual alignment phase. As stated above, Bertalign is used to perform the alignments<fnref n="9" />. The alignment is carried out on the basis of a main/pivot witness chosen in advance on the basis of philological knowledge, that is, Micha [12]. This pivot witness is compared with each of the others, and the alignments are merged. To create the merged alignments table we make use of a graph method to connect each pair of aligned segment and create the final alignment unit, while conserving the 1 to many and many to one alignments. Considering each aligned pair as connected nodes in a graph, it is possible to build up complete alignment units by connecting all nodes together thanks to the pivot fragment<fnref n="10" /> (figures 1 and 2).

<footnote n="9">⁹The parameters we used are the following: max-align=3, window=5, skip=-.2, margin=True, lenpenality=True.</footnote>

<footnote n="10">¹⁰As with all methods using a pivot witness, alignment units in which the pivot omits text (omission or innovation of other branches) must be handled subsequently. Indeed, if the base witness is omitted, the link between the other witnesses is unknown. They must therefore be re-injected, which would require to design a second round of alignment that would change the base witness on the omitted parts. This work has yet to be produced,</footnote>
<figure><img src="image_3.png" /><figcaption>**Figure 1:** Getting pairs of aligned fragments</figcaption></figure>

<figure><img src="image_4.png" /><figcaption>**Figure 2:** Merging the pairs into a single alignment unit by connecting all the nodes</figcaption></figure>

### 2.2.1. Alignment evaluation

To assess the impact of the chosen segmentation method on alignment, we conducted an evaluation of the alignment produced by each of the two methods (regex and BERT-based segmentation).

**Description of alignment results** The evaluation is based on correcting the alignments obtained (correcting the alignment table of indices). Given that segmentation varies between different segmenters, the correction process must be repeated for results from both BERT-based segmentation and regex segmentation. Table 5 shows some alignment results with the fragment iv-75-1 (see also Appendix D, Table 11).

These results present the same alignment error in *Lancelloto* and BnF fr. 111, but due to two different causes: in the case of the *Lancelloto*, the error can be attributed to the segmentation phase, where the segmenter saw a single unit and did not separate between “*consiglio*” and “*chi*”. In the case of BnF fr. 111, segmentation was done properly, but the error was produced in the alignment phase, where the two units were regrouped.

**Evaluation** Alignments are evaluated on the basis of the Alignment Error Rate (AER) [24, 2.6, p. 21]:

$$AER = 1 - \frac{2 \times |L \cap L_{\text{gold}}|}{|L| + |L_{\text{gold}}|}$$

but it concerns a small number of alignment units only.
<caption>**Table 5**</caption>

Example of alignment automatically produced, with regex segmentation on the segment iv-75-1 (small extract). The meaning of the passage is "...that I would remedy it as I can". We can see an alignment error with witness BnF fr. 111.

<table><thead><tr><th>micha</th><th>lancellotto</th><th>fr333</th><th>inc</th><th>fr111</th><th>fr751</th><th>sommer</th><th>lanzarote</th></tr></thead><tbody><tr><td>que j'i<br>metroie<br>volentiers<br>tout le bon<br>conseil</td><td>e tutto il<br>buon con-<br>siglio <b>ch'i</b><br><b>potrei</b></td><td>que ie i<br>metroie<br>uolenters<br>tot le bon<br>conseil</td><td>que ie y met-<br>troie tout le<br>meilleur con-<br>seil</td><td>car ie y<br>mectroye<br>uouleniers<br>tout le con-<br>seil<br><b>que ie<br>pourroye</b></td><td>et uolentiers<br>i metroie<br>tout le bon<br>conseil</td><td>que ie y me-<br>teroie volen-<br>tiers tout le<br>bon conseil</td><td>que os<br>porne todo<br>el mejor<br>consejo</td></tr><tr><td>que je por-<br>roie</td><td></td><td>que ie por-<br>roie</td><td>que ie pour-<br>roie</td><td></td><td>que ie i por-<br>roie mestre</td><td>que iou<br>y porroie<br>mettre</td><td>que yo<br>pudiere</td></tr></tbody></table>

Where L and $L_{gold}$ consist of predicted and hand-corrected links. The evaluation is conducted on indices by comparing automatically generated indices with corrected ones. As the alignment is produced for each witness compared to the pivot witness, an AER is produced for each pair, and Table 6 presents the average of those in order to have an overall value for each evaluated segment of text.

We distinguish between two types of results: results that consider incorrect alignments due to segmentation issues, and those that do not. The evaluation is performed on different parts of the text, each with varying numbers of alignment units.

<caption>**Table 6**</caption>

Alignment Error Rate with LaBSE, excluding or including segments that were not properly segmented. The numbers of evaluated segments are in the "Nb of segm." columns. Numbers in bold are detailed *infra* (improvement of the results with BERT-based segmentation for ii-48 and ii-61-1 sections but not for the iv-75-1 one).

<table><thead><tr><th rowspan="2">fragment</th><th colspan="2">Regex-segm.</th><th rowspan="2">Nb of segm.</th><th colspan="2">Bert-segm.</th><th rowspan="2">Nb of segm.</th></tr><tr><th>well segmented</th><th>all</th><th>well segmented</th><th>all</th></tr></thead><tbody><tr><td>ii-48</td><td>0.13</td><td>0.16</td><td>71</td><td><b>0.11</b></td><td><b>0.15</b></td><td>112</td></tr><tr><td>ii-61-1</td><td>0.30</td><td>0.38</td><td>136</td><td><b>0.26</b></td><td><b>0.32</b></td><td>152</td></tr><tr><td>ii-61-2</td><td></td><td></td><td></td><td>0.15</td><td>0.18</td><td>101</td></tr><tr><td>iv-75-1</td><td><b>0.24</b></td><td>0.33</td><td>120</td><td><b>0.27</b></td><td>0.32</td><td>169</td></tr><tr><td>iv-75-2</td><td></td><td></td><td></td><td>0.25</td><td>0.26</td><td>102</td></tr></tbody></table>

We observe a systematic improvement between the results that consider erroneous segmentation and those that do not, both for regex segmentation and BERT-based segmentation. Several sections of text were evaluated using both methods, revealing a slight overall improvement in results with BERT-based segmentation.

It is important to note that the quality of alignment varies depending on the textual proximity among versions in each witness. For example, there is a gap (0.15) between the results for sections ii-48 and ii-61-1, which can be attributed to varying lacunas and omissions observed in several witnesses for the latter.<fnref n="11" />

<footnote n="11">¹¹For example, *Lancellotto* doesn't present the text for the beginning of Agloval episode, that leads to a poor alignment, because around 20 alignment units are not present in this witness.</footnote>
Moreover, the poor results observed for the iv-75-1 section (better results are observed for regex segmentation than for BERT-based segmentation) can be attributed to numerous instances of missing correspondence among several witnesses, reflecting divergent traditions with frequent omissions. In this context, regex segmentation, generating fewer segments (669 compared to 797 in this case), yields better alignment. This is because these segments consolidate more units, potentially accommodating omissions that might affect other segments. In contrast, BERT-based segmentation, which offers finer granularity, tends to make more errors.

There is indeed a notable difference in alignment results due to the size of the produced data: regex segmentation generates less segments, i.e., aligned units, as illustrated in Figure 3.

<figure><img src="image_5.png" /><figcaption>**Figure 3:** Number of tokens per segment (aligned units, left) and unit (small units automatically produced by the segmenter, right). BERT-based segmentation produces units with a more stable number of tokens and thus yields more semantically coherent aligned segments.</figcaption></figure>

BERT-based segmentation results in a significantly higher number of segments containing 3 to 14 tokens (even until 21 tokens), which correlates with the higher total number of segments obtained with this method. Conversely, regex segmentation produces more segments with a higher number of tokens (more than 30), as well as segments with one or two token(s). These segments are either too large to facilitate accurate alignment or too small to maintain semantic coherence. Thus, alignment tends to be of better quality with the BERT-based method for stemmatologic purposes.

Correlatively, the size of the units (the units produced by the segmentation) within the segments changes, as we can see from the figure 3. With the regex segmentation, there is a high number of very small units containing only one, two, or three tokens. In contrast, there are more units containing 5 to 8 tokens with BERT-based segmentation. As the units in regex segmentation are very short, they are grouped easily into segments. If this facilitates better results for the highly variable parts of text we described above, this approach results in a generally poor alignment, whereas BERT-based segmentation produces fewer segments with more semantically consistent units. If the results from the AER are not very promising, we can assume that the BERT-based segmentation produces a more coherent segmentation that positively impacts the alignment task. It is important to note that AER is a good metric for evaluating the quality of an alignment, but that it is not sufficient. Indeed, a text can be split into only three
parts and have a low AER, if the splits are correct, whereas this kind of result would not allow for any meaningful exploitation of the data. On the contrary, the evaluation of the distribution of units and segments lengths shows that BERT-based segmentation provides more coherent elements to align.

## 2.3. Classification in variants

### 2.3.1. Method

Most stemmatological and phylogenetic algorithms need features (i.e. variants) that are arbitrarily coded (usually, using letters or numbers), e.g. variant 1, variant 2, etc. [25] In our case, this necessitates, for each alignment unit, to cluster the readings from every witnesses into sets of relevant clusters (Table 7). The number of these clusters can vary from 1 (all witnesses have the same variant) to a maximum number equal to the total number of witnesses (each witness bears a different variant).

<caption>**Table 7**</caption>

Table showing an aligned portion of text for each witness, and its numerically coded classification in variants by both annotators (here in agreement) and a clustering algorithm. The main opposition here is between “heard” (oy, udito,...) and “done” (fait), and an omission. An OCR mistake (“or” for “oi”) in part prevents a correct clustering by the algorithm.

<table><thead><tr><th>Witness</th><th>Aligned text</th><th>Ann. 1</th><th>Ann. 2</th><th>DBScan</th></tr></thead><tbody><tr><td>Micha</td><td>qu'il avoit or</td><td>1</td><td>1</td><td>4</td></tr><tr><td>Sommer</td><td>quil auoit oy</td><td>1</td><td>1</td><td>1</td></tr><tr><td>fr751</td><td>quil auoit fait:</td><td>2</td><td>2</td><td>2</td></tr><tr><td>fr111</td><td>quil auoit ouy</td><td>1</td><td>1</td><td>1</td></tr><tr><td>inc</td><td></td><td>0</td><td>0</td><td>0</td></tr><tr><td>lanzarote</td><td></td><td>0</td><td>0</td><td>0</td></tr><tr><td>lancellotto</td><td>ch'elli avea udito</td><td>1</td><td>1</td><td>3</td></tr></tbody></table>

As such, this task is an unsupervised clustering task, where the number of desired clusters cannot be known in advance, which excludes most clustering methods (such as, for instance, k-means or k-medoids). For this reason, we choose an unsupervised density-based clustering method, DBScan (Density-based spatial clustering of applications with noise [26]), that we apply to the cosine distances between each witness, for each alignment unit, in the embedding.

DBScan tries to find dense clusters of points, i.e., points with a given minimum number of neighbours (*MinPts*) situated at a given maximum distance (ε). If DBScan does not necessitate to set the number of clusters, it requires the setting of the two parameters *MinPts* and ε. These parameters can only be chosen contextually, in relation to the number of individuals (witnesses) and the distances between them. For the *MinPts*, we set it at 1, given the small number of witnesses. For ε, we follow a methodology called DMDBScan, that tries to identify relevant values, by first computing the minimum distances to the *MinPts* nearest points, and then plotting them by ascending order to identify values for at which there are sudden sharp changes in the minimum distances, possibly revealing different densities [27]. Following this methodology, we set ε at 0.2 (Appendix F).
<table><caption>**Table 8**
Mean Adjusted Rand Index</caption><thead><tr><th></th><th>Ann. 1</th><th>Ann. 2</th><th>DBScan</th></tr></thead><tbody><tr><th>Annotator 1</th><td>1</td><td></td><td></td></tr><tr><th>Annotator 2</th><td>0.70</td><td>1</td><td></td></tr><tr><th>DBscan</th><td>0.04</td><td>0.04</td><td>1</td></tr></tbody></table>

DBScan is applied to the cosine distances between the readings of the witnesses in the embedding. Yet, due to the multilingualism of the corpus, and the important spelling variation characteristic of medieval language, some distances are artificially increased not for semantic reasons but because of formal bias. To correct for this bias, a weighting is applied to all distances prior to performing clustering, according to:

$$ weightedDist(a_i, b_i) = \frac{\text{dist}(a_i, b_i)}{\frac{1}{2}(\mu(\text{dist}(a, n)) + \mu(\text{dist}(b, n)))} $$

where *a* and *b* are two witnesses, and *i* a given alignment unit, and where $\mu(\text{dist}(a, n))$ is the arithmetic mean of the distance between *a* and all other witnesses for all segmentation units.

### 2.3.2. Results and evaluation

In order to evaluate the results of clustering, we compare the clustering performed by DBScan to that of the two human annotators (the first two authors of this paper), and compute the mean Adjusted Rand Index (ARI), whose value is contained between -1 and +1, where -1 denotes a complete opposition, 1 a complete agreement, and 0 a case where both clustering appear to have been independently randomly labelled.

We compare the mean ARI between the two human annotators and the DBScan result. The results are presented in Table 8. The score is very low for the DBscan results, especially compared to the correspondance between the human annotators. Yet, it does not necessarily mean that the clustering results do not yield significant genealogical information to be processed by the stemmatological algorithms, as will be seen in the next section.

## 3. Results of the stemmatological analysis

The alignment tables we obtained through the BERT-based segmentation and the alignment phase enable philological analysis. It was performed in two distinct ways: first, a traditional stemmatic analysis, based on human expertise, was performed. Then, the variants resulting from the human annotations and the DBScan clustering were subjected to stemmatological algorithms, and the results were compared.

### 3.1. Human-identified witness groups

We decided first to evaluate the links between the witnesses, based on the alignment tables and human close reading expertise (ours, and that of previous philologists having worked on
this topic). Each one of the witnesses we chose presents particular readings (subsection E.1). However, we can distinguish two main groups within the tradition. On one hand, the witnesses Micha, BnF fr. 751, BnF fr. 111 and *Lancellotto*, and on, the other hand, Sommer, the incunable, and *Lanzarote*. They can be determined on the basis of omissions or distinct reading groups (subsection E.2). The oppositions between the two groups are quite frequent and stable.

Nevertheless, *Lanzarote* has common readings with the first group and sometimes oscillates between the readings of the two groups (subsection E.3). In fact, the text in the *Lanzarote* presents a quite original version, especially due to the shortened passages it contains (subsec-tion 1.2). It also often offers specific readings and innovations, particularly when the translation presents cases of direct speech instead of basic narration (subsection E.4).

The text of the *Lancellotto* doesn't show such originality. On the contrary, it is very close to the French text, using many gallicisms [7, p. 43-44]. It also stays very close to its own group. It shares particular common readings with BnF fr. 111, as well as several omissions. How-ever, sometimes, *Lancellotto* knows a common reading with Micha against BnF fr. 111 (subsec-tion E.5). The *Lancellotto* also shows some innovations that prove that the very model of the translation is one not part of our selection (subsection E.6).

We can assume that the witnesses we studied belong to two main groups, and that the wit-nesses that interest us, the *Lanzarote* and the *Lancellotto*, each fall into one of these groups. However, the specific variants and innovations found in each witness do not allow the identi-fication of a specific model or the determination of a more precise affiliation.

The identification of groups confirms the filiation between BnF fr. 111 and *Lancellotto* [7], but does not confirm the specific link between BnF fr. 751 and *Lanzarote*. It is important to note that BnF fr. 751 is really unstable. Indeed, if it shares most of its readings with the first group, in the variants we studied, it also has its own unique readings.

**3.2. Results of the stemmatological algorithm**

The second approach applies a well known phylogenetic algorithms to the table of variants produced by the two human annotators, and the one produced by the DBScan clustering. The chosen algorithm is the Branch and bound algorithm, whose goal is to determine minimal evolutionary trees by the criterion of maximum parsimony [28]. This algorithm can produce one or several trees, if different configurations achieve the same maximum parsimony value. The trees resulting from the analyses are presented in Figure 4.

The trees resulting from the tables produced by the human annotators present, unsurpris-ingly, strong similarities with the result of the human close reading expertise on the genealogy. In particular, they all display the groupings {*Lanzarote*, Sommer, Incunabula} versus {Lancel-loto, Micha, fr. 751 and fr. 111}. The second and third alternative trees from Annot. 2 also show the grouping of *Lancelloto* and fr. 111, already observed by the editor of the *Lancelloto* [9], but only the third tree from Annot. 2 shows the stronger similarity between fr. 751 and *Lanzarote*, that was hypothesised by its editor [8].

In comparison, the results based on the DBScan do not show fully the opposition {Lanzarote, Sommer, Incunabula} versus {Lancelloto, Micha, fr. 751 and fr. 111}, because Sommer switches families. Yet, it provides results more consistent with the analyses of the editors of the *Lan-zarote*, that is positioned close to the fr. 751 [8], while *Lancelloto* remains relatively close to
<figure><img src="image_6.png" /><figcaption>Unrooted alternative tree - Annotator 2</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Unrooted alternative tree - Annotator 2</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>Unrooted alternative tree - Annotator 2</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>Unrooted single tree - DBScan</figcaption></figure>

<figure><img src="image_10.png" /></figure>

**Figure 4:** Results of the Branch and bound algorithm on the variant tables produced by the two human annotators and the DBScan clustering. The parsimony values are, for the first annotator, 104; for the second, 135; for the DBScan results, 292.
fr. 111.

If the results obtained from the automatic clustering of variants differ from the expertise of the human annotators, on the other hand the genealogical results do not necessarily contradict previous expertise, and seem to remain significant up to a point. Deciding whether the human annotators or the clustering have provided the most useful data remains to be fully assessed, but current results indicate that, even if the clustering differs in terms of classification of readings from human annotation (as shown by the mean Adjusted Rand Index), the results obtained through stemmatological analysis still remain indicative.

## 4. Conclusion

We've designed a tool that can facilitate the study of unilingual and multilingual variant traditions, and its stemmatological analysis. The results obtained through clustering and stemmatological analysis tend to show that an automatic clustering of variants and the application of a phylogenetic algorithm can quickly produce results that are indicative of the genealogy of witnesses, and comparable to some extent to a traditional human expertise.

Yet, in the current state, many aspects of the processing workflow could still be improved, especially if the results of the automatic alignment and collation were to be used for scholarly editing purposes.

As far as segmentation is concerned, the delimiter tokens are those that reliably identify coherent grammatical segments (relative pronouns, coordinating conjunctions between clauses, and subordinating conjunctions, etc.). This is a problem for all sentences that begin with personal pronouns, articles, or nouns and not with the markers listed above. Therefore, we need to produce more segmented data to be able to distinguish all these complex cases.

As for the alignment step, we show that LaBSE's sentence embeddings model works surprisingly well on medieval language states. Still, there is room for improvement and some fine-tuning of LaBSE model on aligned medieval texts should improve the results. Variant clustering should also benefit from this fine-tuning. However, it will be a complex and time-consuming task, because of the required data, that is aligned texts: this step is planned for the future. Another important step will be microscopic alignment, which involves further work on modeling the alignment process, because it differs quite significantly from the alignment of monolingual texts, particularly with regard to the variations in the word order in the target sentence and in the source sentence. The micro-alignment could allow also more precise results in the stemmatological step.

## Materials and code availability

The tool for alignment and collation is freely available on Zenodo:10.5281/zenodo.12732533 and is maintained on github: https://github.com/ProMeText/Aquilign/. The result data can be found in the results_dir directory. The segmenter train corpus is available in the subfolder: data/tokenisation. The data and scripts for clustering and stemmatological analysis are available on a specific Zenodo repository: 10.5281/zenodo.12728282.
Acknowledgments

Co-funded by the *Agence Nationale de la Recherche* under the Équipex Biblissima+ (ANR, 21-ESRE-0005).

<figure><img src="image_11.png" /></figure>

<figure><img src="image_12.png" /></figure>

Co-funded by the European Union (ERC, LostMA, 101117408). Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council. Neither the European Union nor the granting authority can be held responsible for them.

The authors additionally wish to thank Florian Cafiero for his thoughts on this research.

References

[1] F. Steven R., The Complete Medieval Dreambook. A Multilingual, Alphabetical Somnia Danielis Collation, Ph.D. thesis, University of Michigan, 1978.

[2] L. Bambaci, F. Boschetti, R. Del Gratta, Qohelet Euporia: A Domain Specific Language to Annotate Multilingual Variant Readings, in: 2018 IEEE 5th International Congress on Information Science and Technology (CiSt), 2018, pp. 266–269. doi:10.1109/CIST.2018.8596332.

[3] G. Scala, La Tradizione Manoscritta Del "Livre Du Gouvernement Des Roys et Des Princes" Di Henri de Gauchy. Studio Filologico e Saggio Di Edizione, Ph.D. thesis, University of Zurich, 2021. doi:10.5167/UZH-202620.

[4] J. Tronch, Displaying Textual and Translational Variants in a Hypertextual and Multilingual Edition of Shakespeare's Multi-text Plays, in: L. Estill, D. K. Jakacki, M. Ullyot (Eds.), Early Modern Studies after the Digital Turn, number 502 in Medieval and Renaissance Texts and Studies, Iter Press, Toronto, Ontario, 2016, pp. 92–116.

[5] IRHT, Jonas: Répertoire des textes et des manuscrits médiévaux d'oc et d'oïl, 2016. URL: http://jonas.irht.cnrs.fr/.

[6] L. Brun, Arlima - Archives de littérature du Moyen Âge, 2005. URL: https://www.arlima.net/.

[7] L. Cadioli (Ed.), Lancellotto: versione italiana inedita del Lancelot en prose, Edizioni del Galluzzo, Firenze, 2016.

[8] A. Contreras Martín, H. L. Sharrer (Eds.), Lanzarote del Lago, Centro de estudios cervantinos, Alcalá de Henares, 2006.

[9] L. Cadioli, Le Lancellotto italien, in: La matière arthurienne tardive en Europe, 1270-1530 = Late Arthurian Tradition in Europe, Presses universitaires de Rennes, Rennes, 2020, pp. 501–510.

[10] H. O. Sommer (Ed.), The Vulgate Version of the Arthurian Romances, volume 4, Le Livre de Lancelot del Lac, part II, Carnegie Institution of Washington, Washington, 1911.

[11] H. O. Sommer (Ed.), The Vulgate Version of the Arthurian Romances, volume 5, Le Livre de Lancelot del Lac, part III, Carnegie Institution of Washington, Washington, 1912.

[12] A. Micha (Ed.), Lancelot: roman en prose du XIIIe siècle. Tome II, Droz, Genève, 1978.

[13] A. Micha (Ed.), Lancelot: roman en prose du XIIIe siècle. Tome IV, Droz, Genève, 1979.
[14] D. J. Birnbaum, H. M. Eckhoff, Machine-Assisted Multilingual Alignment of the old church slavonic Codex Suprasliensis, in: S. M. Dickey, M. R. Lauersdorf (Eds.), V Zeleni Drželi Zeleni Breg, Bloomington, Indiana, 2018, pp. 1–15. URL: https://www.researchgate.net/profile/Nada-Sabec/publication/371120502_Toward_Less-Formal_Ways_of_Addressing_the_Other_in_Slovene/links/6473967b59d5ad5f9c803dac/Toward-Less-Formal-Ways-of-Addressing-the-Other-in-Slovene.pdf.

[15] C. Meinecke, D. J. Wrisley, S. Jänicke, Automated Alignment of Medieval Text Versions Based on Word Embeddings, preprint, Open Science Framework, 2020. doi:10.31219/osf.io/tah3y.

[16] D. Witschard, I. Jusufi, R. M. Martins, K. Kucher, A. Kerren, Interactive Optimization of Embedding-Based Text Similarity Calculations, Information Visualization 21.4 (2022). doi:10.1177/14738716221114372.

[17] L. Liu, M. Zhu, Bertalign: Improved Word Embedding-Based Sentence Alignment for Chinese-English Parallel Corpora of Literary Texts, Digital Scholarship in the Humanities 38.2 (2023) 621–634. doi:10.1093/llc/fqac089.

[18] M. Artetxe, H. Schwenk, Massively Multilingual Sentence Embeddings for Zero-Shot Cross-Lingual Transfer and Beyond, Transactions of the Association for Computational Linguistics 7 (2019) 597–610. doi:10.1162/tac1_a_00288.

[19] O. Kraif, Adaptative Bilingual Aligning Using Multilingual Sentence Embedding, preprint, arXiv, 2024. URL: http://arxiv.org/abs/2403.11921.

[20] T. Wolf, L. Debut, V. Sanh, J. Chaumond, C. Delangue, A. Moi, P. Cistac, T. Rault, R. Louf, M. Funtowicz, J. Davison, S. Shleifer, P. v. Platen, C. Ma, Y. Jernite, J. Plu, C. Xu, T. L. Scao, S. Gugger, M. Drame, Q. Lhoest, A. M. Rush, Transformers: State-of-the-Art Natural Language Processing, in: Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, Association for Computational Linguistics, Online, 2020, pp. 38–45. URL: https://www.aclweb.org/anthology/2020.emnlp-demos.6.

[21] J. Cañete, G. Chaperon, R. Fuentes, J.-H. Ho, H. Kang, J. Pérez, Spanish Pre-Trained BERT Model and Evaluation Data, in: PML4DC at ICLR 2020, 2020, pp. 1–9. URL: https://arxiv.org/abs/2308.02976.

[22] S. Schweter, Europeana BERT and ELECTRA models, 2020. doi:10.5281/zenodo.4275044.

[23] M. Sánchez Sánchez, C. Domínguez Cintas, El banco de datos de la RAE: CREA y CORDE, Per Abbat: boletín filológico de actualización académica y didáctica (2007) 137–148. URL: https://dialnet.unirioja.es/servlet/articulo?codigo=2210249.

[24] J. Tiedemann, Bitext Alignment, Synthesis Lectures on Human Language Technologies, 1 ed., Morgan & Claypool Publishers, 2011. URL: http://gen.lib.rus.ec/book/index.php?md5=7fb8c6d1d4e8924f79a03026e23b6517.

[25] F. Cafiero, J.-B. Camps, Stemmatology: An R package for the computer-assisted analysis of textual traditions (????).

[26] M. Ester, H.-P. Kriegel, J. Sander, X. Xu, et al., A density-based algorithm for discovering clusters in large spatial databases with noise, in: kdd, volume 96-34, 1996, pp. 226–231.

[27] M. T. Elbatta, W. M. Ashour, A dynamic method for discovering density varied clusters, International Journal of Signal Processing, Image Processing and Pattern Recognition 6.1
(2013) 123–134.

[28] M. D. Hendy, D. Penny, Branch and bound algorithms to determine minimal evolutionary trees, Mathematical biosciences 59.2 (1982) 277–290.

# Appendices

## A. Witnesses

• lancellotto: *Lancellotto*, italian witness, edited by Luca Cadioli (cf. bibliography). Firenze, Biblioteca della Fondazione Ezio Franceschini, 1 (last quarter of the 14th century).

• lanzarote: *Lanzarote*, castillan witness, edited by Antonio Contreras Martín and Harvey L. Sharrer (cf. bibliography).
Madrid, Biblioteca Nacional de España, 9611 (16th, copy of a manuscript dated from 1414).

• sommer: edition of H. Oscar Sommer (cf. bibliography).
Tomes IV and V: London, British Library, Additional 10293 (beginnings of the 14th century).

• micha: edition of Alexandre Micha (cf. bibliography).
Tome II: Cambridge, Corpus Christi College Library, 45 (2nd half of the 13th century).
Tome IV: Oxford, Bodleian Library, Rawlinson D. 899 (14th century).

• fr111:
BnF, français 111 (15th century).

• fr333:
BnF, français 333 (first quarter of the 14th).

• fr751:
BnF, français 751 (2nd part of the 13th century).

• inc:
BnF, RES-Y2-46 (vol. 1) and RES-Y2-47 (vol. 2) (Printed in Rouen [vol. 1, by Jean le Bourgois] and Paris [vol. 2, by Jean Dupré] in 1488).

## B. Witnesses and segments of text

The *Lancellotto* is particularly fragmentary. Only the sections of the text corresponding to these fragments were studied.

According to Micha, its corresponds to the sections: II, XLVIII 29 – L 11; II, LXI 26 – LXIX 23; IV, LXX 1 – LXXXI 17. But, for the last, the *Lanzarote* omitted the text and starts at IV, LXXV, with a very reduced portion in LXXX 16 to 43. Thus, the studied section of text starts at IV, LXXV.

We indicated here the witnesses and the folios where the segments of the text can be found.
<table><thead><tr><th>Lancellotto</th><th>Lanzarote</th><th>Sommer</th><th>Micha</th><th>proper name</th><th>id</th><th>status</th></tr></thead><tbody><tr><td>f. 222r-226v</td><td>f. 203r-218v</td><td>IV, 271-285</td><td>II, XLVIII 29 - L 11</td><td>suite Charrette I</td><td>ii-48</td><td>full</td></tr><tr><td>f. 243r-254vb</td><td>f. 265r-286v to LXVIII, with reduced 8-12</td><td>IV, 327-362</td><td>II, LXI 26-LXIX 23</td><td>suite Charrette II</td><td>ii-61</td><td>without the end in the <i>Lanzarote</i></td></tr><tr><td>f. 254vb-297v</td><td>f. 286v-320v IV, LXXV-LXXX, with LXXX 16 à 43 very reduced</td><td>V, 3-143</td><td>IV, LXX 1-LXXXI 17</td><td>part of Agravain</td><td>iv-75</td><td>without the beginning and the end in the <i>Lanzarote</i></td></tr></tbody></table>

These passages correspond, in the other French witnesses, to:

<table><thead><tr><th>BnF fr. 751</th><th>BnF fr. 333</th><th>BnF fr. 111</th><th>incunable</th><th>id</th></tr></thead><tbody><tr><td>227va-232va</td><td></td><td>138vb-141vb</td><td>Diii.v-Dviii.r</td><td>ii-48</td></tr><tr><td>248va-259va</td><td></td><td>151rb-157vb</td><td>Fiiii.r-Gv.v</td><td>ii-61</td></tr><tr><td>270vb-291rb</td><td>23rb-47va</td><td>170va-183va</td><td>Iviii.v- end vol. 1 (Liiii.v) + vol. 2 beginning to Bv.v</td><td>iv-75</td></tr></tbody></table>

We can note that, as we indicated in the introduction, the fr. 333 only contains the third studied segment and that the text corresponding to the incunabula is contained by two different volumes.

## C. Example of missed section

As example of missed sections of text that can have an impact on the alignment process, we can take the fight in the episode of the hawk (corresponding to the segment ii-61-2).

In Micha's edition, the text is the following (the whole episode is given by all the other studied witnesses):

... tant qu'il viennent en une valee. Et lors li mostre un poi en sus del chemin a senestre la loge dont li chevaliers issi, dont ele se plaint. « Venés avant, fet il, seurement, et se vos veez l'esprevier, si le prenés, ja por nului nel laissiés. Et je vos creant loialment que je le vos garantirai a mon pooir contre tos cels qui le voldront contredire. Et se li espreviers n'i est, si me mostrez le chevalier qui le vos toli
et jel vos ferai amender tot a vostre volenté. — Sire, fet ele, de Dieu aiés vos bone aventure ! Mais je voldroie miels que vos le me poissiés rendre a pes que a guerre. — Par Dieu, fet il, se ie ne le puis avoir par debonaireté, si l'avrai je par force. » Lors sont venu a la loge ; si entre mesire Yvain tos premiers et la damoisele aprés. Et mesire Yvain ne salue nul de cels de laiens, ains dist si haut que tuit le porent oïr : « Damoisele, venés avant et si prenés vostre esprevier, se vos saiens le poez veoir ; si l'enportez ausi a droit com il en fu portez a tort. — Sire, fet ele, volentiers, ausi le voi je la. » Et ele vient a une perche ou il seoit, si li deslie les giés let l'en volt porter, quant uns chevaliers saut avant qui li dist : « Fuiés. damoisele ! Ne le remués, que par mon chief vos n'en porterés point. Et de tant com vos i estes retornee, avés vos del tot vos pas perdus, que vos ne l'enporterés n'en l'une main n'en l'autre ; et se vos volés avoir oisel, si querés autre, kar a cestui ne vos deduirés vos jamés. — Laissiés li, dans chevaliers, fet mesire Yvain, qu'ele l'enportera, et se vos li volés fere force, vos en serés tart al repentir. — Comment ? fet cil. Estes vos ci venus por le deffendre ? — Ce verrois vos bien, fet mesire Yvain, se vos ti tolés. » Et cil giete maintenant le main por le tolir ; et mesire Yvain a trait l'espee et li dist qu'il li coupera le bras, s'il toche plus ne a lui ne a la damoisele. « Voire, fet cil, par mon chief mal le deïstes ! » Lors cort a son hialme et le met en sa teste, et il estoit molt bien armés de tote autre armeure. Maintenant saut en son cheval, kar tos estoit prest, et prent son escu et son glaive et dist a mon seignor Yvain qu'il se gart de lui ; si li laisse corre, son glaive aloigné et mesire Yvain a lui ; si s'entredonent si grans cops sor les escus qu'il les font fendre et percier et les haubers desmaillier et derompre ; si se metent es chars nues les glaives trenchans, si s'entrehurtent des escus et des cors et des visages, si s'entreportent a terre tot enferré. Mesire Yvain est navrés el costé destre et li chevaliers fu ferus par mi le cors si durement qu'il n'a pooir de soi relever de la ou il gist. Et mesire Yvain se redrece a tot le tronçon qui demi li est el costé ; si trait l'espee et s'apareille d'assaillir le chevalier qui le meillor cop li a doné qu'il receust pièce ; et il le cuide tot prest trover de deffendre, si voitqu'il ne se remue, et lors li cort sus et li esrache le hialme de la teste et dist qu'il li coupera le chief sans arest, s'il ne se tient por outré. Et cil parole a grant paine com cil qui molt estoit bleciés, si crie merci et dist : « Ha, frans chevaliers, ne m'ocie mie, mais laisse moi vivretant que j'aie mon Salveor receu, kar je sai bien que je sui navrés a mort ; si vos pri por Dieu que vos alés ci pres desus cest tertre querre un saint home mire qui i maint, et li faites avec lui aporter a corpus Domini. Et il dist que si fera il volentiers ; si commande la damoisele qu'ele s'en aut et ele le fet. Mais ele fet assés greignor duel que devant, kar ele voit I. chevalier ocis et I. autre navré, et por si petit d'acheison. Et mesire Yvain vet querre l'ermite, ensi com li chevaliers li ot dit, et li amaine. Et quant il fu revenus arrieres, si trueve iluec J. escuier et une damoisele qui estoit amie al chevalier et faisoit le greignor duel del monde. Et quant li chevaliers fu confés et il ot receu son Salveor, si le coucha l'en en la loge. Et mesire Yvain s'en vet avec l'ermite et enmaine son cheval en destre, kar a cheval n'i alast il mie delés si haut saintuaire comme Nostre Salveor. Quant il furent venu a l'ermitage que l'en apeloit l'ermitage del Mont, si desarment troi frere qui laiens estoient mon seignor Yvain, et il en i avoit un qui molt savoit de plaies garir; si s'entremist de mon seignor Yvain et s'en prist garde erraument et il osta le tronçon qu'il avoit el costé et s'estanchaé a sainier ; et de cele plaie demora mesire Yvain. XV. jors laiens.

In the *Lanzarote*, the episode is really reduced, since it presents only the following text:

> ... y andubieron tanto que llegaron ala Ramada ado estaua el cauallero y la donzella se lo mostro don yban quando le vio dixole señor cauallero yo vos Ruego que dedes su gauilan aesta donzella quele tomastes o sino enla vatalla sodes el gauilan no se lo dare yo dixo el Cauallero mas dela batalla presto so e luego se dexaron correr el vno contrael otro y el cauallero quebro su lança en don yban y don yban lo firio tan de Reçio quello derribo en tierra todo atordido que no se pudo leuantar e don yban desçendio porle cortar la cabeza mas el le Rogo quele perdonase y que faria todo su mandado y don yban lo dexo y el Cauallero selo agradesço mucho y dio luego el gauilan ala donzella y ella se fue muy alegre conel y don yban se fue ensu demanda

This example shows the need to define what a collatable example is. An abstract is not really alignable with its source, and we need to go through another processing step and not try
alignment. This shows the need to produce solid textual relationship typologies before making text processing decisions.

## D. Example of alignment table

<table><caption>Table 11: Example of good quality alignment taken from ii-48 fragment (selected witnesses, no correction performed), with the BERT-based segmentation. Segments are separated with pipe “|” characters.</caption><thead><tr><th>micha</th><th>fr751</th><th>inc</th><th>lanzarote</th><th>lancellotto</th></tr></thead><tbody><tr><td>mais il voit l'éve noire<br>et parfonde |et si peril-luse</td><td>Mais il uoit leue<br>si parfonde et si<br>perilleuse</td><td>mes il uoit<br>la riuiere<br>parfonde et<br>dangereuse a<br>passer.</td><td>Mas el agua<br>hera muy fonda<br>e peligrosa e<br>negra e bien<br>cuidaua morir</td><td>ma e vede<br>l'acqua nera<br>e profonda e<br>perigliosa</td></tr><tr><td>qu'il cuide bien noier,</td><td>que il cuide bien<br>perir</td><td>et scait bien</td><td></td><td>che crede bene<br>morire</td></tr><tr><td>s'il se met dedens;</td><td>se il se met<br>dedans.</td><td>sil entre de-dens|qu il se<br>met en peril de<br>mort.</td><td>si se y Metiese</td><td>s'elli|si mette di<br>dentro;</td></tr><tr><td>et d'autre part il voit<br>cele</td><td>et dautre part il<br>uoit cele</td><td>Et daultre part il<br>uoit celle</td><td>e dela otra parte<br>veya la donçella</td><td>e d'altra parte e<br>vede colei</td></tr><tr><td>qui si durement crie<br>merci;</td><td>qui si docemet li<br>prie [mer]ci.</td><td>qui si piteuse-<br>ment fui crie<br>mercy.</td><td>que muy afin-<br>cada mente le<br>pedia merçed</td><td>che|si dura-<br>mente gli grida<br>mercé,</td></tr><tr><td>si l'em prent tels pitiés</td><td>Si len prent tes<br>pitiez</td><td>Si luy en prent<br>telle pitie</td><td>e ovo tal piedad<br>della</td><td>si ne gli prende<br>tale piatà</td></tr><tr><td>qu'il en laisse totes<br>poors</td><td>quil en laisse<br>totes paours.</td><td>quil en laisse<br>toute paour</td><td>que le fiço todo<br>el miedo perder</td><td>che ne lascia<br>tutte paure</td></tr><tr><td>et fet le signe de la<br>crois en mi son vis,</td><td>Si fait le signe<br>de la crois enmi<br>son uis.</td><td>et fait le signe<br>de la croix<br>deuant son<br>uisaige</td><td>e fiço la señal<br>dela cruz sobre<br>si</td><td>e si fa el segno<br>della santa<br>croce nel milu-<br>ogo del suo<br>viso,</td></tr></tbody></table>
<table><tr><td>puis enbrace l'escu |et broche le cheval des esperons |et se fiert en l'eve. |Et li chevals fu fors,|si commence a noer</td><td>puis enbrace lescu. |et broche le cheual des esperons|et se fiert en leue tot errantment. |Et li cheuaus fu fors|si comance a noer</td><td>puys embrache son escu |et fiert son cheual des esperens |et se lanche dedens leaue tout erraument: |et le cheual commence a noer</td><td>e enbraço el escudo |e firio al cauallo de las espuelas |e lanço se en el agua e el cauallo començo de nadar luego</td><td>poscia imbracacia lo scudo |e broca il cavallo degli sproni, |si fiede nell'acqua is- nellamente. El cavallo fu forte, incominciò a notare</td></tr><tr><td>si tost com il ot terre perdue,</td><td>si tost com il ot terre perdue</td><td>si tost |quil eust terre perdue.</td><td>e perdio tierra en tal manera</td><td>si tosto com'elli ebbe terra per- duta,</td></tr><tr><td>si l'enporte d'autre part de la rive a quelque paine, |mais ançois ot beu de l'ève li uns et li autre,</td><td>si lenporte dautre part la riue a quelque painne.</td><td>et sen passe le cheual iusques de laultre part de leaue |mes ce fust a grant paine |car ains quilz feussent passes beurent de leaue lun et laultre</td><td>que paso dela otra parte del agua |mas ante beuio el cauallo del agua</td><td>si ne l portò d'altra parte della riva a qualche pena, |'ma inanzi furono amen- duni tutti molli,</td></tr><tr><td>et se li chevals ne fust si buens, |noié fuissent ambedui,</td><td></td><td>et se le cheual neust este fort et bon ilz feussent noyes et lun et laultre</td><td>e si el caballo tan bueno no fuera sin dubda |el moriera enel agua</td><td>e se l cavallo non fosse stato si forte, anegati fossono amenduni,</td></tr><tr><td>kar li chevaliers estoit pesans por les armes</td><td></td><td>car le cheualier estoit fort pes- sant pour les armes</td><td>e boores |porel peso delas ar- mas</td><td>ché l cavaliere era pesante per l'arme</td></tr><tr><td>qu'il avoit vestues.</td><td></td><td>quil auoit uestues.</td><td>que llebaua</td><td>ch'elli avea vestite.</td></tr><tr><td>Quant il fu de l'autre part de l'eve, |si ne de- scendi pas,</td><td>Si ne descendi pas</td><td>Quant il fut de lautre part de leaue |si ne descendist oncques</td><td>e desque fue dela otra Parte del agua dexo se correr aquellos que la donçella tenian</td><td>Quand'e fu da l'altra parte dell'acqua, |si non discende passo,</td></tr></table>
# E. Readings and groups of witnesses

## E.1. Specific readings

In some sections, every witness has its own reading (fragment ii-61-1):

<table><thead><tr><th>micha</th><th>sommer</th><th>fr751</th><th>fr111</th><th>inc</th><th>lanzarote</th><th>lancellotto</th></tr></thead><tbody><tr><td>Puis traist hors de sa char la piece de l'espee qui dedens estoit</td><td>puis traist hors de sa quisse le piece de lespee</td><td>Puis trait la piece de lespee qui en sa char estoit.</td><td>puis trait hors de sa char la piece de lespee</td><td>apres trait hors de sa cuisse lespee</td><td>e despues tiro la pieça dela espada desu pierna</td><td>Poscia trae fuori di sua carne la spada e l'apicca:</td></tr></tbody></table>

## E.2. Examples of readings specific to two main groups

The two main groups can be established from common omissions, for example (fragment ii-48):

<table><thead><tr><th>micha</th><th>sommer</th><th>fr751</th><th>fr111</th><th>inc</th><th>lanzarote</th><th>lancellotto</th></tr></thead><tbody><tr><td>si le font desarmer, ou il volsist ou non, et il le fist a envis,</td><td></td><td>Si le font desarmer uossist ou non. et il le fait mout enuiz.</td><td>si le font desarmer uoulsist il ou non. et il le fist a peine.</td><td></td><td></td><td>si l fanno disarmare o volesse O non, ed elli il fece ad invidia,</td></tr></tbody></table>

We can also identify common variants that systematically oppose group 1 to group 2. In the following table (fragment ii-48), the two variants oppose *shield* to *weapons*, *castle* to *forest*.

<table><thead><tr><th>micha</th><th>sommer</th><th>fr751</th><th>fr111</th><th>inc</th><th>lanzarote</th><th>lancellotto</th></tr></thead><tbody><tr><td>mes il ne portoit mie tel escu</td><td>mais il ne portoit mie tels armes</td><td>mais il ne portoit mie tel escu</td><td>mais il ne portoit pas tel escu</td><td>mes il ne portoit mye telles armes</td><td>mas no traia el tales armas</td><td>ma e' non porta mica tale scudo</td></tr><tr><td>Al chastel, fet ele, de Floego</td><td>En la forest fait elle de floregas.</td><td>Au chastel fait ele de floego.</td><td>ou chastel de fleago fait ella</td><td>En la for est de flo rega:</td><td>enla flo resta de donseglo rega dixo la donçella</td><td>Al castello, diss'ella, di Fleego,</td></tr></tbody></table>
### E.3. Oscillation of *Lanzarote* between two groups

*Lanzarote* belongs to the second group, but presents sometimes readings from the first one, or even a mixed reading, as we can see in the following table (fragment ii-48):

<table><thead><tr><th>lanzarote</th><th>micha</th><th>sommer</th></tr></thead><tbody><tr><td>e el fue alla por aluergar e<br>fallo <b>ala puerta dos</b> frailes</td><td>et il torne cele part por her-<br>bergier. Et quant il i vint, si<br>trueve <b>a la porte IIII.</b> des<br>freres</td><td>si torne cele part pour her-<br>bergier. Et quant il vint la<br>si trouua <b>.ii.</b> freres</td></tr></tbody></table>

The first group, with Micha, is characterized by the mention of the *porte* and the presence of four *freres* whereas the second one, the Sommer's one, is characterized by the absence of the mention of the *porte* and the presence of only two *freres*. The text in the *Lanzarote* presents the mention of a *porte* and only two *freres*.

### E.4. Example of innovation in *Lanzarote*

*Lanzarote* presents some specific innovations compared to the other witnesses in the following table (fragment ii-48):

<table><thead><tr><th>micha</th><th>lanzarote</th></tr></thead><tbody><tr><td>puis voit delés les chevaliers une<br>tombe, la plus riche</td><td>e el asi Catando vio dentro enlos arcos<br>vna muy Rica tumba</td></tr><tr><td>qui onques fust fete par home, kar<br>ele ert tote d'or fin a chieres pierres<br>precioses qui molt valoient miels d'un<br>grant roialme. Se la tumbe fu de grant<br>bialté, nient ne monte la bialté envers<br>la richece dont ele estoit et avec ce es-<br>toit ele la greignor que Lancelos eust<br>onques veue:</td><td>qual nunca tal viera el ni ome del<br>mundo que hera toda de oro fino e<br>de piedras preçiosas que estaua toda<br>labrada de diuersas maneras e de muy<br>muchas cosas de figuras e de otras<br>cosas que tal tumba de tal manera<br>nunca viera ni ome del mundo que la<br>non ouiese visto no podria asmar la fer-<br>mosura que enella auia de tales cosas<br>como enella estauan</td></tr><tr><td>si se merveille molt qui puet estre li<br>princes</td><td>e don lançarote se marauillo e dixo<br>entresi mesmo Quien podria ser el<br>prinçipe</td></tr></tbody></table>

### E.5. Opposition between *Lancellotto* and Micha against BnF fr. 111

We can find a multitude of readings that oppose the group *Lancellotto/Micha* against BnF fr. 111 (fragment ii-61-1), such as the ones in the following table:
<table><thead><tr><th>lancellotto</th><th>micha</th><th>fr111</th></tr></thead><tbody><tr><td>se noi abiamo per miscredenza fallato <strong>qua in adietro</strong></td><td>se nos avons par mescreance foloié <strong>ça en arieres</strong></td><td>se nous avons foloye par mescreance</td></tr><tr><td>... che trastutti cristinivano, si confessò, <strong>udendo</strong> tutto el popolo,</td><td>... que tuit se crestienoient, si reconuit <strong>oiant</strong> tot le pueple</td><td>... que tous se c[re]stieneroit. si cogneut <strong>deuant</strong> tout le peuple</td></tr></tbody></table>

Some variants are more important (fragment ii-48):

<table><thead><tr><th>lancellotto</th><th>micha</th><th>fr111</th></tr></thead><tbody><tr><td><strong>e quelli iscioglie immantanente sua cacciegione e la</strong> dona a suo compagnone per portar-nela,</td><td><strong>et cil se destrosse maintenant de sa venoison, si la</strong> baille a son compaignon por porter,</td><td>et cil baille sa uenoison a porter a son compaiguon.</td></tr></tbody></table>

## E.6. Example of innovation in Lancellotto

*Lancellotto* presents in some passages innovations (fragment ii-61-2):

<table><thead><tr><th>micha</th><th>lancellotto</th></tr></thead><tbody><tr><td>et de ceu est il tos esbahis. Après regarder la pucele, si se merveille plus as-sés de sa bialté que del vaissel,</td><td>e di ciò si maraviglia egli molto, si nè molto isbigotito.</td></tr><tr><td></td><td>Ma di cosa che veggia non si maraviglia egli niente inverso della trasgran biltà della damigella che tanto gli sembia esser bella ch'a pena l'osa riguardare, ché più gli è aviso che sua faccia risprenda che sole, e suoi occhi rilucenti e sua capellatura che gli sembia ad essere di fine oro; ve di persona si, come dice in suo cuore,</td></tr><tr><td>kar onques mes ne vit il feme</td><td>non ne vide mai niuna</td></tr></tbody></table>
F. DMDbscan

<figure><img src="image_13.png" /><figcaption>**Figure 5:** Minimum distances to the MinPts nearest points, sorted by ascending order. Two different densities levels are possible, the first one breaking around 0.2 distance, and the other around 1.2.</figcaption></figure>