Optimizing BERT Models with Fine-Tuning for Indonesian Twitter Sentiment Analysis
Lasmedi AfuanAssociate Professor, Department of Informatics, Universitas Jenderal Soedirman lasmedi.afuan@unsoed.ac.id0000-0003-4493-4684
Nurul HidayatAssociate Professor, Department of Informatics, Universitas Jenderal Soedirman nurul@unsoed.ac.id0000-0003-1959-4884
Hamdani Hamdani Professor, Department of Informatics, Universitas Mulawarman hamdani@unmul.ac.id0000-0002-4255-7662
Heru IsmantoAssociate Professor, Department of Informatics, Universitas Musamus heru@unmus.ac.id0000-0002-0379-4008
Brian Cahya PurnamaUndergraduate Student, Department of Informatics, Universitas Jenderal Soedirman brian.purnama@mhs.unsoed.ac.id0009-0003-2937-9720
Dzakwan Irfan RamdhaniUndergraduate Student, Department of Informatics, Universitas Jenderal Soedirman dzakwan.ramdhani@mhs.unsoed.ac.id0009-0003-6068-0490
Keywords: BERT, Fine-tuning, Sentiment Analysis, Social Media, Text Mining, Indonesian Twitter
Abstract
Twitter has emerged as a critical platform for capturing public sentiment, offering a valuable source for sentiment analysis. This study presents a comparative evaluation of two BERT (Bidirectional Encoder Representations from Transformers) models—baseline and fine-tuned—targeted at analyzing Indonesian-language tweets. Employing the CRISP-DM framework, the methodology encompasses automated data crawling, comprehensive text pre-processing (including case folding, cleaning, tokenisation, normalisation, and data augmentation), and model development using the IndoBERT-base-p1 architecture. The experimental results reveal that the fine-tuned BERT model achieves significantly improved performance over the non-optimized model, with accuracy, precision, recall, and F1-score values reaching 91%, 0.91, 0.90, and 0.91, respectively. These findings indicate the fine-tuned model's superior ability to capture linguistic subtleties and contextual sentiment features within informal social media text. Furthermore, the model is deployed in a web-based application for real-time sentiment classification, demonstrating its practical applicability. This study underscores the effectiveness of Fine-tuning in enhancing BERT-based sentiment analysis for low-resource languages. It highlights its potential for informing decision-making in digital communication, marketing, and policy research contexts.