Sentiment Analysis of Google Gemini Reviews Using K-Nearest Neighbor and Particle Swarm Optimization

  • Siraj Fatwa Sidqy Universitas Pembangunan Jaya
  • Yunus Widjaya Universitas Pembangunan Jaya
Keywords: Sentiment Analysis, Google Gemini, K-Nearest Neighbor, Particle Swarm Optimization, CountVectorizer

Abstract

Google Gemini, Google's generative AI assistant, receives a large volume of user reviews on the Google Play Store daily, making manual reading of user opinions impractical. This study analyzes the sentiment of Indonesian-language Google Gemini reviews using K-Nearest Neighbor (KNN) as the baseline classifier, then optimizes the k parameter through Particle Swarm Optimization (PSO) to examine its effect on classification performance. A total of 5,000 reviews were collected via web scraping using the Google Play Scraper library between 1 June and 1 September 2026, followed by preprocessing (duplicate removal, cleaning, case folding, normalization, tokenization, and stopword removal), leaving 2,858 labeled reviews, of which 2,000 were used for modeling. Negative, Neutral, and Positive labels were assigned automatically from each reviewer's star rating. Text was represented using CountVectorizer, producing 2,282 features, split into 1,600 training and 400 testing samples via stratified sampling. The baseline KNN model with k=5 achieved 79.50% accuracy, while PSO selected k=4 with a best cost of 0.188125, yielding a KNN-PSO accuracy of 80.75%, a 1.25 percentage-point increase. This improvement was accompanied by a rise in macro F1-score from 0.441 to 0.458 and weighted F1-score from 0.765 to 0.780, mainly driven by the Negative and Positive classes, while the Neutral class remained undetected by both models (F1=0). These findings indicate that PSO optimization yields a consistent but limited improvement, and does not resolve the underlying difficulty of identifying

Published
2026-10-09
How to Cite
Sidqy, S. F., & Widjaya, Y. (2026). Sentiment Analysis of Google Gemini Reviews Using K-Nearest Neighbor and Particle Swarm Optimization. IJCONSIST JOURNALS, 8(1), 37-46. https://doi.org/10.33005/ijconsist.v8i1.221
Section
Articles