Deep learning techniques for contextual sentiment analysis in Urdu with negation awareness
Abstract
Sentiment analysis for under-resourced languages like Urdu presents substantial challenges due to the paucity of linguistic resources and the language's inherent morphological complexity. This thesis confronts these challenges through a systematic, comparative study to identify an optimal architectural approach for Urdu sentiment classification. The research addresses the critical issues of the "preprocessing dilemma" and ineffective negation handling by developing and rigorously evaluating two distinct models: a fine-tuned XLM-RoBERTa transformer and a novel hybrid model combining a Bidirectional LSTM with rule-based negation handling. The investigation begins by establishing a baseline, where a zero-shot multilingual model proves inadequate, achieving a Macro F1-Score of only 0.20 due to severe class bias. Subsequently, both candidate architectures undergo a methodical two-stage hyperparameter optimization of batch size and learning rate. The empirical results reveal a crucial trade-off between peak performance and model stability. The hybrid LSTM model achieves the peak performance, with a superior Macro F1-Score of 0.8196, demonstrating the potential of explicit negation handling. However, analysis of its training dynamics reveals significant instability and a strong tendency to overfit. In contrast, the fine-tuned XLM-RoBERTa model, while achieving a slightly lower F1-Score of 0.7840, demonstrates a markedly more stable and consistent learning process, indicating better generalization. Consequently, this study concludes that the fine-tuned XLM-RoBERTa is the more robust and reliable model, providing strong evidence that end-to-end fine-tuning of large transformer models is a highly effective strategy for morphologically rich, low-resource languages.