IMPLEMENTATION OF TRANSFORMER MODEL FOR FINE-GRAINED EMOTION DETECTION ON SOCIAL MEDIA "X"
Abstract
Deteksi emosi secara fine-grained pada teks media sosial merupakan salah satu tantangan dalam bidang pemrosesan bahasa alami (Natural Language Processing/NLP), terutama karena sifat data yang tidak terstruktur dan multi-label. Penelitian ini bertujuan untuk mengevaluasi performa tiga model berbasis arsitektur Transformer, yaitu EmoBERT, RoBERTa, dan EmoRoBERTa, dalam tugas klasifikasi emosi pada teks dari dataset SenWave. Dataset ini terdiri dari 10.001 tweet berbahasa Inggris yang telah dilabeli ke dalam sepuluh kategori emosi, namun penelitian ini berfokus pada empat label utama: anxious, annoyed, empathetic, dan sad. Proses penelitian meliputi prapemrosesan data, tokenisasi, pembagian data latih dan uji, pelatihan model, serta evaluasi menggunakan metrik akurasi, presisi, recall, dan f1-score. Hasil evaluasi menunjukkan bahwa model EmoBERT dan EmoRoBERTa memiliki performa terbaik dengan nilai f1-score sebesar 0,81, sedangkan RoBERTa memperoleh nilai f1-score sebesar 0,73. Temuan ini menunjukkan bahwa penyesuaian arsitektur Transformer khusus untuk emosi dapat meningkatkan akurasi klasifikasi emosi pada teks media sosial.
References
“Number of X (formerly Twitter) us-ers worldwide from 2019 to 2024.” Accessed: Jul. 27, 2025. [Online]. Available: https://www.statista.com/statistics/303681/twitter-users-worldwide/
A. Y. Syantara, E. D. Wahyuni, and V. R. S. Nastiti, “Analisis Sentimen Pada Media Sosial Twitter Menggunakan Naïve Bayes Classifier Terhadap Kata Kunci,” vol. 3, no. 5.
M. H. Algifari and E. D. Nugroho, “Emotion Classification of Indone-sian Tweets using BERT Embed-ding,” J. Appl. Inform. Comput., vol. 7, no. 2, pp. 172–176, Nov. 2023, doi: 10.30871/jaic.v7i2.6528.
A. Karamat, M. Imran, M. U. Yaseen, R. Bukhsh, S. Aslam, and N. Ashraf, “A Hybrid Transformer Ar-chitecture for Multiclass Mental Ill-ness Prediction Using Social Media Text,” IEEE Access, vol. 13, pp. 12148–12167, 2025, doi: 10.1109/ACCESS.2024.3519308.
L. Wu, Y. Long, C. Gao, Z. Wang, and Y. Zhang, “MFIR: Multimodal fusion and inconsistency reasoning for explainable fake news detection,” Inf. Fusion, vol. 100, p. 101944, Dec. 2023, doi: 10.1016/j.inffus.2023.101944.
O. T. Aduragba, J. Yu, and A. I. Cristea, “Detecting Fine-Grained Emotions on Social Media during Major Disease Outbreaks: Health and Well-being before and during the COVID-19 Pandemic”.
A. Chiorrini, C. Diamantini, A. Mircoli, and D. Potena, “Emotion and sentiment analysis of tweets us-ing BERT”.
R. Liu and Z. Ma, “Emotion-Aware Speech Self-Supervised Representa-tion Learning with Intensity Knowledge,” in Interspeech 2024, ISCA, Sep. 2024, pp. 3180–3184. doi: 10.21437/Interspeech.2024-2518.
S. Fan et al., “Sentiment-Aware Word and Sentence Level Pre-training for Sentiment Analysis,” in Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, Y. Goldberg, Z. Kozareva, and Y. Zhang, Eds., Abu Dhabi, United Arab Emirates: Association for Computational Lin-guistics, Dec. 2022, pp. 4984–4994. doi: 10.18653/v1/2022.emnlp-main.332.
O. T. Aduragba, J. Yu, and A. I. Cristea, “SenWave: A Fine-Grained Multi-Language Sentiment Analysis Dataset Sourced from COVID-19 Tweets.” [Online]. Available: https://github.com/gitdevqiang/SenWave
H.-T. Duong and T.-A. Nguyen-Thi, “A review: preprocessing tech-niques and data augmentation for sentiment analysis,” Comput. Soc. Netw., vol. 8, no. 1, p. 1, Dec. 2021, doi: 10.1186/s40649-020-00080-x.
A. K. Salih, A. K. Faraj, M. A. Ahmed, and A. N. A. Al-Hasnawi, “The Impact of Data Splitting Strate-gy on Drilling Rate Prediction in the Rumaila Oil Field,” Pet. Chem., vol. 64, no. 7, pp. 781–786, Jul. 2024, doi: 10.1134/S0965544124050025.
J. Liu, X. Wei, X. Liu, H. Gao, and Y. Wang, “Group-based Hierar-chical Federated Learning: Conver-gence, Group Formation, and Sam-pling,” in Proceedings of the 52nd International Conference on Parallel Processing, Salt Lake City UT USA: ACM, Aug. 2023, pp. 264–273. doi: 10.1145/3605573.3605584.
A. Nurunnabi and F. N. Teferle, “RESAMPLING METHODS FOR A RELIABLE VALIDATION SET IN DEEP LEARNING BASED POINT CLOUD CLASSIFICATION,” Int. Arch. Photogramm. Remote Sens. Spat. Inf. Sci., vol. XLIII-B2-2022, pp. 617–624, May 2022, doi: 10.5194/isprs-archives-XLIII-B2-2022-617-2022.
T. V. Kale and S. Mendhe, “A Review on Advances in Sentiment Analysis: A Deep Learning Approach Using Transformer Based Models,” in 2025 4th International Conference on Sentiment Analysis and Deep Learning (ICSADL), Bhimdatta, Ne-pal: IEEE, Feb. 2025, pp. 235–239. doi: 10.1109/ICSADL65848.2025.10933230.
D. Sui et al., “A Simple and In-teractive Transformer for Fine-Grained Emotion Detection,” IEEE Trans. Audio Speech Lang. Process., vol. 33, pp. 347–358, 2025, doi: 10.1109/TASLP.2024.3487418.
O. E. Ojo, H. T. Ta, A. Gelbukh, H. Calvo, O. O. Adebanji, and G. Si-dorov, “Transformer-Based Ap-proaches to Sentiment Detection,” in Recent Developments and the New Directions of Research, Foundations, and Applications, vol. 423, S. N. Shahbazova, A. M. Abbasov, V. Kreinovich, J. Kacprzyk, and I. Z. Batyrshin, Eds., in Studies in Fuzzi-ness and Soft Computing, vol. 423. , Cham: Springer Nature Switzerland, 2023, pp. 101–110. doi: 10.1007/978-3-031-23476-7_10.
M. G. Parvatikar, S. Rao, P. M. Jayanth Rao, and B. M. Sagar, “Deep Learning Approaches To Simile De-tection: Insights From Bert and LSTM,” in 2024 15th International Conference on Computing Communi-cation and Networking Technologies (ICCCNT), Kamand, India: IEEE, Jun. 2024, pp. 1–6. doi: 10.1109/ICCCNT61001.2024.10724440.
F. H. Labib, M. Elagamy, and S. N. Saleh, “EmoBERTa-X: Advanced Emotion Classifier with Multi-Head Attention and DES for Multilabel Emotion Classification,” Big Data Cogn. Comput., vol. 9, no. 2, p. 48, Feb. 2025, doi: 10.3390/bdcc9020048.
J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, “BERT: Pre-training of Deep Bidirectional Trans-formers for Language Understand-ing,” in Proceedings of the 2019 Conference of the North, Minneap-olis, Minnesota: Association for Computational Linguistics, 2019, pp. 4171–4186. doi: 10.18653/v1/N19-1423.
A. A. Shujaaddeen, F. Mutaher Ba -Alwi, A. T. Zahary, and A. Sul-tan Alhegami, “A Model for Measur-ing the Effect of Splitting Data Method on the Efficiency of Machine Learning Models: A Comparative Study,” in 2024 4th International Conference on Emerging Smart Technologies and Applications (eSmarTA), Sana’a, Yemen: IEEE, Aug. 2024, pp. 1–13. doi: 10.1109/eSmarTA62850.2024.10639022.
A. Aljabar and B. M. Karomah, “Mengungkap Opini Publik: Pen-dekatan BERT-based- caused untuk Analisis Sentimen pada Komentar Film,” vol. 5, no. 1, 2024.
G. Z. Nabiilah, “Effectiveness Analysis of RoBERTa and Distil-BERT in Emotion Classification Task on Social Media Text Data,” Eng. Math. Comput. Sci. J. EMACS, vol. 7, no. 1, pp. 45–50, Jan. 2025, doi: 10.21512/emacsjournal.v7i1.12618.
T.-M. Lin, J.-Y. Chang, and L.-H. Lee, “NCUEE-NLP at WASSA 2023 Empathy, Emotion, and Personality Shared Task: Perceived Intensity Prediction Using Sentiment-Enhanced RoBERTa Transformers”.
F. Alqarni, A. Sagheer, A. Al-abbad, and H. Hamdoun, “Emotion-Aware RoBERTa enhanced with emotion-specific attention and TF-IDF gating for fine-grained emotion recognition,” Sci. Rep., vol. 15, no. 1, p. 17617, May 2025, doi: 10.1038/s41598-025-99515-6.








