Beyond Accuracy: Explainability of Transformer Models for Sentiment Analysis

Authors

  • Shahriyar Shahid Aror University of Art, Architecture, Design & Heritage Sukkur, Pakistan
  • Abdul Aziz Aror University of Art, Architecture, Design & Heritage Sukkur, Pakistan
  • Muhammad Bilal Aror University of Art, Architecture, Design & Heritage Sukkur, Pakistan
  • Muhammad Shoaib Aror University of Art, Architecture, Design & Heritage Sukkur, Pakistan
  • Muhammad Aaqib Aror University of Art, Architecture, Design & Heritage Sukkur, Pakistan

Keywords:

Explainable AI, Hybrid Explainability, Urdu NLP, Transformer Models , Sentiment Analysis

Abstract

Transformer-based models achieve strong performance on Urdu sentiment analysis; however, their predictions are often difficult to interpret, which can undermine trust in practical applications. In this paper, we present a Hybrid LIMESHAP Attribution (HLSAE) Module. We fine-tune Urdu BERT and introduce a token-level explanation pipeline that combines LIME and SHAP. The method is evaluated on a dataset of 50,000 Urdu movie reviews. Compared with LIME or SHAP individually, the hybrid approach produces more stable attributions across multiple runs and perturbations. In a human evaluation involving native Urdu speakers, the explanations achieve a fidelity score of 0.72, while the classifier maintains an F1-score of 79.8%. The resulting visualizations highlight sentiment-bearing linguistic cues and reveal instances where the model relies on spurious correlations. These results demonstrate that explainability can be incorporated without sacrificing classification accuracy in low-resource sentiment analysis, and the proposed workflow can be extended to similar languages.

References

M. A. H. Muhammad Irzam Liaqat, “Sentiment analysis techniques, challenges, and opportunities: Urdu language-based analytical study,” PeerJ Comput. Sci., vol. 8, 2022, [Online]. Available: https://www.researchgate.net/publication/363184417_Sentiment_analysis_techniques_challenges_and_opportunities_Urdu_language-based_analytical_study

“Ethnologue: Languages of the World, 24th Edition | Request PDF.” Accessed: Mar. 29, 2026. [Online]. Available: https://www.researchgate.net/publication/352064261_Ethnologue_Languages_of_the_World_24th_Edition

U. Khan, M. Bin Ahmad, F. Shafiq, and M. Sarim, “Urdu Natural Language Processing Issues and Challenges: A Review Study,” Commun. Comput. Inf. Sci., vol. 1198, pp. 461–470, 2020, doi: 10.1007/978-981-15-5232-8_39.

B. Tahir and M. A. Mehmood, “UBERT22: Unsupervised Pre-training of BERT for Low Resource Urdu Language,” 2022 16th Int. Conf. Open Source Syst. Technol. ICOSST 2022 - Proc., 2022, doi: 10.1109/ICOSST57195.2022.10016821.

S. Tariq, T. A. Rana, and F. Shahzadi, “A comparative study of sentiment analysis in urdu and roman urdu: the neglected realms,” CSI Trans. ICT, vol. 13, no. 2–3, pp. 193–211, Sep. 2025, doi: 10.1007/s40012-025-00418-8.

Z. Ali, A. Aziz, A. Ali, A. Ullah, M. Aurangzeb, and M. A. Nazir, “Fine-Tuned training method for semantic text similarity measurement using SBERT, Bi-LSTM and Attention Network,” Proc. - 2023 Int. Conf. Mach. Vision, Image Process. Imaging Technol. MVIPIT 2023, pp. 134–140, 2023, doi: 10.1109/MVIPIT60427.2023.00028.

Abdul Aziz Ansari, M. Abdul Rehman, “Spatial Data Analysis: Recommendations for Educational Infrastructure in Sindh,” Sukkur IBA J. Comput. Math. Sci., vol. 1, no. 1, 2017, [Online]. Available: https://www.researchgate.net/publication/318987116_Spatial_Data_Analysis_Recommendations_for_Educational_Infrastructure_in_Sindh

A. Aziz et al., “Leverage Diagnosis Intensity in Medication Recommendations,” Lect. Notes Comput. Sci. (including Subser. Lect. Notes Artif. Intell. Lect. Notes Bioinformatics), vol. 14880 LNAI, pp. 38–50, 2024, doi: 10.1007/978-981-97-5678-0_4.

Sarthak Jain, Byron C. Wallace, “Attention is not Explanation,” arXiv:1902.10186, 2019, [Online]. Available: https://arxiv.org/abs/1902.10186

Alexis Conneau, German Kruszewski, Guillaume Lample, Loïc Barrault, Marco Baroni, “What you can cram into a single vector: Probing sentence embeddings for linguistic properties,” arXiv:1805.01070, 2018, [Online]. Available: https://arxiv.org/abs/1805.01070

A. E. M. Anna Mai, “Linguistic structure as a guiding principle for human neuroscience,” Neurosci. Biobehav. Rev., vol. 177, p. 106322, 2025, [Online]. Available: https://www.sciencedirect.com/science/article/pii/S0149763425003239

Leila Arras, Grégoire Montavon, Klaus-Robert Müller, Wojciech Samek, “Explaining Recurrent Neural Network Predictions in Sentiment Analysis,” arXiv:1706.07206, 2017, [Online]. Available: https://arxiv.org/abs/1706.07206

M. Rehan Ashraf, M. Hussain, M. Arfan Jaffar, W. Yousuf Ramay and M. Faheem, “Revolutionizing Urdu Sentiment Analysis: Harnessing the Power of XLM-R and GPT-2,” IEEE Access, vol. 12, pp. 99779–99793, 2024, doi: 10.1109/ACCESS.2024.3429496.

I. A. Siddhesh Pawar, Junyeong Park, Jiho Jin, Arnav Arora, Junho Myung, Srishti Yadav, Faiz Ghifari Haznitrama, Inhwa Song, Alice Oh, “Survey of Cultural Awareness in Language Models: Text and Beyond,” arXiv:2411.00860, 2024, [Online]. Available: https://arxiv.org/abs/2411.00860

S. S. Javier Troya, “Model Transformation Testing and Debugging: A Survey,” ACM Comput. Surv., vol. 55, no. 4, 2022, [Online]. Available: https://dl.acm.org/doi/full/10.1145/3523056

“Proposal for a Regulation laying down harmonised rules on artificial intelligence | Shaping Europe’s digital future.” Accessed: Feb. 08, 2026. [Online]. Available: https://digital-strategy.ec.europa.eu/en/library/proposal-regulation-laying-down-harmonised-rules-artificial-intelligence

Guang Xiang, Bin Fan, “Detecting offensive tweets via topical feature discovery over a large scale twitter corpus,” ACM Int. Conf. Proceeding Ser., 2012, [Online]. Available: https://dl.acm.org/doi/10.1145/2396761.2398556

Sunayana Sitaram, Khyathi Raghavi Chandu, Sai Krishna Rallabandi, Alan W Black, “A Survey of Code-switched Speech and Language Processing,” arXiv:1904.00784, 2019, [Online]. Available: https://arxiv.org/abs/1904.00784

K. T. Jacob Devlin, Ming-Wei Chang, Kenton Lee, “BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding,” arXiv:1810.04805, 2018, [Online]. Available: https://arxiv.org/abs/1810.04805

Marco Tulio Ribeiro, Sameer Singh, Carlos Guestrin, “‘Why Should I Trust You?’: Explaining the Predictions of Any Classifier,” arXiv:1602.04938, 2016, [Online]. Available: https://arxiv.org/abs/1602.04938

Hammad Rizwan, Muhammad Haroon Shakeel, “Hate-Speech and Offensive Language Detection in Roman Urdu,” EMNLP 2020 - 2020 Conf. Empir. Methods Nat. Lang. Process. Proc. Conf., 2020, [Online]. Available: https://www.researchgate.net/publication/347236442_Hate-Speech_and_Offensive_Language_Detection_in_Roman_Urdu

Michael A. Hedderich, Lukas Lange, Heike Adel, Jannik Strötgen, Dietrich Klakow, “A Survey on Recent Approaches for Natural Language Processing in Low-Resource Scenarios,” Assoc. Comput. Linguist., 2021, [Online]. Available: https://aclanthology.org/2021.naacl-main.201/

“IMDB Dataset of 50K Movie translated Urdu Reviews.” Accessed: Feb. 08, 2026. [Online]. Available: https://www.kaggle.com/datasets/akkefa/imdb-dataset-of-50k-movie-translated-urdu-reviews

Ilya Loshchilov, Frank Hutter, “Decoupled Weight Decay Regularization,” arXiv:1711.05101, 2017, [Online]. Available: https://arxiv.org/abs/1711.05101

Muhammad Bilal, Huma Israr, Muhammad Shahid,Amin Khan, “Sentiment classification of Roman-Urdu opinions using Naïve Bayesian, Decision Tree and KNN classification techniques,” J. King Saud Univ. - Comput. Inf. Sci., vol. 28, no. 3, pp. 330–344, 2016, [Online]. Available: https://www.sciencedirect.com/science/article/pii/S1319157815001330

Downloads

Published

2025-12-26

How to Cite

Shahriyar Shahid, Abdul Aziz, Muhammad Bilal, Muhammad Shoaib, & Muhammad Aaqib. (2025). Beyond Accuracy: Explainability of Transformer Models for Sentiment Analysis. International Journal of Innovations in Science & Technology, 7(10), 300–310. Retrieved from https://journal.50sea.com/index.php/IJIST/article/view/1704

Most read articles by the same author(s)