Views
No views yet
| Benchmark | THIVLVC | UDPipe 2.0 | Trankit (XLM-R) | Stanza (v1.5) | GreTa (T5) |
|---|---|---|---|---|---|
| Perseus (Poetry) | 93.48% | 91.04% | 70.34% | 91.44% | 91.14% |
| UDante (Medieval) | 85.85% | 84.80% | - | 78.08% | - |
| PROIEL (Classical) | 97.29% | 96.65% | 97.21% | 90.88% | - |
| ITTB (Scholastic) | 98.64% | 99.03% | 99.13% | 96.50% | - |
| LLCT (Late Latin) | 88.92% | 97.40% | 96.2% | 97.10% | - |
num_beams=5).1from transformers import AutoTokenizer, T5ForConditionalGeneration
2
3model_name = "Zual/THIVLVC"
4tokenizer = AutoTokenizer.from_pretrained(model_name)
5model = T5ForConditionalGeneration.from_pretrained(model_name)
6
7def lemmatize(text):
8 inputs = tokenizer(text, return_tensors="pt")
9 # Using beam search (num_beams=5) for better accuracy
10 outputs = model.generate(**inputs, max_length=128, num_beams=5, early_stopping=True)
11 return tokenizer.decode(outputs[0], skip_special_tokens=True)
12
13# Example
14print(lemmatize("Amorem canat"))
15# Expected Output: "amor cano"