Abkhaz POS Tagger (XLM-RoBERTa)
A part-of-speech (POS) tagger for the Abkhaz language (ISO 639-1: ab), fine-tuned from XLM-RoBERTa-base.
Abkhaz is a Northwest Caucasian polysynthetic language spoken primarily in Abkhazia. It is considered a low-resource language in NLP, making this model a meaningful contribution to its digital infrastructure.
Model Details
- Base model:
xlm-roberta-base(270M parameters) - Task: Token classification (POS tagging)
- Tag set: Universal POS tags
- Max sequence length: 512 tokens
Training
- Training samples: 1,236 sentences (~13,500 tokens)
- Evaluation samples: 154 sentences
- Epochs: 10 | Batch size: 8 | Learning rate: 2e-5
- Hardware: NVIDIA RTX 5060 Ti (16 GB)
Evaluation
- Token accuracy: 91.66% (Dev set)
Usage
from transformers import AutoTokenizer, AutoModelForTokenClassification
import torch
model_id = "Grundik/abkhaz-pos-xlmr"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForTokenClassification.from_pretrained(model_id)
text = "Аԥсны аҳәынҭқарра"
inputs = tokenizer(text, return_tensors="pt", return_offsets_mapping=True)
word_ids = inputs.word_ids()
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.argmax(outputs.logits, dim=2)[0]
id2label = model.config.id2label
for i, word_idx in enumerate(word_ids):
if word_idx is not None:
token = tokenizer.decode(inputs.input_ids[0][i])
label = id2label[predictions[i].item()]
print(f"{token}\t{label}")
Training Data
The model was trained on the UD_Abkhaz-AbNC treebank, a subset of the Abkhaz National Corpus annotated in the Universal Dependencies format.
- Repository: UniversalDependencies/UD_Abkhaz-AbNC
- Source: Abkhaz newspaper archives, digitized in collaboration with the National Library of Abkhazia.
Limitations
- Trained on a relatively small dataset (~13.5k tokens). Performance on rare word forms may degrade.
- Handles the full Abkhaz Cyrillic alphabet (
ә, ҧ, ҳ, қ, ҭ, ҽ, ҿ, ӡ, џ, ҕ, ӷ, ҟ, ҵ, ҩ, ҷ, ԥ).
Citation
@misc{UD_Abkhaz-AbNC,
author = {Universal Dependencies},
title = {UD Abkhaz-AbNC},
url = {https://github.com/UniversalDependencies/UD_Abkhaz-AbNC},
year = {2024}
}
Author
Trained by Marat Ionov as part of a project on the digital infrastructure of the Abkhaz language (OCR, morphology, newspaper layout analysis).
License
MIT