Instructions to use mhvdr/neolatiner-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mhvdr/neolatiner-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="mhvdr/neolatiner-model")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("mhvdr/neolatiner-model") model = AutoModelForTokenClassification.from_pretrained("mhvdr/neolatiner-model", device_map="auto") - Notebooks
- Google Colab
- Kaggle
NeoLatiNER
NeoLatiNER is an XLM-RoBERTa-large model fine-tuned for named-entity recognition in OCR-derived Early Modern Latin texts about natural philosophy. It predicts persons (PRS), groups (GRP), and geographical locations (GEO) using IOB2 labels.
Person-name recognition was the primary research target. The GRP and GEO classes were retained for reuse but were not evaluated in the same depth.
Usage
Install transformers and PyTorch, then run:
from transformers import pipeline
ner = pipeline(
"token-classification",
model="mhvdr/neolatiner-model",
aggregation_strategy="simple",
)
entities = ner("Cartesius in Gallia natus est.")
for entity in entities:
print(entity["word"], entity["entity_group"], entity["score"])
The underlying labels are O, B-PRS, I-PRS, B-GRP, I-GRP, B-GEO, and I-GEO. With aggregation_strategy="simple", the pipeline combines adjacent IOB2 predictions and returns entity groups such as PRS, GRP, and GEO.
For lower-level control:
from transformers import AutoModelForTokenClassification, AutoTokenizer
repo_id = "mhvdr/neolatiner-model"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForTokenClassification.from_pretrained(repo_id)
Long documents must be split into passages that fit XLM-R's input limit. Preserve enough surrounding context for ambiguous names and retain confidence scores for review.
Evaluation
The released checkpoint was evaluated on the held-out test split of mhvdr/neolatiner-dataset using strict IOB2 entity matching. The test split contains 1,460 records and 639 annotated entities.
| Entity | Precision | Recall | F1 | Support |
|---|---|---|---|---|
| GEO | 0.6533 | 0.7784 | 0.7104 | 167 |
| GRP | 0.4937 | 0.4588 | 0.4756 | 85 |
| PRS | 0.7541 | 0.7209 | 0.7371 | 387 |
| Micro average | 0.6914 | 0.7011 | 0.6962 | 639 |
Training data
The model builds on XLM-R and Latin NER material from the Herodotos Project and the Corpus Burgundiae Medii Aevi, followed by fine-tuning on two rounds of manually annotated, in-domain Early Modern Latin excerpts. The final in-domain dataset is available at mhvdr/neolatiner-dataset.
Limitations
The target texts contain OCR errors, spelling variation, inflection, abbreviated names, and inconsistent capitalization. Predictions require domain-aware review and post-processing. The annotation sampling strategy emphasized excerpts likely to contain entities and low-confidence predictions, so the data is not a representative random sample of Early Modern Latin. The model was designed for research use, not high-stakes or fully automated decisions.
Citation
Please cite the associated NeoLatiNER publication. Final bibliographic metadata and DOI will be added at publication.
- Downloads last month
- -