Sentiment Analysis of Google Gemini Reviews Using K-Nearest Neighbor and Particle Swarm Optimization
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
Copyright (c) 2026 Siraj Fatwa Sidqy, Yunus Widjaya

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution-ShareAlike 4.0 International License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).
.png)
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.


