Research Article

A Comparative Analysis of Transformer Architectures for Sentiment and Emotion Classification

Volume: 13 Number: 4 December 31, 2025
EN TR

A Comparative Analysis of Transformer Architectures for Sentiment and Emotion Classification

Abstract

This paper is a comparison of four Transformer model (BERT, ALBERT, T5, and XLNet) in the case of sentiment analysis of tasks based on data from social media. Used were two data sets: the X (Twitter) data set with tweets of messages related to games and the Emotion data set labeled in the anger, joy, and fear categories. Trained was the model in the same settings of preprocessing, training, as well as in the test settings for 3, 5, 7, and 10 epochs. Presented were results that indicated that the accuracy increased with the higher number of epochs. The maximum accuracies occurred in the case of the BERT model—88.63% in the case of the X data set as well as in the case of the Emotion data set, 97.05%. XLNet established great potential for long-range dependencies, and ALBERT obtained balanced performance due to lightweight architecture. On the contrary, performance of T5 was less in comparison to others. Generally, it could be inferred that Transformer architecture is superior to traditional machine learning technique in the context of sentiment analysis due to higher accuracy and better contextual understanding.

Keywords

References

  1. [1] P. Nandwani and R. Verma, “A review on sentiment analysis and emotion detection from text,” Soc Netw Anal Min, vol. 11, no. 1, p. 81, 2021.
  2. [2] S. Ghosh, A. Ekbal, and P. Bhattacharyya, “Natural language processing and sentiment analysis: perspectives from computational intelligence,” in Computational intelligence applications for text and sentiment data analysis, Elsevier, 2023, pp. 17–47.
  3. [3] E. Kına, “TRANSFORMER TABANLI DUYGU SINIFLANDIRMASI İLE SOSYAL MEDYADA RUH SAĞLIĞINA İLİŞKİN TÜRKÇE YORUMLARIN ANALİZİ,” Kahramanmaraş Sütçü İmam Üniversitesi Mühendislik Bilimleri Dergisi, vol. 28, no. 3, pp. 1499–1511, 2025.
  4. [4] E. Kına and E. Biçek, “Machine Learning Approach for Emotion Identification and Classification in Bitcoin Sentiment Analysis,” Yüzüncü Yıl Üniversitesi Fen Bilimleri Enstitüsü Dergisi, vol. 29, no. 3, pp. 913–926, 2024, doi: https://doi.org/10.53433/yyufbed.1532649.
  5. [5] E. Kına and E. Biçek, “Tweetlerin Duygu Analizi İçin Hibrit Bir Yaklaşım,” Doğu Fen Bilimleri Dergisi, vol. 6, no. 1, pp. 57–68, 2023, doi: 10.57244/DFBD.1314901.
  6. [6] H. Bashiri and H. Naderi, “Comprehensive review and comparative analysis of transformer models in sentiment analysis,” Knowl Inf Syst, vol. 66, no. 12, pp. 7305–7361, Dec. 2024, doi: 10.1007/S10115-024-02214-3/FIGURES/10.
  7. [7] F. A. Acheampong, H. Nunoo-Mensah, and W. Chen, “Transformer models for text-based emotion detection: a review of BERT-based approaches,” Artif Intell Rev, vol. 54, no. 8, pp. 5789–5829, Dec. 2021, doi: 10.1007/S10462-021-09958-2/TABLES/18.
  8. [8] A. Areshey and H. Mathkour, “Exploring transformer models for sentiment classification: A comparison of BERT, RoBERTa, ALBERT, DistilBERT, and XLNet,” Expert Syst, vol. 41, no. 11, p. e13701, Nov. 2024, doi: 10.1111/EXSY.13701.

Details

Primary Language

English

Subjects

Software Engineering (Other)

Journal Section

Research Article

Publication Date

December 31, 2025

Submission Date

October 13, 2025

Acceptance Date

November 10, 2025

Published in Issue

Year 2025 Volume: 13 Number: 4

APA
Temel, H., & Kına, E. (2025). A Comparative Analysis of Transformer Architectures for Sentiment and Emotion Classification. Balkan Journal of Electrical and Computer Engineering, 13(4), 470-482. https://doi.org/10.17694/bajece.1802918
AMA
1.Temel H, Kına E. A Comparative Analysis of Transformer Architectures for Sentiment and Emotion Classification. Balkan Journal of Electrical and Computer Engineering. 2025;13(4):470-482. doi:10.17694/bajece.1802918
Chicago
Temel, Hayrullah, and Erol Kına. 2025. “A Comparative Analysis of Transformer Architectures for Sentiment and Emotion Classification”. Balkan Journal of Electrical and Computer Engineering 13 (4): 470-82. https://doi.org/10.17694/bajece.1802918.
EndNote
Temel H, Kına E (December 1, 2025) A Comparative Analysis of Transformer Architectures for Sentiment and Emotion Classification. Balkan Journal of Electrical and Computer Engineering 13 4 470–482.
IEEE
[1]H. Temel and E. Kına, “A Comparative Analysis of Transformer Architectures for Sentiment and Emotion Classification”, Balkan Journal of Electrical and Computer Engineering, vol. 13, no. 4, pp. 470–482, Dec. 2025, doi: 10.17694/bajece.1802918.
ISNAD
Temel, Hayrullah - Kına, Erol. “A Comparative Analysis of Transformer Architectures for Sentiment and Emotion Classification”. Balkan Journal of Electrical and Computer Engineering 13/4 (December 1, 2025): 470-482. https://doi.org/10.17694/bajece.1802918.
JAMA
1.Temel H, Kına E. A Comparative Analysis of Transformer Architectures for Sentiment and Emotion Classification. Balkan Journal of Electrical and Computer Engineering. 2025;13:470–482.
MLA
Temel, Hayrullah, and Erol Kına. “A Comparative Analysis of Transformer Architectures for Sentiment and Emotion Classification”. Balkan Journal of Electrical and Computer Engineering, vol. 13, no. 4, Dec. 2025, pp. 470-82, doi:10.17694/bajece.1802918.
Vancouver
1.Hayrullah Temel, Erol Kına. A Comparative Analysis of Transformer Architectures for Sentiment and Emotion Classification. Balkan Journal of Electrical and Computer Engineering. 2025 Dec. 1;13(4):470-82. doi:10.17694/bajece.1802918

All articles published by BAJECE are licensed under the Creative Commons Attribution 4.0 International License. This permits anyone to copy, redistribute, remix, transmit and adapt the work provided the original work and source is appropriately cited.Creative Commons Lisansı