Sentiment Analysis on Indonesian Military Law Debate Using Machine Learning and IndoBERT
Ryan Winata, Antony Willson, Winsen Tjen, Evaristus Didik Madyatmadja · 2025
In the digital era, social media platforms have become influential channels for expressing public opinion on national governance issues. One such controversy in Indonesia is the proposed amendment to the National Armed Forces Law (RUU TNI), which has reignited concerns over the potential revival of the military dual-function (Dwifungsi ABRI) role. This study investigates public sentiment surrounding the RUU TNI by analyzing data collected from Twitter. Tweets containing relevant hashtags were obtained through web scraping and preprocessed using Natural Language Processing (NLP) techniques. The sentiment classification was conducted using three machine learning algorithms Naïve Bayes, Support Vector Machine (SVM), and Random Forest and further enhanced by an ensemble approach incorporating IndoBERT, a transformer based model trained on Indonesian language corpora. Among the evaluated models, SVM demonstrated the highest classification accuracy, marginally outperforming Random Forest and Naïve Bayes. The sentiment distribution revealed a predominant negative response from the public, with sarcasm identified as a frequent linguistic feature, as indicated by the ironic usage of typically positive terms such as "bagus" and "semangat." These findings underscore the importance of contextual language understanding in sentiment analysis and the limitations of keyword-based models in detecting nuanced expressions like sarcasm. The study contributes to the field of computational social science by offering insights into political discourse analysis using machine learning and language models tailored for low-resource languages. Future research should focus on enhancing sarcasm detection capabilities and leveraging deep learning architectures to improve sentiment interpretation in complex socio-political contexts.