Two-Stage Framework Using IndoBERT for Sentiment Analysis of Tokopedia Reviews under Extreme Class Imbalance
DOI:
10.33395/sinkron.v10i3.16187Keywords:
Class Imbalance; IndoBERT; Indonesian E-Commerce; Sentiment Analysis; Two-Stage Classification.Abstract
The rapid growth of the Indonesian e-commerce industry has generated a large volume of customer reviews for sentiment analysis, but the data distribution often suffers from extreme class imbalance. The review dataset exhibits a 97.6% dominance of the positive class, causing the single-stage transformer model to produce high accuracy that does not fully represent classification capability. The baseline model achieves a macro-averaged F1-score of 0.599, with a neutral-class recall of 26.3%. Approaches based on loss function adjustment, such as class-balanced loss, focal loss, weighted cross-entropy, and decision-threshold adjustment, are unable to fundamentally address this issue, yielding only limited performance improvements. This study proposes a two-stage classification approach that decomposes the multi-class classification task into two sequential binary classification stages using a BERT-based Indonesian-language transformer model (IndoBERT). The first stage separates the positive class from the non-positive class, while the second stage distinguishes between the neutral and negative classes in a more balanced decision space. The proposed approach achieves a macro-averaged F1-score of 0.761, representing a 16.2% improvement over the baseline and outperforming all loss-function-based methods. These findings suggest that, under conditions of extreme class imbalance, simplifying the decision space through gradual task decomposition is more effective than intervention at the loss-function level. Furthermore, error propagation analysis and qualitative evaluations demonstrate that this approach improves sensitivity to minority classes, although challenges remain in cases involving ambiguous expressions.
Downloads
References
Abdulkreem, R. Z., & Abdulazeez, A. M. (2025). A Comparative Study of Multi-class Classification Based on Imbalanced Data: A Review. The Indonesian Journal of Computer Science, 14(5), 8211–8233. https://doi.org/https://doi.org/10.33022/ijcs.v14i5.5020
Abdurrahman, S. (2025). Tokopedia Product Reviews 2025. Kaggle.Com. https://doi.org/10.34740/KAGGLE/DS/8992580
Adhim, N. F., & Cahyono, N. (2025). Optimization of IndoBERT for Sentiment Analysis of FOMO on Social Media Through Fine-Tuning and Hybrid Labeling. Journal of Applied Informatics and Computing (JAIC), 9(6), 3786–3797. https://doi.org/https://doi.org/10.30871/jaic.v9i6.11686
Airalngga, G. (2025). A Comparative Analysis of Deep Learning Architectures for Obesity Classification Using Structured Data. Jurnal Informatika Ekonomi Bisnis, 7, 12–20. https://doi.org/10.37034/infeb.v7i1.1090
Alaiya, A., & Agusniar, C. (2025). Sentiment Analysis of E-Commerce Product Reviews on Tokopedia Using Support Vector Machine. Journal of Applied Informatics and Computing, 9(5), 2869–2878. https://doi.org/https://doi.org/10.30871/jaic.v9i5.10977
Anadra, R., Wijayanto, H., & Sadik, K. (2025). Sentiment Analysis of Tokopedia Customer Reviews Using BiLSTM and IndoBERT with Comparative Analysis of Preprocessing and Labeling Methods. International Journal of Advances in Data and Information Systems, 6(3), 773–788. https://doi.org/10.59395/ijadis.v6i3.1458
Barman, P. K. (2026). CLiGNet : Clinical Label-Interaction Graph Network for Medical Specialty Classification from Clinical Transcriptions (Vol. 1, Issue 1). arXiv. https://doi.org/https://doi.org/10.48550/arXiv.2603.22752
Cartus, A. R., Samuels, E. A., Cerdá, M., & Marshall, B. D. L. (2023). Outcome class imbalance and rare events: An underappreciated complication for overdose risk prediction modeling. National Library of Medicine, 118(6), 1167–1176. https://doi.org/https://doi.org/10.1111/add.16133
Chen, H., Wu, Y., & Wu, F. (2025). Precision Medicine in Lung Cancer Screening : A Paradigm Shift in Early Detection — Precision Screening for Lung Cancer. MDPI, 15, 1–20. https://doi.org/https://doi.org/10.3390/diagnostics15121562
Cui, S., Han, Y., Duan, Y., Li, Y., Zhu, S., & Song, C. (2023). A Two-Stage Voting-Boosting Technique for Ensemble Learning in Social Network Sentiment Classification. MDPI, 25, 1–24. https://doi.org/10.3390/e25040555
Cui, Y., Jia, M., Lin, T., & Tech, C. (2019). Class-Balanced Loss Based on Effective Number of Samples. https://doi.org/https://doi.org/10.48550/arXiv.1901.05555
Fernandes, J. (2026). How do American consumers verify online retailers before purchasing? Yougov.Com. https://yougov.com/en-us/articles/53837-how-do-american-consumers-verify-online-retailers-before-purchasing
Fu, Y., Huang, H., Guan, Y., Wang, Y., & Liu, W. (2021). Knowledge-Based Systems EBRB cascade classifier for imbalanced data via rule weight updating. Knowledge-Based Systems, 223, 107010. https://doi.org/10.1016/j.knosys.2021.107010
Goodfellow, I. (2016). Deep Learning. MIT Press.
He, L. (2024). Enhanced twitter sentiment analysis with dual joint classifier integrating RoBERTa and BERT architectures. Frontiers in Physics, December, 1–12. https://doi.org/10.3389/fphy.2024.1477714
Henning, S., Beluch, W., Fraser, A., & Friedrich, A. (2023). A Survey of Methods for Addressing Class Imbalance in Deep-Learning Based Natural Language Processing. Proceedings of the 17th Conference of the European Chapter of the Association for Computational Linguistics, 2022, 523–540.
Kementerian Perdagangan. (2025). Kinerja Perdagangan Melalui Sistem Elektronik (PMSE) Indonesia Tahun 2025.
Labd, Z., Bahassine, S., & Housni, K. (2025). AFL-BERT : Enhancing Minority Class Detection in Multi-Label Text Classification with Adaptive Focal. International Journal of Advanced Computer Science and Applications(IJACSA), 16(7), 496–501. https://doi.org/10.14569/IJACSA.2025.0160749
Leevy, J. L., Khoshgoftaar, T. M., Bauder, R. A., & Seliya, N. (2018). A survey on addressing high ‑ class imbalance in big data. Journal of Big Data. https://doi.org/10.1186/s40537-018-0151-6
Lin, S., Frasincar, F., & Klinkhamer, J. (2025). Hierarchical Deep Learning for Multi-label Imbalanced Text Classification of Economic Literature. Applied Soft Computing, 31(0).
Lin, T., Ai, F., & Doll, P. (2017). Focal Loss for Dense Object Detection. https://doi.org/10.48550/arXiv.1708.02002
Lumansik, D. K., & Yanda Bara Kusuma. (2025). THE INFLUENCE OF ONLINE CUSTOMER REVIEW AND ONLINE CUSTOMER RATINGS ON PURCHASE DECISIONS IN TIKTOK SHOP. Indonesian Interdisciplinary Journal of Sharia Economics (IIJSE), 8(2), 4427–4443. https://doi.org/https://doi.org/10.31538/iijse.v8i2.6108
Moral, P. D. E. L., Nowaczyk, S., & Pashami, S. (2022). Why Is Multiclass Classification Hard ? IEEE Access, 10(June). https://doi.org/10.1109/ACCESS.2022.3192514
Munthe, S. R., & Levianti, R. A. (2025). Hybrid Framework Addressing Imbalanced Data in Indonesian E-commerce Multimodal Sentiment Analysis. Information and Communication Technology (ICT), 14(November), 363–370. https://doi.org/10.34148/teknika.v14i3.1332
Murphy, K. P. (2022). Adaptive Computation and Machine Learning.
Oh, S. H. (2022). Probabilistic Target Encoding of Neural Networks with Softmax Output Nodes. International Journal of Contents, 18(4). https://doi.org/https://doi.org/10.5392/IJoC.2022.18.4.102
Razali, M. N., Arbaiy, N., & Lin, P. (2025). Optimizing Multiclass Classification Using Convolutional Neural Networks with Class Weights and Early Stopping for Imbalanced Datasets. MDPI, 14, 1–14. https://doi.org/https://doi.org/10.3390/electronics14040705
Ribeiro, R. P. (2015). A Survey of Predictive Modelling under Imbalanced Distributions. https://doi.org/https://doi.org/10.48550/arXiv.1505.01658
Rizqilla, M., Nurani, D., Supriatin, Rahmi, A. N., & Maemunah, M. (2025). Analisis Sentimen Kinerja Jokowi Menggunakan Metode Naïve Bayes. Riset Dan E-Jurnal Manajemen Informatika Komputer, 9(2), 550–561. https://doi.org/http://doi.org/10.33395/remik.v9i2.14670
Sa, M. Ü. (2025). Accuracy Comparison of Machine Learning Algorithms on World Happiness Index Data. MDPI, 13. https://doi.org/https://doi.org/10.3390/math13071176
Saputra, I., & Ginting, G. L. (2025). Sentiment Analysis of Tokopedia Customer Reviews using IndoBERT and SMOTE for Class Imbalance Handling. Journal of Computer System and Informatics (JoSYC), 7(1), 20–27. https://doi.org/10.47065/josyc.v7i1.8748
Setyawan, A. F., & Nugraha, R. I. (2025). OPTIMIZING GPT AND INDOBERT FOR SENTIMENT ANALYSIS AND CONSUMER TREND PREDICTION ON LAZADA PRODUCT REVIEWS. JIKO (Jurnal Informatika Dan Komputer), 8(2), 113–120. https://doi.org/10.33387/jiko.v8i2.10066
Shen, X., Zhang, L., & Wang, L. (2026). A Unified Complementary Regularization Framework for Long-Tailed Image Classification. Applied Sciences, 16. https://doi.org/https://doi.org/10.3390/app16031656
Sidik, A., Purnamasari, A. I., Pratama, D., Marta, P. P., & Wijaya, Y. A. (2026). Application of Weighted Loss Function in Convolutional Neural Network for Acne Image Classification. Journal of Artificial Intelligence and Engineering Applications, 5(2), 2–7.
Siva, A. B., & Hoki, L. (2026). Comparison of IndoBERT and SVM Performance in Sentiment Analysis of Digital Education Platforms. Sinkron : Jurnal Dan Penelitian Teknik Informatika, 10(1), 64–74. https://doi.org/10.33395/sinkron.v10i1.15472
Widyananda, W., & Fauzi, A. (2025). Sentiment analysis of Indonesian e-commerce product reviews using machine learning classifiers. International Journal of Science and Research Archive, 16(02), 445–450. https://doi.org/https://doi.org/10.30574/ijsra.2025.16.2.2345
Wilie, B., Vincentio, K., Winata, G. I., Cahyawijaya, S., Li, X., Lim, Z. Y., Soleman, S., Mahendra, R., Fung, P., Bahar, S., & Purwarianti, A. (2020). IndoNLU : Benchmark and Resources for Evaluating Indonesian Natural Language Understanding. Proceedings of the 1st Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 10th International Joint Conference on Natural Language Processin, 843–857.
Wu, Z., Wang, Y., Shen, L., Hu, F., & Yu, H. (2024). Leveraging Uncertainty for Depth-Aware Hierarchical Text Classification. Computers, Materials and Continua. https://doi.org/10.32604/cmc.2024.054581
Xiong, H., & Yao, A. (2023). Deep Imbalanced Regression via Hierarchical Classification Adjustment. https://doi.org/https://doi.org/10.48550/arXiv.2310.17154
Yuan, D., Liang, G., Liu, B., & Liu, S. (2025). Qwen TextCNN and BERT models for enhanced multilabel news classification in mobile apps. Nature, 15, 1–22. https://doi.org/https://doi.org/10.1038/s41598-025-27497-6
Zahro, A. C., Alzami, F., Sani, R. R., & Fahmi, A. (2025). Fairer Public Complaint Classification on LaporGub : Integrating XLM-RoBERTa with Focal Loss for Imbalance Data. Sinkron : Jurnal Dan Penelitian Teknik Informatika, 9(4), 1850–1862. https://doi.org/10.33395/sinkron.v9i4.15260
Zhang, X., & Provost, S. (2020). Threshold Moving Approaches for Addressing the Class Imbalance Problem and their Application to Multi-label Classification. ICAIP ’20: Proceedings of the 4th International Conference on Advances in Image Processing, 72–77. https://doi.org/10.1145/3441250.3441274
Zhao, M., Wang, S., & Id, T. X. (2025). The social welfare effect of e-commerce product reputation information asymmetry from the perspective of network externality. PLoS ONE, 1–20. https://doi.org/10.1371/journal.pone.0313852
Zhou, W., Liu, C., Yuan, P., & Jiang, L. (2024). applied sciences An Undersampling Method Approaching the Ideal Classification Boundary for Imbalance Problems. Applied Sciences, 14. https://doi.org/https://doi.org/10.3390/app14135421
Zhou, Z. G. (2022). Research on Sentiment Analysis Model of Short Text Based on Deep Learning. Scientific Programming, 2022. https://doi.org/10.1155/2022/2681533
Downloads
How to Cite
Issue
Section
License
Copyright (c) 2026 Ades Tikaningsih, Imam Tahyudin, Berlilana

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.






















Moraref
PKP Index
Indonesia OneSearch
OCLC Worldcat
Index Copernicus
Scilit
