AI-Based Sentiment Analysis of Social Media to Detect Public Opinion on Government Policies

Authors

  • Galih Prakoso Rizky A Manajemen Informatika, Universitas Pembangunan Nasional Veteran Jakarta, Indonesia
  • Wildan Alrasyid Informatika, Universitas Pembangunan Nasional Veteran Jakarta, Indonesia

Keywords:

Sentiment Analysis, Artificial Intelligence (AI), Social Media, Public Opinion, Government Policy

Abstract

In the digital age, social media has become a powerful platform for public expression and discourse, offering governments a real-time window into citizen sentiment. This research explores the application of Artificial Intelligence (AI), specifically Natural Language Processing (NLP) techniques, to analyze public sentiment on social media in response to government policies. Using data primarily sourced from Twitter, the study applies a BERT-based sentiment analysis model to classify public reactions into positive, negative, and neutral categories. The model achieved high performance with an accuracy of 89.2%, precision of 88.6%, and recall of 87.9%, outperforming traditional classifiers. Sentiment was analyzed across three key policy areas: fuel subsidy removal, education curriculum reform, and COVID-19 vaccination programs. Results indicate significant variations in public sentiment based on policy type, timing, and inferred demographic factors. A real-time sentiment analysis dashboard was developed to support policymakers in monitoring public opinion trends and improving communication strategies. This study demonstrates the potential of AI-driven sentiment analysis as a tool for enhancing data-informed governance, public engagement, and policy responsiveness.

References

Alam, S., & Yao, N. (2019). The impact of preprocessing steps on the accuracy of machine learning algorithms in sentiment analysis. Computational and Mathematical Organization Theory, 25, 319–335.

Baur, A. W. (2017). Harnessing the social web to enhance insights into people’s opinions in business, government and public administration. Information Systems Frontiers, 19, 231–251.

Bossetta, M. (2018). The digital architectures of social media: Comparing political campaigning on Facebook, Twitter, Instagram, and Snapchat in the 2016 US election. Journalism & Mass Communication Quarterly, 95(2), 471–496.

Castillo, C., Mendoza, M., & Poblete, B. (2013). Predicting information credibility in time-sensitive social media. Internet Research, 23(5), 560–588.

Chen, N.-C., Drouhard, M., Kocielnik, R., Suh, J., & Aragon, C. R. (2018). Using machine learning to support qualitative coding in social science: Shifting the focus to ambiguity. ACM Transactions on Interactive Intelligent Systems (TiiS), 8(2), 1–20.

Chowdhary, K., & Chowdhary, K. R. (2020). Natural language processing. Fundamentals of Artificial Intelligence, 603–649.

Ellis, C., & Faricy, C. (2011). Social policy and public opinion: How the ideological direction of spending influences public mood. The Journal of Politics, 73(4), 1095–1110.

Galdi, P., & Tagliaferri, R. (2018). Data mining: accuracy and error measures for classification and prediction. Encyclopedia of Bioinformatics and Computational Biology, 1, 431–436.

Graham, M., & Avery, E. J. (2013). Government public relations and social media: An analysis of the perceptions and trends of social media use at the local government level. Public Relations Journal, 7(4), 1–21.

Imran, M., Castillo, C., Diaz, F., & Vieweg, S. (2015). Processing social media messages in mass emergency: A survey. ACM Computing Surveys (CSUR), 47(4), 1–38.

Kamateri, E., Panopoulou, E., Tambouris, E., Tarabanis, K., Ojo, A., Lee, D., & Price, D. (2015). A comparative analysis of tools and technologies for policy making. Policy Practice and Digital Science: Integrating Complex Systems, Social Simulation and Public Administration in Policy Research, 125–156.

Karnouskos, S. (2020). Artificial intelligence in digital media: The era of deepfakes. IEEE Transactions on Technology and Society, 1(3), 138–147.

Kucher, K., Paradis, C., & Kerren, A. (2018). The state of the art in sentiment visualization. Computer Graphics Forum, 37(1), 71–96.

Liu, S. M., & Chen, J.-H. (2015). A multi-label classification based approach for sentiment classification. Expert Systems with Applications, 42(3), 1083–1093.

Ochieng, J., Ecuru, J., Nakwagala, F., & Kutyabami, P. (2013). Research site monitoring for compliance with ethics regulatory standards: review of experience from Uganda. BMC Medical Ethics, 14, 1–7.

Pal, J., & Gonawela, A. (2017). Studying political communication on Twitter: the case for small data. Current Opinion in Behavioral Sciences, 18, 97–102.

Pandarachalil, R., Sendhilkumar, S., & Mahalakshmi, G. S. (2015). Twitter sentiment analysis for large-scale data: an unsupervised approach. Cognitive Computation, 7(2), 254–262.

Papacharissi, Z. (2015). Affective publics: Sentiment, technology, and politics. Oxford University Press.

Peixoto, T., & Fox, J. (2016). When does ICT-enabled citizen voice lead to government responsiveness?

Sapountzi, A., & Psannis, K. E. (2020). Big data preprocessing: an application on online social networks. Principles of Data Science, 49–78.

Saul, J. E., Willis, C. D., Bitz, J., & Best, A. (2013). A time-responsive tool for informing policy making: rapid realist review. Implementation Science, 8, 1–15.

Sciences, N. A. of, Medicine, Engineering, D. on, Sciences, P., Science, C., Board, T., Alert, C. on the F. of E., Systems, W., & Directions, R. (2018). Emergency alert and warning systems: Current knowledge and future research directions.

Steinkamp, J. M., Pomeranz, T., Adleberg, J., Kahn Jr, C. E., & Cook, T. S. (2020). Evaluation of automated public de-identification tools on a corpus of radiology reports. Radiology: Artificial Intelligence, 2(6), e190137.

Stimson, J. (2018). Public opinion in America: Moods, cycles, and swings. Routledge.

Tang, D., Qin, B., & Liu, T. (2015). Deep learning for sentiment analysis: successful approaches and future challenges. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 5(6), 292–303.

Torfi, A., Shirvani, R. A., Keneshloo, Y., Tavaf, N., & Fox, E. A. (2020). Natural language processing advancements by deep learning: A survey. ArXiv Preprint ArXiv:2003.01200.

Valle-Cruz, D., Criado, J. I., Sandoval-Almazán, R., & Ruvalcaba-Gomez, E. A. (2020). Assessing the public policy-cycle framework in the age of artificial intelligence: From agenda-setting to policy evaluation. Government Information Quarterly, 37(4), 101509.

Yacouby, R., & Axman, D. (2020). Probabilistic extension of precision, recall, and f1 score for more thorough evaluation of classification models. Proceedings of the First Workshop on Evaluation and Comparison of NLP Systems, 79–91.

Yadav, A., & Vishwakarma, D. K. (2020). Sentiment analysis using deep learning architectures: a review. Artificial Intelligence Review, 53(6), 4335–4385.

Downloads

Published

2025-06-30

How to Cite

A, G. P. R. ., & Alrasyid, W. . (2025). AI-Based Sentiment Analysis of Social Media to Detect Public Opinion on Government Policies. Journal Basic Science and Technology, 14(2), 61-69. Retrieved from https://iocscience.org/ejournal/index.php/JBST/article/view/6481

Most read articles by the same author(s)