Answers are grounded in this paper and cite their sources.
The growth of e-commerce in Indonesia has led to an increase in user reviews, which serve as a valuable source of information to gauge consumer perceptions. Consumer reviews on Tokopedia are crucial indicators for assessing the quality of electronic products and seller credibility. However, the massive volume of text makes manual analysis difficult. Therefore, this study aims to analyze the sentiment of user comments regarding electronic products on Tokopedia using a PHP-based Naïve Bayes algorithm. Data collection was conducted using web scraping with Python, gathering 1,039 reviews. The data were processed through preprocessing, lexicon-based labeling, and Term Frequency-Inverse Document Frequency (TF-IDF) feature extraction. The model was tested using an 80:20 data split. Test results on 208 data points show public perception is dominated by positive sentiment at 51% (106 reviews), followed by neutral at 38.9% (81 reviews), and negative at 10.1% (21 reviews). The performance evaluation of the Naïve Bayes model recorded an accuracy of 68.27%, precision of 64.30%, recall of 60.30%, and F1-score of 62.24%. In conclusion, implementing the Naïve Bayes algorithm with TF-IDF is effective and stable in classifying sentiment polarity.
No takes yet. Share an insight, caveat, or question.
Fahmi Arief (2026) studied this question.
Synapse has enriched 10 related papers. Consider them for comparative context: