Views
No views yet
1import stanza
2from huggingface_hub import snapshot_download
3
4# Download models (one time)
5model_dir = snapshot_download("latincy/la_stanza_latincy")
6
7# Load pipeline
8nlp = stanza.Pipeline("la", dir=model_dir, download_method=None)
9
10# Annotate
11doc = nlp("Gallia est omnis divisa in partes tres.")
12for sent in doc.sentences:
13 for word in sent.words:
14 print(f"{word.text:12s} {word.upos:6s} {word.lemma:12s} {word.deprel}")Gallia PROPN Gallia nsubj:pass
est AUX sum aux:pass
omnis DET omnis det
divisa VERB divido root
in ADP in case
partes NOUN pars obl
tres NUM tres nummod
. PUNCT . punct1nlp = stanza.Pipeline("la", dir=model_dir, download_method=None,
2 processors="tokenize,ner")
3doc = nlp("Caesar in Galliam cum legionibus contendit.")
4for ent in doc.ents:
5 print(f"{ent.text:20s} {ent.type}")1nlp = stanza.Pipeline("la", dir="/path/to/la_stanza_latincy",
2 download_method=None)| Property | Value |
|---|---|
| Author | Patrick J. Burns / LatinCy |
| Model type | Stanza neural pipeline (BiLSTM-CRF, biaffine parser) |
| Language | Latin |
| License | MIT |
| Total size | ~1.1 GB (8 model files) |
| Framework | Stanza (Stanford NLP) |
| Component | Model File | Architecture |
|---|---|---|
| Tokenizer | tokenize/latincy.pt (11 MB) | BiLSTM segmenter |
| POS/Morph | pos/latincy.pt (143 MB) | BiLSTM tagger with CharLM + pretrained vectors |
| Lemmatizer | lemma/latincy.pt (46 MB) | Seq2seq with edit classifier |
| Dep. Parser | depparse/latincy.pt (170 MB) | Deep biaffine attention parser |
| NER | ner/latincy.pt (151 MB) | BiLSTM-CRF with CharLM + pretrained vectors |
| CharLM (fwd) | forward_charlm/latincy.pt (197 MB) | Character-level LSTM language model |
| CharLM (bwd) | backward_charlm/latincy.pt (197 MB) | Character-level LSTM language model |
| Pretrain | pretrain/latincy.pt (174 MB) | Word2Vec CBOW-300 embeddings |
| Treebank | Full Name | Domain |
|---|---|---|
| ITTB | Index Thomisticus Treebank | Scholastic Latin (Thomas Aquinas) |
| LLCT | Late Latin Charter Treebank | Medieval legal charters |
| PROIEL | PROIEL Treebank | Vulgate Bible, historical texts |
| Perseus | Perseus Latin Treebank | Classical Latin (Caesar, Cicero, etc.) |
| UDante | UDante Treebank | Dante Alighieri (De vulgari eloquentia, etc.) |
| CIRCSE | CIRCSE Latin Treebank | LASLA-derived classical texts |
| LASLA | LASLA corpus | Classical Latin (morphology only, no deps) |
| Component | Metric | v0.2 (CharLM) | v0.3 (Latin BERT) | Best | Split |
|---|---|---|---|---|---|
| Tokenizer | Token F1 | 98.24 | — | v0.2 | dev |
| Tokenizer | Sentence F1 | 86.59 | — | v0.2 | dev |
| POS | UPOS | 97.26 | 97.65 | v0.3 | test |
| POS | XPOS | — | 97.38 | v0.3 | test |
| POS | UFeats | 92.80 | 93.93 | v0.3 | test |
| POS | AllTags | — | 92.51 | v0.3 | test |
| Lemma | Accuracy | 97.87 | — | v0.2 | test |
| Dep. Parse | UAS | 86.95 | 86.20 | v0.2 | test |
| Dep. Parse | LAS | 83.23 | 81.98 | v0.2 | test |
| Dep. Parse | MLAS | 76.96 | 75.23 | v0.2 | test |
| Dep. Parse | BLEX | 79.46 | 78.00 | v0.2 | test |
| NER | Entity F1 | 90.22 | 90.17 | v0.2 | dev |
| NER | PERSON F1 | 93.01 | 93.41 | v0.3 | dev |
| NER | LOC F1 | 80.88 | 79.47 | v0.2 | dev |
| NER | NORP F1 | 78.44 | 76.00 | v0.2 | dev |
tokenization_latin_bert_fast.py) that requires trust_remote_code=True. Stanza's bert_embedding.load_tokenizer does not pass that flag, so the BERT POS checkpoint fails to load end-to-end from the published HF repo. v0.3.1 reverts POS to the CharLM backend (numbers match the v0.2 column above). All other components are unchanged from v0.3. A transformer POS will return once the Stanza/Latin BERT integration is resolved.| Metric | LatinCy Stanza 0.3.1 | LatinCy Flair 0.3 | LatinCy UDPipe 0.2 | LatinCy spaCy trf 3.9 |
|---|---|---|---|---|
| UPOS | 97.26 | 98.02 | 94.07 | 97.34 |
| UFeats | 92.80 | -- | 80.82 | 93.95 |
| Lemma | 97.87 | 97.41 | 92.99 | 94.63 |
| UAS | 86.95 | -- | 76.48 | 86.91 |
| LAS | 83.23 | -- | 71.57 | 82.04 |
| NER F1 | 90.22 | 92.22 | -- | 91.14 |
stanfordnlp/stanza-la)nocharlm variants) and without NER. LatinCy Stanza trains a single unified model across all treebanks plus LASLA, with custom forward/backward CharLMs and pretrained word vectors. A direct benchmark comparison is planned for a future release.| Version | Date | Treebank Data | Changes |
|---|---|---|---|
| 0.3.1 | 2026-04 | LatinCy v3.9 | Revert POS to the v0.2 CharLM checkpoint. The v0.3 Latin BERT POS model is incompatible with Stanza's BERT tokenizer loader (custom Latin BERT tokenizer requires trust_remote_code=True). All other components unchanged. |
| 0.3 | 2026-03 | LatinCy v3.9 | Latin BERT transformer backend for POS (UPOS +0.39, UFeats +1.13). Best-of per component: Latin BERT POS, CharLM for all others. Retracted in 0.3.1. |
| 0.2 | 2026-03 | LatinCy v3.9 | Retrained POS, lemma, depparse on harmonized treebanks with Gender feature fix. UFeats +0.60, UAS +0.22. |
| 0.1 | 2026-02 | LatinCy v3.8 | Initial release. All components (tokenizer, POS, lemma, depparse, NER, CharLM). |
1@misc{burns2026latincystanza,
2 author = {Burns, Patrick J.},
3 title = {{LatinCy Stanza (la\_stanza\_latincy)}},
4 year = {2026},
5 url = {https://huggingface.co/latincy/la_stanza_latincy},
6}