Sentiment Analysis of Electronic Product Reviews on Tokopedia using the Naïve Bayes Algorithm
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.
Authors
- Fahmi Arief
Institutions
- Universitas Islam Lamongan (ID)
Publication Details
- Journal
- Journal of Artificial Intelligence and Engineering Applications (JAIEA)
- Published
- 2026-10-30
- DOI
- https://doi.org/10.59934/jaiea.v6i1.3119
- Primary Topic
- Sentiment Analysis and Opinion Mining
- Type
- article
- Field-Weighted Citation Impact
- 0.00