Compact Transformer Models for Classical Urdu Poetry: A Computational Stylistics Approach

Authors

Keywords:

Arud Prosody, Compact Transformers, Computational stylistics, Low-Resource NLP Prosodic Analysis, Parameter-Efficient Fine-Tuning, Transformer models, Urdu Poetry

Abstract

Ghazals and nazms are two examples of classical Urdu poetry, which are sophisticated literary traditions distinguished by strict prosodic rules and multi-layered semantic complexity. Despite Urdu’s cultural importance and the analytical possibilities it presents for computational stylistics, systematic NLP-driven research on Urdu poetic forms is still conspicuously lacking in the academic community. By presenting a computational framework that uses compact transformer architectures to examine stylistic phenomena in classic works by Mirza Ghalib, Meer Taqi Mir, Allama Iqbal, and Faiz Ahmad Faiz, this paper fills the gap. We present a carefully selected corpus of 250 verses from public domain sources, along with a theoretically grounded annotation schema that includes prosodic meter (classified using the Arud system), rhyme structure, affective registers, and metaphorical constructions.  Anchoring on Low-Rank Adaptation (LoRA) for parameter-efficient fine-tuning, we show that compact models can perform competitively. Our models require 70% fewer parameters than traditional architectures while achieving stylistic clustering (silhouette coefficient: 0.65), rhyme detection (F1: 0.82), and meter classification (F1: 0.78). While culturally informed prompt engineering improves sentiment classification accuracy by 15%, our analysis shows that orthographic variation is the main barrier to automated analysis. To promote reproducibility and stimulate further research, all research artefacts, including annotated datasets, model implementations, and evaluation protocols, are made available under open licenses. In addition to establishing baseline metrics for upcoming comparative studies across South Asian literary traditions, this work advances the methodology of low-resource computational poetics.

Published

2025-12-31

How to Cite

1.
Meghwar A, Nasir MS. Compact Transformer Models for Classical Urdu Poetry: A Computational Stylistics Approach. Corporum [Internet]. 2025Dec.31 [cited 2026Jun.14];8(2):71-89. Available from: https://journals.au.edu.pk/ojscrc/index.php/crc/article/view/371