Salman Adnan

balochi-poet-classifier

Balochi Poet Classifier Team

Given two lines of Balochi poetry, can a computer tell which of three poets wrote them? Balochi has almost no language technology built for it, so even assembling the 1,670 hand-checked verses mattered; three students shared that work. Salman built the part that cleans the verses and teaches the computer to tell the poets apart; that step needs a faster machine than he had, so no success rate is claimed.

Pipeline verified, full training not run

Salman's part of a three-person course project: the classification pipeline (preprocessing, training, evaluation, inference). Preprocessing runs end to end on the real dataset and the training and evaluation code is verified to execute, but full fine-tuning of the ~278M-parameter model was not completed (CPU was about 28 seconds per step). No accuracy number is claimed.

Verse Constellations: an artwork of the sorting job, not real model output. Loose verses drift in and settle into three clusters, one per poet, then scatter and find them again. Live and interactive: drag it to orbit, scroll or pinch to zoom. Open full screen
Bar chart of verses per poet and a histogram of verse length, from the real 1,670-verse Balochi corpus.
Dataset statistics from the actual labelled corpus.
1,670labelled couplets
3poets classified
~278MXLM-R parameters

Overview

Authorship attribution for Balochi poetry: given a single couplet, predict which of three poets wrote it, by fine-tuning xlm-roberta-base for 3-way sequence classification. Balochi is a low-resource language with almost no prior computational work, which is the point.

Dataset

  • Data.csv: 1,670 couplets in Perso-Arabic script. Adam Haqqani 860 (51.5%), M.H. Khalil 670 (40.1%), Mir Ahmed Ali Mir 140 (8.4%).
  • Verses are short: 3 to 58 characters, mean 33.6. No rows are dropped by cleaning.
  • Provenance: compiled from the Balochi Academy's digital archive and published poetry books, extracted with OCR and PdfPlumber, then manually verified.

Approach

  • Fine-tune xlm-roberta-base, chosen because its SentencePiece vocabulary already covers Perso-Arabic characters, so Balochi tokenizes into subwords instead of unknown tokens.
  • Class imbalance (8.4% minority class) is handled with sklearn balanced class weights (computed 0.647 / 0.832 / 3.973) fed into a custom WeightedTrainer that overrides compute_loss with weighted cross-entropy.
  • Stratified 70/15/15 split, seed 42: train 1,168, val 251, test 251. Batch 16, lr 2e-5, max 10 epochs, early stopping on weighted F1.

Results

No accuracy is reported. The pipeline runs end to end on the real dataset, the training and evaluation code is verified to execute (a few steps on CPU with a tiny stand-in model under transformers 4.57.6), and the honest next step is a GPU run on a free Colab T4, which should finish under an hour.

Tech stack

  • Python
  • PyTorch
  • Hugging Face Transformers
  • xlm-roberta-base
  • scikit-learn

Book a call

Let's talk about what you're building.

Pick a slot below.