Pakistan’s Political Sentiments Analysis based on Twitter Using Machine Learning

Authors

  • Arfan Ali Nagra Department of Computer Science, Lahore Garrison University, Lahore, 54000, Pakistan. https://orcid.org/0000-0002-2149-8165
  • Muahmmad Abubakar Department of Computer Science, Lahore Garrison University, Lahore, 54000, Pakistan. https://orcid.org/0000-0001-6902-6549
  • Syeda Urwa Warsi Department of Computer Science, Lahore Garrison University, Lahore, 54000, Pakistan.
  • Saba Mohsin Department of Computer Science, Lahore Garrison University, Lahore, 54000, Pakistan.
  • Hadi Abdullah Department of Computer Science, Lahore Garrison University, Lahore, 54000, Pakistan.

Keywords:

Sentiment Analysis, Supervised Machine Learning, Tweets, Naive Bayes Analyzer, Classification

Abstract

Pakistan’s Politics has always been a hot topic. Politicians wastes no time to express their sentiments and narratives through social media without knowing the whole situation. These social media posts and tweets create a situation which can lead to anarchy in the society. It is a need of hour to figure out which politician creates the more dramatic situation. It can be done through sentimental analysis of their social media account. Sentiment analysis aims to extract sentiments, opinions, and emotions from social media sites like Twitter. The conventional technique of sentiment analysis is concerned with textual data in which users post updates relating to various themes. This manuscript examines five Pakistani politicians consisting of Ex-Prime Minister Imran Khan, Vice President PML-N Marium Nawaz, Chairman PPP Bilawal Bhutto, Spoke-person PTI Shebaz Gill, and Information Minister PML-N Mariem Aurangzeb. The focus is to analyze how they have utilized Twitter to interact with their followers and, in doing so, influence the political process. Data are collected from Twitter accounts belonging to various Pakistani politicians. A comprehensive framework of pre-processing procedures for making tweets more manageable is presented. The main goal is to make sure that people get knowledge about the better direction for the society. In political sentiment analysis, each politician's tweets are classified into positive, negative, and neutral sentiments to provide a unique perspective on how hate speech is used by politicians. This is accomplished with a machine learning classifier i.e Support Vector Machine, Random Forest, Decision Tree and Logistic Regression. After comparative study of these classifiers, Random Forest achieved the highest accuracy 86% among all. Such classifier will aid organizations, political parties, analysts, and others in assessing public sentiments regarding them. As a result, the most negative tweets are used by Imran Khan.

Downloads

Published

2024-03-01

How to Cite

Arfan Ali Nagra, Muahmmad Abubakar, Syeda Urwa Warsi, Saba Mohsin, & Hadi Abdullah. (2024). Pakistan’s Political Sentiments Analysis based on Twitter Using Machine Learning. Journal of Computing & Biomedical Informatics, 6(02), 13–22. Retrieved from https://jcbi.org/index.php/Main/article/view/265