Views
No views yet
| model | best for | emits |
|---|---|---|
| this one | highest UPOS/slots accuracy, UD categories | UPOS (incl. DET/AUX) + core FEATS |
| …-morphology-full | complete annotations | full UD FEATS + lemmas |
| …-morphology-vdu | Lithuanian accentuation pipelines | traditional-grammar categories |
| metric | this model | UDPipe 2 reference |
|---|---|---|
| slots¹ | 89.1% | 89.2% |
| UPOS (same protocol) | 92.5% | 95.1% |
| CoNLL-18 official UPOS F1 (gold tokenization) | 94.0 | 95.2 |
| speed, tok/s (ONNX INT8 CPU vs network service) | 874 | 605 |
1import torch
2from transformers import AutoTokenizer, AutoModelForTokenClassification
3
4repo = "alexbalandi/litlat-bert-lithuanian-morphology"
5tok = AutoTokenizer.from_pretrained(repo)
6model = AutoModelForTokenClassification.from_pretrained(repo)
7
8words = ["Tas", "namas", "yra", "gražus"]
9enc = tok(words, is_split_into_words=True, return_tensors="pt")
10with torch.inference_mode():
11 logits = model(**enc).logits[0]
12seen = set()
13for pos, wid in enumerate(enc.word_ids(0)):
14 if wid is not None and wid not in seen:
15 seen.add(wid)
16 print(words[wid], model.config.id2label[int(logits[pos].argmax())])
17# Tas DET|Case=Nom|Gender=Masc|Number=Sing
18# namas NOUN|Case=Nom|Gender=Masc|Number=Sing
19# ...onnx/ folder with an INT8 model (same logits output) is included
for CPU serving.local/tagger-hf/, public domain).