Evaluasi Komparatif Kinerja Lexicon-based, Naive Bayes, dan IndoBERT dalam Analisis Sentimen Pengelolaan Sampah Plastik di Bali
MERINDA SELVI BUDIANTI, Dr. Ir. Rudy Hartanto, M.T., IPM. ; Dr. Ir Guntur Dharma Putra, S.T., M.Sc.
2026 | Tesis | S2 Teknologi Informasi
Permasalahan sampah plastik di Bali menjadi salah satu isu lingkungan yang mendapat perhatian luas dari masyarakat dan memunculkan berbagai opini di media sosial. Opini tersebut tersebar pada berbagai platform, seperti Twitter/X dan Google Maps, yang memiliki karakteristik data serta distribusi sentimen yang berbeda. Perbedaan karakteristik platform, pemilihan metode analisis sentimen, dan ketidakseimbangan distribusi kelas (imbalanced data) menjadi tantangan dalam menghasilkan model klasifikasi yang mampu merepresentasikan opini publik secara akurat. Oleh karena itu, penelitian ini bertujuan membandingkan kinerja metode Lexicon-Based, Naïve Bayes, dan IndoBERT dalam analisis sentimen terhadap pengelolaan sampah plastik di Bali pada data Twitter/X dan Google Maps, serta menganalisis pengaruh penerapan class weighting terhadap performa masing-masing model. Penelitian ini menggunakan pendekatan kuantitatif dengan metode eksperimen. Dataset terdiri atas 2.020 tweet dari Twitter/X dan 208 ulasan Google Maps mengenai pengelolaan sampah plastik di Bali. Data diproses melalui tahapan case folding, cleansing, tokenization, stopword removal, dan stemming. Pelabelan pada dataset Twitter/X dilakukan menggunakan pendekatan Lexicon-Based sebagai weak supervision,sedangkan dataset Google Maps diberi label secara manual oleh dua annotator independen dan diuji menggunakan Cohen's Kappa untuk memastikan konsistensi anotasi. Evaluasi model dilakukan menggunakan metrik accuracy, precision, recall, F1-score, dan Macro-F1 Score, dengan Macro-F1 Score sebagai metrik utama karena lebih representatif dalam mengevaluasi performa model pada kondisi imbalanced data. Hasil penelitian menunjukkan bahwa penerapan class weighting meningkatkan kemampuan model dalam mengenali kelas minoritas, terutama pada metode Naïve Bayes yang mengalami peningkatan nilai Macro-F1Score meskipun accuracy menurun. Selain itu, IndoBERT dengan class weighting menunjukkan kinerja terbaik pada dataset gabungan dengan accuracy sebesar 98,21% dan Macro-F1 Score sebesar 0,91, serta memberikan performa yang lebih konsisten dibandingkan metode lainnya dalam menangani karakteristik data dari dua platform media sosial. Temuan ini menunjukkan bahwa penerapan class weighting efektif meningkatkan kemampuan model dalam mengatasi ketidakseimbangan distribusi kelas, sedangkan IndoBERT menjadi metode yang paling unggul untuk analisis sentimen pengelolaan sampah plastik di Bali.
The problem of plastic waste in Bali has become one of the environmental issues receiving widespread public attention and sparking various opinions on social media. These opinions are spread across various platforms, such as Twitter/X and Google Maps, which have different data characteristics and sentiment distributions. Differences in platform characteristics, the choice of sentiment analysis methods, and the imbalance in class distribution (imbalanced data) pose challenges in developing a classification model capable of accurately representing public opinion. Therefore, this study aims to compare the performance of the Lexicon-Based, Naïve Bayes, and IndoBERT methods in sentiment analysis regarding plastic waste management in Bali using data from Twitter/X and Google Maps, as well as to analyze the impact of class weighting on the performance of each model. This study employs a quantitative approach using an experimental method. The dataset consists of 2,020 tweets from Twitter/X and 208 Google Maps reviews regarding plastic waste management in Bali. The data was processed through the stages of case folding, cleansing, tokenization, stopword removal, and stemming. Labeling of the Twitter/X dataset was performed using a lexicon-based approach as weak supervision, while the Google Maps dataset was manually labeled by two independent annotators and tested using Cohen’s Kappa to ensure annotation consistency. Model evaluation was conducted using the metrics accuracy, precision, recall, F1-score, and Macro-F1 Score, with the Macro-F1 Score serving as the primary metric because it is more representative in evaluating model performance under conditions of imbalanced data. The results of the study show that the application of class weighting improves the model’s ability to recognize minority classes, particularly in the Naïve Bayes method, which experienced an increase in the Macro-F1-score despite a decrease in accuracy. Additionally, IndoBERT with class weighting demonstrated the best performance on the combined dataset with an accuracy of 98.21% and a Macro-F1 Score of 0.91, and provided more consistent performance compared to other methods in handling the data characteristics from the two social media platforms. These findings indicate that the application of class weighting effectively improves the model’s ability to address class distribution imbalance, while IndoBERT emerges as the most superior method for sentiment analysis of plastic waste management in Bali.
Kata Kunci : Analisis Sentimen, Lexicon-Based, Naïve Bayes, IndoBERT, Class Weighting, Imbalanced Data, Macro-F1 Score, Pengelolaan Sampah Plastik