CoolFace
Modelpublic

ERCDiDip/medieval-latin-ner

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes56downloads
Model Card

Medieval Latin NER (Student Model)

1. Model Description

This model is a fine-tuned XLM-RoBERTa-base specialized for Named Entity Recognition (NER) on Medieval Latin historical texts. It was trained to recognize 19 distinct historical, legal, and geographic entity types commonly found in medieval documents.

The model was developed using Knowledge Distillation. It is a lightweight "Student" model, distilled from a larger "Teacher" SpanNER model (ERCDiDip/medieval-latin-span-ner traned on 20 charters), making it faster and more efficient for large-scale processing while maintaining high accuracy.

  • —Organization: ERCDiDip
  • —Model Type: Token Classification
  • —Base Model: xlm-roberta-base
  • —Language: Latin (Medieval)

2. Entity Types (Labels)

The model follows the BIO (Begin, Inside, Outside) tagging scheme for the following categories:

TagDescription
PERIndividual person names (given or family names).
ACTORPerson names including titles, professions, or social status.
TITLESocial rank, noble titles, or ecclesiastical offices (e.g., comes, episcopus).
RELKinship or social relationships (e.g., filius, uxor).
LOCGeographical places, cities, or settlements.
INSCorporate bodies like monasteries, abbeys, or churches.
NATNatural features (rivers, forests, mountains).
ESTPhysical plots of land, farms, or meadows.
PROPDetailed boundary descriptions of properties.
LEGLegal clauses, penalties, and commands.
TRANSCore transaction verbs (e.g., dedit, confirmavit).
TIMGeneral time periods or indictions.
DATSpecific calendar dates or liturgical feasts.
MONCurrencies and monetary values (e.g., libra, solidus).
TAXTolls, tithes, or taxes.
COMCommodities, crops, or animals.
NUMNumbers and roman numerals.
MEAUnits of measurement (e.g., mansus, aratrum).
RELICHoly relics and sacred objects.

3. Evaluation Results

The model was evaluated on a held-out test set. It shows high performance on frequent entities such as people, locations, and titles.

EntityPrecisionRecallF1-ScoreSupport
ACTOR0.100.180.1311
COM0.630.920.7513
DAT0.600.710.6534
EST0.800.920.85190
INS0.760.890.82247
LEG0.390.500.4442
LOC0.910.940.931099
MEA1.000.570.737
MON0.531.000.708
NAT0.570.740.6434
NUM0.760.940.84144
PER0.930.970.951148
REL0.870.960.91264
TAX0.900.930.9229
TIM0.430.580.5096
TITLE0.880.940.911019
TRANS0.510.670.5827
Micro Avg0.850.920.894412
Macro Avg0.680.790.724412

4. How to Use

You can use this model with the Hugging Face pipeline:

python
from transformers import pipeline

ner_pipeline = pipeline(
    "ner", 
    model="ERCDiDip/medieval-latin-ner", 
    aggregation_strategy="simple"
)

text = "Jacobus filius Nicolai de villa Sancta Maria dedit unam marcam."
results = ner_pipeline(text)

for entity in results:
    print(f"{entity['entity_group']}: {entity['word']} ({entity['score']:.2f})")

5. Training Details

  • —Distillation: Pseudo-labels generated by ERCDiDip/medieval-latin-span-ner.
  • —Loss: Cross-Entropy with class weights (O-class weight: 0.05) to handle label imbalance.
  • —Optimizer: AdamW with learning rate 2e-5.
  • —Epochs: 20.

6. Limitations

  • —Does not support nested or overlapping entities (flat NER only).
  • —Performance is lower on very rare classes (e.g., ACTOR).
  • —Abbreviated Latin text should be expanded for best results.

7. Citation

If you use this model in your research, please cite the ERCDiDip project.