Sentiment Classification of Health Education YouTube Comments Using IndoBERT Embeddings with Logistic Regression and Naïve Bayes - Andre Septa Wijaya; Amiq Fahmi; Yuventius Tyas Catur Pramudi (Politeknik Negeri Batam, 2026)
Class imbalance is a common issue in sentiment classification of social media data, particularly in mental health–related discussions where certain sentiment classes are underrepresented. This study focuses on sentiment classification of mental health–related YouTube comments by utilizing IndoBERT as a pre-trained language model to generate contextual text embeddings. Sentiment classification is subsequently performed using conventional machine learning algorithms, namely Logistic Regression and Naïve Bayes. The research framework includes data collection through the YouTube Data API, text preprocessing, semi-manual sentiment labeling into positive, neutral, and negative classes, and dataset partitioning using an 80:20 train–test split. To address class imbalance, the Synthetic Minority Over-sampling Technique (SMOTE) is applied exclusively to the training data to prevent data leakage. Feature representation is obtained from IndoBERT embeddings with a dimensionality of 768. Model performance is evaluated using accuracy, precision, recall, and F1-score. Experimental results show that Logistic Regression outperforms Naïve Bayes, achieving an accuracy of 78%, compared to 56% for Naïve Bayes. This indicates that Logistic Regression is more effective in handling dense contextual embeddings generated by transformer-based models. Overall, the findings demonstrate that combining contextual embeddings with data balancing techniques can improve sentiment classification performance in mental health–related social media analysis, particularly in low-resource language settings.