Sentiment Analysis of Twitter Discussions About Lampung Robusta Coffee: A Comparative Study of Machine Learning Algorithms with SVM as The Optimal Model
DOI:
https://doi.org/10.15408/jti.v18i2.41316Keywords:
Lampung Robusta Coffee, Sentiment Analysis, Twitter, Machine LearningAbstract
Lampung Robusta coffee is an important commodity in Indonesia, particularly in terms of local economic potential and global recognition. However, public perception of this product on social media, particularly Twitter, remains underexplored. This study addresses the need for a deeper understanding of consumer sentiment towards Lampung Robusta coffee, which could inform branding and marketing strategies. To approach this issue, we used five supervised machine learning algorithms-KNN, Naive Bayes, SVM, Decision Tree, and Logistic Regression-to perform sentiment classification on a dataset of tweets containing relevant keywords. The dataset was pre-processed using standard natural language processing techniques, including tokenization, stopword removal, and TF-IDF feature extraction. The SVM achieved the best performance on the unbalanced dataset for all metrics, with high and consistent accuracy and F1 scores. Logistic regression followed closely with similarly strong and stable results. Therefore, SVM is recommended as the final model. These results suggest that machine learning approaches can effectively classify sentiment in social media discussions about regional agricultural products and that random forest may provide the most robust performance in this context
References
[1] D. P. Widiyani and J. S. S. Hartono, “Studi Eksplorasi Agroklimat Tanaman Kopi Robusta (Coffea canephora) Kabupaten Tanggamus, Lampung,” J. Agrinika J. Agroteknologi dan Agribisnis, vol. 5, no. 1, p. 20, 2021, doi: 10.30737/agrinika.v5i1.1523.
[2] F. Fitriani, B. Arifin, and H. Ismono, “Indonesian coffee exports and its relation to global market integration,” J. Socioecon. Dev., vol. 4, no. 1, p. 120, 2021, doi: 10.31328/jsed.v4i1.2115.
[3] B. P. Statistik, Statistik Kopi Indonesia 2020. 2020.
[4] B. P. Statistik, Statistik Kopi Indonesia 2021. 2021.
[5] B. P. Statistik, Statistik Kopi Indonesia 2022. 2022.
[6] F. D. la P. Nhan Cach Dang, María N. Moreno-García, “Sentiment Analysis Based on Deep Learning :,” MDPI, vol. 1, no. 1, pp. 1–29, 2020, doi: 10.3390/electronics9030483.
[7] J. Ilmiah and E. Islam, “Pemanfaatan Media Sosial Dalam Pengaruhnya Terhadap Pembentukan Persepsi dan Reputasi Wisata Halal di Indonesia,” vol. 8, no. 03, pp. 3236–3248, 2022.
[8] P. Heydarian, A. Bifet, and S. Corbet, “Understanding market sentiment analysis : A survey,” Wiley, pp. 1–23, 2024, doi: 10.1111/joes.12645.
[9] G. K. Patra, C. Kuraku, S. Konkimalla, V. Nagesh, B. Manikanth, and S. Kumar, “Journal of Artificial Intelligence & Cloud Computing A Sentiment Analysis of Customer Product Review Based on Machine Learning Techniques in E-Commerce,” J. Artif. Intell. Cloud Comput., vol. 2, no. 4, pp. 1–7, 2023, doi: 10.47363/JAICC/2023(2)389.
[10] N. Singh, “Sentiment Analysis Using Machine Learning: A Comparative Study,” Adv. Distrib. Comput. Artif. Intell. J., vol. 12, no. 1, 2023, doi: 10.14201/adcaij.26785.
[11] A. Samoggia, “Social media exploration for understanding food product attributes perception : the case of coffee and health with Twitter data,” vol. 122, no. 12, pp. 3815–3835, 2020, doi: 10.1108/BFJ-03-2019-0172.
[12] K. Sharma, L. Hota, V. A. Tikkiwal, and A. Kumar, “ScienceDirect Exploring Exploring Twitter Twitter Sentiments Sentiments for for Predicting Predicting Match Match Outcomes Outcomes in in The The Game of Cricket Game of Cricket,” Procedia Comput. Sci., vol. 235, pp. 152–162, 2024, doi: 10.1016/j.procs.2024.04.018.
[13] Z. Firmansyah and N. F. Puspitasari, “Analisis Sentimen Masyarakat Terhadap Vaksinasi Covid-19 Berdasarkan Opini Pada Twitter Menggunakan Algoritma Naive Bayes,” J. Tek. Inform., vol. 14, no. 2, pp. 171–178, 2021, [Online]. Available: https://doi.org/10.15408/jti.v14i2.24024
[14] Z. A. Sudianto Sudianto, Juan Arton Masheli, Nursatio Nugroho, Rafi Wika Ananda Rumpoko, “Jurnal teknik informatika,” J. Tek. Inform., vol. 15, no. 2, pp. 110–118, 2022, doi: 10.15408/jti.v15i2.24996.
[15] R. Watrianthos, M. Giatman, W. Simatupang, R. Syafriyeti, and N. K. Daulay, “Analisis Sentimen Pembelajaran Campuran Menggunakan Twitter Data,” J. Media Inform. Budidarma, vol. 6, no. 1, p. 166, 2022, doi: 10.30865/mib.v6i1.3383.
[16] K. L. Tan, C. P. Lee, and K. M. Lim, “A Survey of Sentiment Analysis: Approaches, Datasets, and Future Research,” Applied Sciences (Switzerland), vol. 13, no. 7. mdpi.com, Switzerland, pp. 1–21, 2023. doi: 10.3390/app13074550.
[17] R. Patel and K. Passi, “Sentiment Analysis on Twitter Data of World Cup Soccer Tournament Using Machine Learning,” Internet of Things, vol. 1, no. 2, pp. 1–22, 2020, doi: 10.3390/iot1020014.
[18] M. Lamba and M. Madhusudhan, “Sentiment analysis,” in Text Mining for Information Professionals: An Uncharted Territory, 1st ed., S. N. S. AG, Ed., University of Delhi, India: Springer, 2021, pp. 191–211. doi: 10.1007/978-3-030-85085-2_7.
[19] R. Astri, L. P. Hung, S. B. Sura, A. Kamal, and R. Yuliet, “Sentiment analysis using naive bayes for reviews of visitors to Padang City beach tourism after the COVID-19 pandemic,” E3S Web Conf., vol. 464, 2023,doi:10.1051/e3sconf/202346406002.
[20] E. M. Z. Darmawan and A. Fauzan Dianta, “Implementasi Optimasi Hyperparameter GridSearchCV Pada Sistem Prediksi Serangan Jantung Menggunakan SVM,” Teknol. J. Ilm. Sist. Inf., vol. 13, no. 1, pp. 8–15, 2023.
[21] Y. Mao, Q. Liu, and Y. Zhang, “Journal of King Saud University - Computer and Sentiment analysis methods , applications , and challenges : A systematic literature review,” J. King Saud Univ. - Comput. Inf. Sci., vol. 36, no. 4, pp. 1–16, 2024, doi: 10.1016/j.jksuci.2024.102048.
[22] M. Shaden, A. Fadel, S. Achmad, and R. Sutoyo, “ScienceDirect ScienceDirect Sentiment analysis for customer review : Case study of Traveloka Sentiment analysis for customer review : Case study of Traveloka,” Procedia Comput. Sci., vol. 216, no. 2022, pp. 682–690, 2023, doi: 10.1016/j.procs.2022.12.184.
Downloads
Published
Issue
Section
License
Copyright (c) 2025 Yodhi Yuniarthe, Admi Syarif , Imam Marzuki Sofie, Fatimah Fahurian

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