Token Classification
spaCy
Old English (ca. 450-1100)
old-english
anglo-saxon
universal-dependencies
dependency-parsing
lemmatization
historical-languages
low-resource
Eval Results (legacy)
Instructions to use Nerthus-Project/MATILDA_UD_parser_of_Old_English with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- spaCy
How to use Nerthus-Project/MATILDA_UD_parser_of_Old_English with spaCy:
!pip install https://huggingface.co/Nerthus-Project/MATILDA_UD_parser_of_Old_English/resolve/main/MATILDA_UD_parser_of_Old_English-any-py3-none-any.whl # Using spacy.load(). import spacy nlp = spacy.load("MATILDA_UD_parser_of_Old_English") # Importing as module. import MATILDA_UD_parser_of_Old_English nlp = MATILDA_UD_parser_of_Old_English.load() - Notebooks
- Google Colab
- Kaggle
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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|
| 11 |
+
- anglo-saxon
|
| 12 |
+
- universal-dependencies
|
| 13 |
+
- dependency-parsing
|
| 14 |
+
- lemmatization
|
| 15 |
+
- historical-languages
|
| 16 |
+
- low-resource
|
| 17 |
+
model-index:
|
| 18 |
+
- name: en_matilda_oe_ud
|
| 19 |
+
results:
|
| 20 |
+
- task:
|
| 21 |
+
type: token-classification
|
| 22 |
+
name: Dependency Parsing
|
| 23 |
+
dataset:
|
| 24 |
+
name: MATILDA Old English UD treebank (held-out test)
|
| 25 |
+
type: matilda-oe-ud
|
| 26 |
+
metrics:
|
| 27 |
+
- type: uas
|
| 28 |
+
name: Unlabelled Attachment Score
|
| 29 |
+
value: 0.8635
|
| 30 |
+
- type: las
|
| 31 |
+
name: Labelled Attachment Score
|
| 32 |
+
value: 0.7943
|
| 33 |
+
- task:
|
| 34 |
+
type: token-classification
|
| 35 |
+
name: Part-of-Speech Tagging
|
| 36 |
+
dataset:
|
| 37 |
+
name: MATILDA Old English UD treebank (held-out test)
|
| 38 |
+
type: matilda-oe-ud
|
| 39 |
+
metrics:
|
| 40 |
+
- type: accuracy
|
| 41 |
+
name: UPOS Accuracy
|
| 42 |
+
value: 0.9510
|
| 43 |
+
- type: accuracy
|
| 44 |
+
name: XPOS Accuracy
|
| 45 |
+
value: 0.9473
|
| 46 |
+
- type: accuracy
|
| 47 |
+
name: Morphological Features Accuracy
|
| 48 |
+
value: 0.8542
|
| 49 |
+
- type: accuracy
|
| 50 |
+
name: Lemma Accuracy
|
| 51 |
+
value: 0.8694
|
| 52 |
+
---
|
| 53 |
+
|
| 54 |
+
# MATILDA — Old English Universal Dependencies pipeline
|
| 55 |
+
|
| 56 |
+
A spaCy pipeline for **Old English** (Anglo-Saxon, c. 650–1150 CE) covering
|
| 57 |
+
part-of-speech tagging, morphological analysis, lemmatisation and Universal
|
| 58 |
+
Dependencies parsing.
|
| 59 |
+
|
| 60 |
+
On a matched evaluation set it improves on the published state of the art
|
| 61 |
+
(Martín Arista et al., 2025) by **+5.57 LAS** and **+3.42 UAS**.
|
| 62 |
+
|
| 63 |
+
## Usage
|
| 64 |
+
|
| 65 |
+
```bash
|
| 66 |
+
pip install https://huggingface.co/<org>/en_matilda_oe_ud/resolve/main/en_matilda_oe_ud-1.0.0-py3-none-any.whl
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
```python
|
| 70 |
+
import spacy
|
| 71 |
+
|
| 72 |
+
nlp = spacy.load("en_matilda_oe_ud")
|
| 73 |
+
doc = nlp("Hwæt we Gardena in geardagum þeodcyninga þrym gefrunon .")
|
| 74 |
+
|
| 75 |
+
for token in doc:
|
| 76 |
+
print(token.text, token.lemma_, token.pos_, token.dep_, token.head.text)
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
The opening of *Beowulf* — "Lo, we have heard of the glory of the Spear-Danes
|
| 80 |
+
in days of old" — produces:
|
| 81 |
+
|
| 82 |
+
| TEXT | LEMMA | UPOS | DEP | HEAD |
|
| 83 |
+
|---|---|---|---|---|
|
| 84 |
+
| Hwæt | hwæt | ADV | advmod | gefrunon |
|
| 85 |
+
| we | we | PRON | nsubj | gefrunon |
|
| 86 |
+
| Gardena | Gardenā | ADJ | nsubj | gefrunon |
|
| 87 |
+
| in | in | ADP | case | geardagum |
|
| 88 |
+
| geardagum | geardeg | NOUN | obl:tmod | gefrunon |
|
| 89 |
+
| þeodcyninga | þeodcyning | NOUN | nmod | þrym |
|
| 90 |
+
| þrym | þrym | NOUN | obj | gefrunon |
|
| 91 |
+
| gefrunon | gefrunon | VERB | ROOT | gefrunon |
|
| 92 |
+
| . | . | PUNCT | punct | gefrunon |
|
| 93 |
+
|
| 94 |
+
This is verse and therefore out of domain, since the treebank is prose. The
|
| 95 |
+
analysis is nonetheless mostly right: `gefrunon` is correctly the root, `we` its
|
| 96 |
+
subject, `þrym` its object, and `þeodcyninga` a genitive modifier of `þrym`.
|
| 97 |
+
`Gardena` is the visible error, a genitive plural attached as a second subject
|
| 98 |
+
and tagged `ADJ`.
|
| 99 |
+
|
| 100 |
+
Note also that the input uses thorn ⟨þ⟩ while the training treebank is normalised
|
| 101 |
+
to eth ⟨ð⟩. The floret subword vectors absorb the difference, which is one of the
|
| 102 |
+
reasons they were chosen.
|
| 103 |
+
|
| 104 |
+
## Performance
|
| 105 |
+
|
| 106 |
+
Held-out test set, 561 sentences, decontaminated against the silver training data.
|
| 107 |
+
All figures are percentages.
|
| 108 |
+
|
| 109 |
+
| Metric | Score |
|
| 110 |
+
|---|---|
|
| 111 |
+
| TOK | 99.80 |
|
| 112 |
+
| XPOS (TAG) | 94.73 |
|
| 113 |
+
| UPOS (POS) | 95.10 |
|
| 114 |
+
| FEATS (MORPH) | 85.42 |
|
| 115 |
+
| LEMMA | 86.94 |
|
| 116 |
+
| **UAS** | **86.35** |
|
| 117 |
+
| **LAS** | **79.43** |
|
| 118 |
+
| Sentence F | 87.44 |
|
| 119 |
+
|
| 120 |
+
### Against the published baseline
|
| 121 |
+
|
| 122 |
+
The reference point is the best configuration of Martín Arista et al. (2025),
|
| 123 |
+
measured on a matched 285-sentence evaluation set with identical tokenisation:
|
| 124 |
+
|
| 125 |
+
| Metric | BDCC 2025 | This model | Δ |
|
| 126 |
+
|---|---|---|---|
|
| 127 |
+
| XPOS | 93.20 | 94.91 | +1.71 |
|
| 128 |
+
| UPOS | 92.96 | 95.02 | +2.06 |
|
| 129 |
+
| FEATS | 84.21 | 87.77 | +3.56 |
|
| 130 |
+
| UAS | 83.24 | 86.66 | +3.42 |
|
| 131 |
+
| LAS | 74.23 | 79.80 | +5.57 |
|
| 132 |
+
| SENT-F | 71.38 | 84.18 | +12.80 |
|
| 133 |
+
|
| 134 |
+
For wider context, the best cross-lingual result reported for Old English —
|
| 135 |
+
Brigada Villa and Giarda (2023), Old English paired with Icelandic — reached
|
| 136 |
+
68.44 UAS and 58.70 LAS.
|
| 137 |
+
|
| 138 |
+
Lemma accuracy is excluded from this comparison. The 2025 figure of 79.83 was
|
| 139 |
+
measured against lemma cells that still carried glosses and word-class markers
|
| 140 |
+
inherited from the source spreadsheets, so the two references differ and the
|
| 141 |
+
numbers are not comparable. The normalisation that removed those markers is
|
| 142 |
+
described below and analysed in the accompanying paper.
|
| 143 |
+
|
| 144 |
+
## Training data
|
| 145 |
+
|
| 146 |
+
| Source | Size | Role |
|
| 147 |
+
|---|---|---|
|
| 148 |
+
| MATILDA gold UD treebank | 87,993 tokens | supervised training |
|
| 149 |
+
| MATILDA silver treebanks | 212,471 tokens | supervised training, filtered |
|
| 150 |
+
| Dictionary of Old English Corpus | ~3.4 M tokens | floret vectors, tok2vec pretraining |
|
| 151 |
+
| Synthetic Old English | 1.73 M words | floret vectors, tok2vec pretraining |
|
| 152 |
+
|
| 153 |
+
The gold treebank derives from ParCorOEv3 and from doctoral work in the same
|
| 154 |
+
project, covering Ælfric's *Catholic Homilies*, the *Anglo-Saxon Chronicle*,
|
| 155 |
+
Anglo-Saxon laws, St Mark's Gospel, the Old English *Orosius*, Bede, charters,
|
| 156 |
+
martyrologies and Boethius.
|
| 157 |
+
|
| 158 |
+
Its LEMMA and XPOS columns were normalised before training. 31.7 % of lemma cells
|
| 159 |
+
carried a gloss or word-class marker (`and 'and' (CONJ)` rather than `and`), and
|
| 160 |
+
the tag column ran to 71 strings for roughly 25 categories. Because the reference
|
| 161 |
+
contradicted itself, a model that always guessed the most frequent lemma for each
|
| 162 |
+
(form, UPOS) pair could not have exceeded 79.83 % accuracy; after normalisation
|
| 163 |
+
that ceiling is 97.81 %. The same normalisation has been applied to the treebank
|
| 164 |
+
itself, so the published corpus and this model follow one set of conventions.
|
| 165 |
+
|
| 166 |
+
The silver portion is machine-annotated and was filtered before use: four
|
| 167 |
+
rule-completed treebanks and one heavily underspecified treebank were excluded
|
| 168 |
+
entirely, sentences carrying the `dep` placeholder were dropped, and 338 sentences
|
| 169 |
+
overlapping the evaluation sets were removed by 4-gram matching. What makes the
|
| 170 |
+
remainder valuable is its **manually revised morphology**; its trees came from an
|
| 171 |
+
earlier, weaker parser.
|
| 172 |
+
|
| 173 |
+
The synthetic portion is machine-translated Latin from works attested in pre-1100
|
| 174 |
+
Anglo-Saxon libraries. It is used only in the unlabelled channels — vectors and
|
| 175 |
+
pretraining — and never as supervised annotation.
|
| 176 |
+
|
| 177 |
+
## Architecture
|
| 178 |
+
|
| 179 |
+
```
|
| 180 |
+
tokenizer → tok2vec → tagger → morphologizer → trainable_lemmatizer → parser
|
| 181 |
+
```
|
| 182 |
+
|
| 183 |
+
- **Vectors**: floret subword embeddings, 50,000 rows × 300 dimensions, chosen for
|
| 184 |
+
a zero out-of-vocabulary rate on a morphologically rich language with unstable
|
| 185 |
+
spelling. A perfect word-level table built on the entire 3.4 M-token corpus
|
| 186 |
+
still leaves 28 % of the types in the gold treebank unseen.
|
| 187 |
+
- **tok2vec**: `MultiHashEmbed` with `MaxoutWindowEncoder`, pretrained on the
|
| 188 |
+
Dictionary of Old English Corpus plus the synthetic text, with orthography
|
| 189 |
+
harmonised to eth before pretraining.
|
| 190 |
+
- **Parser**: `TransitionBasedParser` (arc-eager).
|
| 191 |
+
|
| 192 |
+
There is no transformer. The 2025 baseline study found MobileBERT trained from
|
| 193 |
+
scratch reached only 60.17 UAS and 45.51 LAS on this data, at a
|
| 194 |
+
parameter-to-token ratio of roughly 1250:1, and transfer from modern English
|
| 195 |
+
checkpoints is blocked by the graphemes ⟨æ⟩, ⟨ð⟩, ⟨þ⟩, ⟨ȝ⟩ and ⟨ƿ⟩.
|
| 196 |
+
|
| 197 |
+
## Limitations
|
| 198 |
+
|
| 199 |
+
- **The tokenizer is English.** spaCy provides none for Old English, so the
|
| 200 |
+
pipeline's `lang` is `en` and tokenisation uses English rules, as in the
|
| 201 |
+
baseline study. Every trained component is Old English only. This is why the
|
| 202 |
+
package is named `en_matilda_oe_ud` while the repository is tagged `ang`.
|
| 203 |
+
- **Non-projective structures fail.** Crossing dependencies arising from Old
|
| 204 |
+
English word order cannot be represented by a transition-based parser. This
|
| 205 |
+
affects relative clauses, clausal modifiers and some coordination.
|
| 206 |
+
- **Long-distance relations are weak.** Local and morphologically marked
|
| 207 |
+
relations parse well (`det:poss` 94.06 F1, `case` 93.38, `cc` 90.52); clausal
|
| 208 |
+
complements and oblique variants much less so.
|
| 209 |
+
- **Genre skew.** The treebank is prose — homiletic, legal, historical and
|
| 210 |
+
biblical. Poetry is not represented.
|
| 211 |
+
- **The parser sometimes emits `dep`.** In Universal Dependencies `dep` means
|
| 212 |
+
"unclassified", so it carries no information. It appears for two reasons. 490
|
| 213 |
+
tokens of the treebank still carry it as an unresolved placeholder, almost all
|
| 214 |
+
of them sentence-initial annal years and chapter numbers. And spaCy's arc-eager
|
| 215 |
+
parser declares `dep` a builtin label and adds it as a backoff whatever the
|
| 216 |
+
training data contains, so a model trained on data with no `dep` at all still
|
| 217 |
+
predicts it. Treat `dep` in the output as "no relation assigned" rather than as
|
| 218 |
+
a relation. Roughly 0.5 % of tokens are affected.
|
| 219 |
+
|
| 220 |
+
## Citation
|
| 221 |
+
|
| 222 |
+
Please cite the baseline study, which this model extends:
|
| 223 |
+
|
| 224 |
+
```bibtex
|
| 225 |
+
@article{martinarista2025parsing,
|
| 226 |
+
title = {Parsing Old English with Universal Dependencies---The Impacts
|
| 227 |
+
of Model Architectures and Dataset Sizes},
|
| 228 |
+
author = {Mart{\'i}n Arista, Javier and Ojanguren L{\'o}pez, Ana Elvira
|
| 229 |
+
and Dom{\'i}nguez Barrag{\'a}n, Sara},
|
| 230 |
+
journal = {Big Data and Cognitive Computing},
|
| 231 |
+
volume = {9},
|
| 232 |
+
number = {8},
|
| 233 |
+
pages = {199},
|
| 234 |
+
year = {2025},
|
| 235 |
+
issn = {2504-2289},
|
| 236 |
+
doi = {10.3390/bdcc9080199}
|
| 237 |
+
}
|
| 238 |
+
```
|
| 239 |
+
|
| 240 |
+
## Licence and funding
|
| 241 |
+
|
| 242 |
+
CC BY 4.0. Funded by AEI /10.13039/501100011033, grant PID2023-149762NB-100 MCIN.
|
| 243 |
+
Nerthus Project, Universidad de La Rioja.
|