Text Mining for Sentiment Analysis of Social Media Regarding the Revision of the TNI Law Using Python by Utilizing the Lexicon Approach

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.

Institutions

Publication Details

Journal
Siber International Journal of Education Technology (SIJET)
Published
2025-04-19
DOI
https://doi.org/10.38035/sijet.v2i2.156
Primary Topic
Vaccine Coverage and Hesitancy
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Text Mining for Sentiment Analysis of Social Media Regarding the Revision of the TNI Law Using Python by Utilizing the Lexicon Approach

Siber International Journal of Education Technology (SIJET)
Vaccine Coverage and Hesitancy
article

Text Mining for Sentiment Analysis of Social Media Regarding the Revision of the TNI Law Using Python by Utilizing the Lexicon Approach

article en

Abstract

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.

Siber International Journal of Education Technology (SIJET)Vol. 2(2)
Universitas Bhayangkara Jakarta Raya (ID), Institut Bisnis Nusantara (ID), Institut Teknologi dan Bisnis Kalbe (ID)
Peace, Justice and strong institutions
Openalex Percentile: Top 40%
Vaccine Coverage and Hesitancy
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.