BalPOS v2 is a transformer-based token-classification model fine-tuned from
shahbakhsh/BalBERT specifically for
Universal Dependencies (UD) Part-of-Speech tagging on the Balochi language (
bal).
Developed by
Shah Bakhsh, BalPOS v2 provides the foundational syntactic layer for the Balochi NLP research ecosystem.
1{
2 "learning_rate": 1e-05,
3 "batch_size": 8,
4 "epochs": 15,
5 "weight_decay": 0.01,
6 "warmup_ratio": 0.05,
7 "gradient_accumulation_steps": 1,
8 "seed": 42,
9 "best_fold": "Fold 5"
10}
1from transformers import pipeline
2
3# Load BalPOS v2 pipeline from Hugging Face
4tagger = pipeline(
5 task="token-classification",
6 model="shahbakhsh/BalPOS",
7 aggregation_strategy="simple"
8)
9
10# Tag Balochi sentence
11text = "وتی فلسفہ"
12results = tagger(text)
13
14for entity in results:
15 print(f"Token: {entity['word']:<15} | Tag: {entity['entity_group']:<8} | Score: {entity['score']:.4f}")
1import torch
2from transformers import AutoTokenizer, AutoModelForTokenClassification
3
4model_id = "shahbakhsh/BalPOS"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id)
7model = AutoModelForTokenClassification.from_pretrained(model_id)
8model.eval()
9
10sentence = "وتی فلسفہ"
11inputs = tokenizer(sentence, return_tensors="pt")
12
13with torch.no_grad():
14 logits = model(**inputs).logits
15
16predictions = torch.argmax(logits, dim=-1)[0]
17tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0])
18
19for token, pred_id in zip(tokens, predictions):
20 if token not in [tokenizer.cls_token, tokenizer.sep_token, tokenizer.pad_token]:
21 tag = model.config.id2label[pred_id.item()]
22 print(f"{token:<15} -> {tag}")
BalPOS v2 is part of an ongoing open-source initiative for Balochi NLP led by
Shah Bakhsh:
1@misc{balpos_v2_2026,
2 title = {{BalPOS v2: Balochi Universal Part-of-Speech Tagger}},
3 author = {Shah Bakhsh},
4 year = {2026},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/shahbakhsh/BalPOS}},
7 note = {Fine-tuned from shahbakhsh/BalBERT on Balochi UD Corpus}
8}