ERCDiDip/medieval-latin-ner
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:
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.
4. How to Use
You can use this model with the Hugging Face pipeline:
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.
