Sentiment Analysis of Cigarette Use Based on Opinions from X Using Naive Bayes and SVM
Main Article Content
Abstract
Article Summary
The research employs Naive Bayes and Support Vector Machine (SVM) classification techniques to analyze attitudes toward cigarette consumption based on Twitter user opinions. Twitter, being one of the most popular social media platforms, serves as an excellent source for gauging public sentiment on various issues, including cigarette smoking, referred to here as "X." The diverse array of opinions poses a challenge for accurate sentiment classification. This study evaluates the effectiveness of the Naive Bayes and SVM algorithms in categorizing sentiment as positive, negative, or neutral. Data is collected through web scraping, and preprocessing steps such as text cleaning, tokenization, and stemming are implemented. The performance of the classification is assessed using metrics like accuracy, precision, recall, and F1-score. The results indicate that SVM outperforms Naive Bayes in sentiment analysis related to cigarette use. These findings provide new insights into public opinion and aim to assist policymakers in developing effective tobacco control strategies.
Keywords
Article Keywords
Downloads
Article Details

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 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 License (CC-BY 4.0) that allows others to share the work with an acknowledgement 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 acknowledgement 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.
Husen, R. A., Astuti, R., Marlia, L., Rahmaddeni, R., & Efrizoni, L. (2023). Analisis Sentimen Opini Publik pada Twitter Terhadap Bank BSI Menggunakan Algoritma Machine Learning: Sentiment Analysis of Public Opinion on Twitter Toward BSI Bank Using Machine Learning Algorithms. MALCOM: Indonesian Journal of Machine Learning and Computer Science, 3(2), 211-218. DOI: https://doi.org/10.57152/malcom.v3i2.901.
Iskandar, J. W., & Nataliani, Y. (2021). Perbandingan Naïve Bayes, SVM, dan k-NN untuk Analisis Sentimen Gadget Berbasis Aspek. Jurnal RESTI (Rekayasa Sistem dan Teknologi Informasi), 5(6), 1120-1126.
Millennianita, F., Athiyah, U., & Muhammad, A. W. (2024). Comparison of Naïve Bayes Classifier and Support Vector Machine Methods for Sentiment Classification of Responses to Bullying Cases on Twitter. Journal of Mechatronics and Artificial Intelligence, 1(1), 11-26.
Normawati, D., & Prayogi, S. A. (2021). Implementation of Naive Bayes Classifier and Confusion Matrix in Text-Based Sentiment Analysis on Twitter. J-SAKTI (Jurnal Sains Komput. Dan Inform., 5(2), 697-711.
Oktavia, D., Ramadahan, Y. R., & Minarto, M. (2023). Analisis Sentimen Terhadap Penerapan Sistem E-Tilang Pada Media Sosial Twitter Menggunakan Algoritma Support Vector Machine (SVM). KLIK: Kajian Ilmiah Informatika dan Komputer, 4(1), 407-417.
Petiwi, M. I., Triayudi, A., & Sholihati, I. D. (2022). Analisis Sentimen Gofood Berdasarkan Twitter Menggunakan Metode Naïve Bayes dan Support Vector Machine. Jurnal Media Informatika Budidarma, 6(1), 542-550. DOI: http://dx.doi.org/10.30865/mib.v6i1.3530.
Putri, D. D., Nama, G. F., & Sulistiono, W. E. (2022). Analisis Sentimen Kinerja Dewan Perwakilan Rakyat (DPR) Pada Twitter Menggunakan Metode Naive Bayes Classifier. Jurnal Informatika dan Teknik Elektro Terapan, 10(1). DOI: https://doi.org/10.30865/klik.v4i1.1040.
Rahat, A. M., Kahir, A., & Masum, A. K. M. (2019, November). Comparison of Naive Bayes and SVM Algorithm based on sentiment analysis using review dataset. In 2019 8th International Conference System Modeling and Advancement in Research Trends (SMART) (pp. 266-270). IEEE. DOI: 10.1109/SMART46866.2019.9117512.
Rahayu, A. S., Fauzi, A., & Rahmat, R. (2022). Komparasi Algoritma Naïve Bayes Dan Support Vector Machine (SVM) Pada Analisis Sentimen Spotify. Jurnal Sistem Komputer dan Informatika (JSON), 4(2), 349-354. DOI: http://dx.doi.org/10.30865/json.v4i2.5398.
Rennie, J. D., Shih, L., Teevan, J., & Karger, D. R. (2003). Tackling the poor assumptions of naive bayes text classifiers. In Proceedings of the 20th international conference on machine learning (ICML-03) (pp. 616-623).
Tineges, R., Triayudi, A., & Sholihati, I. D. (2020). Analisis sentimen terhadap layanan indihome berdasarkan twitter dengan metode klasifikasi support vector machine (SVM). Jurnal Media Informatika Budidarma, 4(3), 650-658. DOI: http://dx.doi.org/10.30865/mib.v4i3.2181.