Text Mining for Sentiment Analysis of Social Media Regarding the Revision of the TNI Law Using Python by Utilizing the Lexicon Approach - Ridwan, Ridwan; Ali, Hapzi; Lubis, Hendarman (Siber Nusantara Review & Yayasan Sinergi Inovasi Bersama (SIBER), 2024)
This study aims to analyze public sentiment regarding the proposed revision of the Indonesian National Military (TNI) Law through social media, specifically Twitter. With the growing role of social media as a public sphere, it serves as a critical platform for expressing public opinions on national issues, including legal reforms. Using sentiment analysis, this research classifies Twitter posts into positive, neutral, or negative categories based on content related to the revision of the TNI Law. Data collection was carried out using the Twitter API (Tweepy), gathering 300 tweets using keywords related to the TNI Law revision. The analysis employed two methods: a lexicon-based approach using TextBlob and machine learning classification using Naive Bayes. The results reveal that the majority of the tweets express neutral sentiment (44.3%), followed by negative sentiment (28.3%) and positive sentiment (27.3%) based on TextBlob analysis. The Naive Bayes model demonstrated better sensitivity to negative sentiment, with 38.3% of tweets classified as negative. The findings suggest that public concern centers around the potential militarization of civil space, human rights violations, and threats to democracy. These concerns highlight the importance of transparent communication from the government regarding policy changes. Additionally, the research underscores the potential of natural language processing (NLP) and machine learning in monitoring public opinion in real time, which can serve as a valuable tool for policymakers in shaping responsive, data-driven legislation.