shah-bakhsh/balochi-pos-tagger-v1
143
Balochi POS Tagger
A Part-of-Speech tagger for Balochi language written in Arabic script, fine-tuned from FacebookAI/xlm-roberta-base on the Balochi CoNLL-U dataset.
Test Set Results
Labels
{ "ADJ": 0, "ADP": 1, "ADV": 2, "AUX": 3, "CCONJ": 4, "DET": 5, "INTJ": 6, "NOUN": 7, "NUM": 8, "PART": 9, "PRON": 10, "PROPN": 11, "PUNCT": 12, "SCONJ": 13, "VERB": 14, "X": 15 }
Usage
from transformers import AutoTokenizer, AutoModelForTokenClassification
import torch
tokenizer = AutoTokenizer.from_pretrained("shahbakhsh/balochi-pos-tagger-v1")
model = AutoModelForTokenClassification.from_pretrained("shahbakhsh/balochi-pos-tagger-v1")
sentence = 'ایش انت ملّاہانی حکومت ءِ سوگات'
words = sentence.split()
inputs = tokenizer(words, is_split_into_words=True, return_tensors='pt')
with torch.no_grad():
outputs = model(**inputs)
predictions = outputs.logits.argmax(-1)[0]
word_ids = inputs.word_ids()
for idx, word_id in enumerate(word_ids):
if word_id is not None:
print(words[word_id], model.config.id2label[predictions[idx].item()])Built by
shahbakhsh — AI/ML Engineer, Balochistan, Pakistan
