A Two-Stage Framework for Unsupervised Sentiment Analysis with Model Selection and Semantic Similarity Evaluation
DOI:
https://doi.org/10.29244/ijsa.v10i1p01-22Keywords:
Gemini AI, large language model, natural language processing, sentiment analysis, text analyticsAbstract
Sentiment analysis is widely used to extract user opinions from large-scale textual data. However, in practical settings, sentiment labels are often unavailable, making it difficult not only to perform sentiment classification but also to evaluate whether the predicted labels are reliable. This study proposes a two-stage framework for unsupervised sentiment analysis with model selection and semantic similarity evaluation. The dataset consists of Gemini app reviews, in which a labeled subset was used in the first stage to investigate the behavioral characteristics and predictive patterns of three sentiment analysis approaches: lexicon-based, transformer-based, and large language model (LLM)-based methods. The model with the most suitable performance was then selected and applied to predict sentiment labels for the remaining unlabeled data in the second stage. The predicted labels were further evaluated using embedding-based cosine similarity to assess semantic consistency within sentiment classes and separability between classes. The results show that the LLM-based method using Gemini 2.0 Flash achieved the best performance, with accuracy, balanced accuracy, and F1-score values above 0.91, followed by the transformer-based IndoBERT model, while the InSet lexicon-based method showed the weakest performance. In the second stage, semantic similarity evaluation revealed a high average intra-class similarity of 0.6699 and a low inter-class similarity of 0.1917, resulting in a similarity gap of 0.4783. These findings indicate that the proposed framework can support reliable sentiment prediction in largely unlabeled datasets by combining sample-based model selection with semantic validation.
Downloads
References
Alba, C., Warner, B. C., Saxena, A., Huang, J., & An, R. (2025). Towards Robust Sentiment Analysis of Temporally-Sensitive Policy-Related Online Text. In J. Zhao, M. Wang, & Z. Liu (Eds.), Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 4: Student Research Workshop) (pp. 958–976). https://doi.org/10.18653/v1/2025.acl-srw.70
Bing, L. (2012). Sentiment Analysis and Mining of Opinions. In Studies in Big Data (Vol. 30). https://doi.org/10.1007/978-3-319-60435-0_20
Blitzer, J., Dredze, M., & Pereira, F. (2007). Biographies, Bollywood, Boom-boxes and Blenders: Domain Adaptation for Sentiment Classification. In A. Zaenen & A. den Bosch (Eds.), Proceedings of the 45th Annual Meeting of the Association of Computational Linguistics (pp. 440–447). Retrieved from https://aclanthology.org/P07-1056/
Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., … Amodei, D. (2020). Language Models are Few-Shot Learners. Retrieved from http://arxiv.org/abs/2005.14165
Devlin, J., Chang, M.-W., Lee, K., & Kristina, T. (2019). BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. Retrieved from https://github.com/tensorflow/tensor2tensor
Diri, G., Obiorah, P., & Du, H. (2025). Comparative Study of Sentiment Analysis Techniques: Traditional Machine Learning vs. Deep Learning Approaches. Proceedings of the 2025 InSITE Conference, 23. https://doi.org/10.28945/5490
Fajri, K. (2017). GitHub - fajri91/InSet: Indonesia Sentiment Lexicon · GitHub. Retrieved May 6, 2026, from https://github.com/fajri91/InSet
Glorot, X., Bordes, A., & Bengio, Y. (2011). Domain adaptation for large-scale sentiment classification: a deep learning approach. Proceedings of the 28th International Conference on International Conference on Machine Learning, 513–520. Madison, WI, USA: Omnipress.
Hu, N., Zhang, J., & Pavlou, P. A. (2009). Overcoming the J-shaped distribution of product reviews. Communications of the ACM, 52(10): 144–147. https://doi.org/10.1145/1562764.1562800
Hua, Y. C., Denny, P., Wicker, J., & Taskova, K. (2024). A systematic review of aspect-based sentiment analysis: domains, methods, and trends. Artificial Intelligence Review, 57(11). https://doi.org/10.1007/s10462-024-10906-z
Huang, E., Socher, R., Manning, C., & Ng, A. (2012). Improving Word Representations via Global Context and Multiple Word Prototypes. In H. Li, C.-Y. Lin, M. Osborne, G. G. Lee, & J. C. Park (Eds.), Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) (pp. 873–882). Retrieved from https://aclanthology.org/P12-1092/
Lee, S., & Kim, W. (2017). Sentiment labeling for extending initial labeled data to improve semi-supervised sentiment classification. Electronic Commerce Research and Applications, 26: 35–49. https://doi.org/https://doi.org/10.1016/j.elerap.2017.09.006
Liu, H., Rallabandi, S., Wu, Y., Dakle, P., & Raghavan, P. (2024). Self-training Strategies for Sentiment Analysis: An Empirical Study. In Y. Graham & M. Purver (Eds.), Findings of the Association for Computational Linguistics: EACL 2024 (pp. 1944–1954). https://doi.org/10.18653/v1/2024.findings-eacl.131
Loshchilov, I., & Hutter, F. (2019). Decoupled Weight Decay Regularization. Retrieved from http://arxiv.org/abs/1711.05101
Manning, C. D., Raghavan, P., & Schütze, H. (2008). Introduction to Information Retrieval. https://doi.org/DOI: 10.1017/CBO9780511809071
Mao, Y., Liu, Q., & Zhang, Y. (2024, April 1). Sentiment analysis methods, applications, and challenges: A systematic literature review. Journal of King Saud University - Computer and Information Sciences, Vol. 36. https://doi.org/10.1016/j.jksuci.2024.102048
Nasution, A. H., Onan, A., Murakami, Y., Monika, W., & Hanafiah, A. (2025). Benchmarking Open-Source Large Language Models for Sentiment and Emotion Classification in Indonesian Tweets. IEEE Access, 13: 94009–94025. https://doi.org/10.1109/ACCESS.2025.3574629
Pang, B., & Lee, L. (2008). Opinion Mining and Sentiment Analysis. Foundations and Trends in Information Retrieval, 2(1–2): 1–135. https://doi.org/10.1561/1500000011
Ravi, K., & Ravi, V. (2015). A survey on opinion mining and sentiment analysis: Tasks, approaches and applications. Knowledge-Based Systems, 89: 14–46. https://doi.org/https://doi.org/10.1016/j.knosys.2015.06.015
Reimers, N., & Gurevych, I. (2019). Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks. In K. Inui, J. Jiang, V. Ng, & X. Wan (Eds.), Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP) (pp. 3982–3992). https://doi.org/10.18653/v1/D19-1410
Rostami, M., Bose, D., Narayanan, S., & Galstyan, A. (2023). Domain Adaptation for Sentiment Analysis Using Robust Internal Representations. In H. Bouamor, J. Pino, & K. Bali (Eds.), Findings of the Association for Computational Linguistics: EMNLP 2023 (pp. 11484–11498). https://doi.org/10.18653/v1/2023.findings-emnlp.769
Shan Lee, V. L., Gan, K. H., Tan, T. P., & Abdullah, R. (2019). Semi-supervised Learning for Sentiment Classification using Small Number of Labeled Data. Procedia Computer Science, 161: 577–584. https://doi.org/https://doi.org/10.1016/j.procs.2019.11.159
Sokolova, M., & Lapalme, G. (2009). A systematic analysis of performance measures for classification tasks. Information Processing and Management, 45(4): 427–437. https://doi.org/10.1016/j.ipm.2009.03.002
Taboada, M., Brooke, J., Tofiloski, M., Voll, K., & Stede, M. (2011). Lexicon-Based Methods for Sentiment Analysis. Computational Linguistics, 37(2): 267–307. https://doi.org/10.1162/COLI_a_00049
Turney, P. D. (2002). Thumbs Up or Thumbs Down? Semantic Orientation Applied to Unsupervised Classification of Reviews. Retrieved from http://www.google.com
Van Der Veen, A. M., & Bleich, E. (2025). The advantages of lexicon-based sentiment analysis in an age of machine learning. PLoS ONE, 20(1 January). https://doi.org/10.1371/journal.pone.0313092
Wei, J., Wang, X., Schuurmans, D., Bosma, M., Ichter, B., Xia, F., … Zhou, D. (2023). Chain-of-Thought Prompting Elicits Reasoning in Large Language Models. Retrieved from http://arxiv.org/abs/2201.11903
Wilie, B., Vincentio, K., Winata, G. I., Cahyawijaya, S., Li, X., Lim, Z. Y., … Purwarianti, A. (2020). IndoNLU: Benchmark and Resources for Evaluating Indonesian Natural Language Understanding. In K.-F. Wong, K. Knight, & H. Wu (Eds.), 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 Processing (pp. 843–857). https://doi.org/10.18653/v1/2020.aacl-main.85
Zhao, Z., Ma, Z., Lin, Z., Xie, J., Li, Y., & Shen, Y. (2024). Source-free Domain Adaptation for Aspect-based Sentiment Analysis. In N. Calzolari, M.-Y. Kan, V. Hoste, A. Lenci, S. Sakti, & N. Xue (Eds.), Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024) (pp. 15076–15086). Retrieved from https://aclanthology.org/2024.lrec-main.1310/




