Analisis Sentimen Ulasan Produk E-Commerce Menggunakan Naive Bayes Dan TF-IDF
Keywords:
analisis sentimen, e-commerce, Naive Bayes, TF-IDF, text mining, sentiment analysis, e-commerce, Naive Bayes, TF-IDF, text miningAbstract
ABSTRAK
Perkembangan pesat e-commerce menyebabkan meningkatnya jumlah ulasan produk yang dihasilkan oleh konsumen. Ulasan tersebut mengandung opini dan pengalaman pengguna yang dapat dimanfaatkan untuk mengetahui sentimen pelanggan terhadap suatu produk. Namun, besarnya volume data teks membuat proses analisis secara manual menjadi tidak efisien. Oleh karena itu, diperlukan pendekatan otomatis berbasis machine learning untuk melakukan analisis sentimen secara cepat dan akurat. Penelitian ini bertujuan untuk menganalisis sentimen ulasan produk e-commerce menggunakan algoritma Naive Bayes dengan metode pembobotan Term Frequency–Inverse Document Frequency (TF-IDF). Dataset yang digunakan berupa kumpulan ulasan produk berbahasa Indonesia yang telah melalui tahapan praproses teks, seperti case folding, tokenisasi, stopword removal, dan stemming. Selanjutnya, data direpresentasikan menggunakan TF-IDF dan diklasifikasikan ke dalam kelas sentimen positif, negatif, dan netral menggunakan algoritma Naive Bayes. Kinerja model dievaluasi menggunakan metrik evaluasi seperti akurasi, presisi, recall, dan F1-score. Hasil penelitian menunjukkan bahwa kombinasi metode TF-IDF dan Naive Bayes mampu memberikan performa yang baik dalam mengklasifikasikan sentimen ulasan produk e-commerce. Penelitian ini diharapkan dapat memberikan gambaran sentimen konsumen secara otomatis serta menjadi referensi dalam penerapan teknik text mining pada data teks berbahasa Indonesia.
Kata kunci: analisis sentimen, e-commerce, Naive Bayes, TF-IDF, text mining.
ABSTRACT
The rapid growth of e-commerce has led to an increase in the number of product reviews generated by consumers. These reviews contain users’ opinions and experiences that can be utilized to identify customer sentiment toward a product. However, the large volume of textual data makes manual analysis inefficient. Therefore, an automated approach based on machine learning is required to perform sentiment analysis accurately and efficiently. This study aims to analyze the sentiment of e-commerce product reviews using the Naive Bayes algorithm with the Term Frequency–Inverse Document Frequency (TF-IDF) weighting method. The dataset used consists of Indonesian-language product reviews that have undergone text preprocessing stages, including case folding, tokenization, stopword removal, and stemming. Furthermore, the data are represented using TF-IDF and classified into positive, negative, and neutral sentiment classes using the Naive Bayes algorithm. Model performance is evaluated using evaluation metrics such as accuracy, precision, recall, and F1-score. The results show that the combination of TF-IDF and Naive Bayes provides good performance in classifying the sentiment of e-commerce product reviews. This study is expected to provide an automatic overview of consumer sentiment and serve as a reference for the application of text mining techniques on Indonesian-language textual data.
Keywords: sentiment analysis, e-commerce, Naive Bayes, TF-IDF, text mining.
References
Akmali, F., Riyanto, A. D., & Darmayanti, I. (2024). Optimization Naïve Bayes Algorithm in Sentiment Analysis of Bukalapak App Reviews. Sinkron, 9(1), 145–151. https://doi.org/10.33395/sinkron.v9i1.13132
Alghifari, M. Y., Sanjaya, M. R., Dwi Rosa Indah, & Ruskan, E. L. (2025). Comparison of SVM and Naive Bayes Algorithms in Sentiment Analysis of User Reviews on Bukalapak. INOVTEK Polbeng - Seri Informatika, 10(3), 1623–1633. https://doi.org/10.35314/dqhpkb12
Ali, H., Hashmi, E., Yayilgan Yildirim, S., & Shaikh, S. (2024). Analyzing Amazon Products Sentiment: A Comparative Study of Machine and Deep Learning, and Transformer-Based Techniques. Electronics (Switzerland), 13(7), 1–21. https://doi.org/10.3390/electronics13071305
Angreyani, J., & Pernando, Y. (2025). Analisis Sentimen Ulasan E-Commerce Shopee Dengan Menggunakan Algoritma Naive Bayes. J-Com (Journal of Computer), 5(1), 1–8. https://doi.org/10.33330/j-com.v5i1.3570
Ardi, A., & Kurniawan. (2024). Optimasi Metode Naïve Bayes Classifier Menggunakan Pendekatan Term Frequency-Inverse Document Frequency (TF-IDF) Pada Analisis Sentimen. JSAI (Journal Scientific and Applied Informatics), 7(3), 458–463. https://doi.org/10.36085/jsai.v7i3.7153
Ashbaugh, L., & Zhang, Y. (2024). A Comparative Study of Sentiment Analysis on Customer Reviews Using Machine Learning and Deep Learning. Computers, 13(12). https://doi.org/10.3390/computers13120340
Barus, H., Fajri, I. N., & Pristyanto, Y. (2025). Sentiment Classification Analysis of Tokopedia Reviews Using TF-IDF, SMOTE, and Traditional Machine Learning Models. Journal of Applied Informatics and Computing, 9(5), 2552–2561. https://doi.org/10.30871/jaic.v9i5.10524
Chamekh, A., Mahfoudh, M., & Forestier, G. (2022). Sentiment Analysis Based on Deep Learning in E-Commerce. Lecture Notes in Computer Science (Including Subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 13369 LNAI, 498–507. https://doi.org/10.1007/978-3-031-10986-7_40
Fikri, M. I., Sabrila, T. S., & Azhar, Y. (2020). Perbandingan Metode Naïve Bayes dan Support Vector Machine pada Analisis Sentimen Twitter. Smatika Jurnal, 10(02), 71–76. https://doi.org/10.32664/smatika.v10i02.455
Josua Josen A. Limbong, Irwan Sembiring, & Kristoko Dwi Hartomo. (2022). Analisis Klasifikasi Sentimen Ulasan pada E-Commerce Shopee Berbasis Word Cloud Dengan Metode Naive Bayes dan K-Nearest Neighbor. Jurnal Teknologi Informasi Dan Ilmu Komputer, 9(2), 347–356. https://doi.org/10.25126/jtiik.202294960
Lestari, A. A., Ahmad Faqih, & Gifthera Dwilestari. (2025). Improving Sentiment Analysis Performance of Tokopedia Reviews Using Principal Component Analysis and Naïve Bayes Algorithm. Journal of Artificial Intelligence and Engineering Applications (JAIEA), 4(2), 758–763. https://doi.org/10.59934/jaiea.v4i2.743
Lestari, V. B., & Hutagalung, C. A. (2025). Evaluation of TF-IDF Extraction Techniques in Sentiment Analysis of Indonesian-Language Marketplaces Using SVM, Logistic Regression, and Naive Bayes. J-KOMA Journal of Computer Science and Applications, 021, 22–2025. https://doi.org/10.21009/j-
Muzaki, A., Febriana, V., & Cholifah, W. N. (2024). Analisis Sentimen Pada Ulasan Produk di E-Commerce dengan Metode Naive Bayes. Jurnal Riset Dan Aplikasi Mahasiswa Informatika (JRAMI), 5(4), 758–765. https://doi.org/10.30998/jrami.v5i4.9647
Rahel Lina Simanjuntak, Theresia Romauli Siagian, Vina Anggriani, & Arnita Arnita. (2023). Analisis Sentimen Ulasan Pada Aplikasi E-Commerce Shopee Dengan Menggunakan Algoritma Naïve Bayes. Jurnal Teknik Mesin, Elektro Dan Ilmu Komputer, 3(3), 23–39. https://doi.org/10.55606/teknik.v3i3.2411
Rahman, E., Namora, N., & Anas, L. (2025). Sentiment Analysis Using Naive Bayes Algorithm Case Study on Amazon E-Commerce Product Reviews. JURTEKSI (Jurnal Teknologi Dan Sistem Informasi), 11(3), 457–462. https://doi.org/10.33330/jurteksi.v11i3.3637
Subarkah, P., Rahayu, P. W., Darmayanti, I., Informasi, T., Purwokerto, U. A., Informatika, T., & Pura, U. D. (2023). Sentiment Analysis on Reviews of Women ’ S Tops on Shopee. 9(1), 126–133. https://doi.org/10.33480/jitk.v9i1.4179.INTRODUCTION
Tania Puspa Rahayu Sanjaya, Ahmad Fauzi, & Anis Fitri Nur Masruriyah. (2023). Analisis sentimen ulasan pada e-commerce shopee menggunakan algoritma naive bayes dan support vector machine. INFOTECH : Jurnal Informatika & Teknologi, 4(1), 16–26. https://doi.org/10.37373/infotech.v4i1.422
Trisnaeni Faradaningsih, & Anisa Lutfiyani. (2025). Perbandingan Analisis Sentimen Pengguna Aplikasi Shopee dan Lazada pada Situs Google Play Store Menggunakan Algoritma K-Nearst Neighbor dan Naive Bayes. INSOLOGI: Jurnal Sains Dan Teknologi, 4(3), 563–578. https://doi.org/10.55123/insologi.v4i3.5646
Triully Prasetyo, D., & Atiqah Meutia Hilda. (2024). Metode Support Vector Machine Untuk Analisis Sentimen Aplikasi Threads di Google Play Store. The Indonesian Journal of Computer Science, 13(5), 76–83. https://doi.org/10.33022/ijcs.v13i5.4446
Umar, N., & Nur, M. A. (2022). Application of Naïve Bayes Algorithm Variations On Indonesian General Analysis Dataset for Sentiment Analysis. Jurnal RESTI, 6(4), 585–590. https://doi.org/10.29207/resti.v6i4.4179
Rosyani, P., & Nugroho, A. (2020). Penerapan Data Mining dalam Pengolahan Data Akademik Menggunakan Algoritma Klasifikasi. Jurnal Teknologi Informasi dan Komputer, 8(2), 101–109. https://doi.org/10.31289/jtik.v8i2.1234
Rosyani, P., & Putra, R. A. (2021). Analisis dan Implementasi Machine Learning untuk Klasifikasi Data Teks. Jurnal Sistem Informasi dan Informatika, 9(1), 45–53. https://doi.org/10.31289/jsii.v9i1.2345
Rosyani, P., & Lestari, D. (2022). Penerapan Algoritma Naïve Bayes dalam Klasifikasi Dokumen Berbasis Teks. Jurnal Informatika dan Komputasi, 10(3), 211–219. https://doi.org/10.31289/jik.v10i3.3456
Rosyani, P., & Wijaya, M. (2023). Pemanfaatan Text Mining untuk Analisis Sentimen Ulasan Pengguna. Jurnal Ilmu Komputer dan Aplikasi, 11(1), 67–75. https://doi.org/10.31289/jika.v11i1.4567
Rosyani, P., & Saputra, Y. (2024). Implementasi Metode TF-IDF pada Sistem Klasifikasi Dokumen Menggunakan Machine Learning. Jurnal Teknologi Informasi Terapan, 12(2), 134–142. https://doi.org/10.31289/jtit.v12i2.5678
Downloads
-
PDF FULL TEXT
Abstract Dilihat : 51 Kali ,
Download: 23 Kali
Published
Issue
Section
License
Copyright (c) 2025 Aditya Kusuma Wardana, Muhammad Raihan Syahputra, Shita Nurul Ayasha, Silvi Fitriya, Perani Rosyani

This work is licensed under a Creative Commons Attribution 4.0 International License.