Downloads · 30 days
18
31% of all-time downloads
panagoa/xlm-roberta-base-kbd-pos-tagger
xlm-roberta-base-kbd-pos-tagger is a token classification model from panagoa. Use it when you need labels on individual words, such as names. It is set up for transformers.
This model is a fine-tuned version of panagoa/xlm-roberta-base-kbd on the panagoa/kbd-pos-tags dataset. It is designed to perform Part-of-Speech (POS) tagging for text in the Kabardian language (kbd).
Downloads · 30 days
18
31% of all-time downloads
All-time downloads
58
Public
Parameters
288M
4.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.2 GB · 98%
From the Hugging Face model README
This model is a fine-tuned version of panagoa/xlm-roberta-base-kbd on the panagoa/kbd-pos-tags dataset. It is designed to perform Part-of-Speech (POS) tagging for text in the Kabardian language (kbd).
The model identifies 17 different POS tags:
| Tag | Description | Examples |
|---|---|---|
| ADJ | Adjective | хужь (white), къабзэ (clean) |
| ADP | Adposition | щхьэкIэ (for), папщIэ (because of) |
| ADV | Adverb | псынщIэу (quickly), жыжьэу (far) |
| AUX | Auxiliary | хъунщ (will be), щытащ (was) |
| CCONJ | Coordinating conjunction | икIи (and), ауэ (but) |
| DET | Determiner | мо (that), мыпхуэдэ (this kind) |
| INTJ | Interjection | уэлэхьи (by God), зиунагъуэрэ (oh my) |
| NOUN | Noun | унэ (house), щIалэ (boy) |
| NUM | Numeral | зы (one), тIу (two) |
| PART | Particle | мы (this), а (that) |
| PRON | Pronoun | сэ (I), уэ (you) |
| PROPN | Proper noun | Мурат (Murat), Налшык (Nalchik) |
| PUNCT | Punctuation | . (period), , (comma) |
| SCONJ | Subordinating conjunction | щхьэкIэ (because), щыгъуэ (when) |
| SYM | Symbol | % (percent), $ (dollar) |
| VERB | Verb | мэкIуэ (goes), матхэ (writes) |
| X | Other | - |
This model is intended for:
The model was trained on the panagoa/kbd-pos-tags dataset, which contains 82,925 tagged sentences in Kabardian. The dataset shows the following tag distribution:
The model was trained with the following configuration:
Class weights were calculated inversely proportional to the class frequencies to address the imbalance in the dataset, with rare tags given higher importance during training.
The model achieved the following performance on a validation set (20% of the data):
from transformers import AutoTokenizer, AutoModelForTokenClassification
import torch
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("panagoa/xlm-roberta-base-kbd-pos-tagger")
model = AutoModelForTokenClassification.from_pretrained("panagoa/xlm-roberta-base-kbd-pos-tagger")
# Define function for prediction
def predict_pos_tags(text, model, tokenizer):
# Split text into words if it's a string
if isinstance(text, str):
text = text.split()
# Determine device
device = 'cuda' if torch.cuda.is_available() else 'cpu'
model = model.to(device)
# Tokenize input text
encoded_input = tokenizer(
text,
truncation=True,
is_split_into_words=True,
return_tensors="pt"
)
# Move inputs to the same device
inputs = {k: v.to(device) for k, v in encoded_input.items()}
# Get predictions
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.argmax(outputs.logits, dim=2)
# Map to POS tags
word_ids = encoded_input.word_ids()
previous_word_idx = None
predicted_tags = []
for idx, word_idx in enumerate(word_ids):
if word_idx != previous_word_idx:
predicted_tags.append(model.config.id2label[predictions[0][idx].item()])
previous_word_idx = word_idx
return predicted_tags[:len(text)]
# Example usage
text = "Хъыджэбзыр щIэкIри фошыгъу къыхуихьащ"
words = text.split()
tags = predict_pos_tags(words, model, tokenizer)
# Print results
for word, tag in zip(words, tags):
print(f"{word}: {tag}")
Хъыджэбзыр: NOUN
щIэкIри: VERB
фошыгъу: NOUN
къыхуихьащ: VERB
This model was trained by panagoa and contributed to the Hugging Face community to support NLP research and applications for the Kabardian language.
If you use this model in your research, please cite:
@misc{panagoa2025kabardianpos,
author = {Panagoa},
title = {XLM-RoBERTa for Kabardian Part-of-Speech Tagging},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/panagoa/xlm-roberta-base-kbd-pos-tagger}}
}