Sentiment Analysis on current government using Tweets

Most of our project is research based and focuses more on the backend of the system we are developing. Our aim is to use sentiment analysis techniques to evaluate how people in Pakistan feel about the current government. In this application we would collect the dataset from twitter. We are using twi

2025-06-28 16:34:58 - Adil Khan

Project Title

Sentiment Analysis on current government using Tweets

Project Area of Specialization Artificial IntelligenceProject Summary

Most of our project is research based and focuses more on the backend of the system we are developing. Our aim is to use sentiment analysis techniques to evaluate how people in Pakistan feel about the current government. In this application we would collect the dataset from twitter. We are using twitter instead of any other social networking site because in twitter, tweet length is limited. In twitter we will have a medium from where we will get to know different opinions, thoughts and ideas of different people on the same platform. Moreover, in twitter the use of hashtag and trending topics will also help in retrieving data.

The goal of our project is to provide an application that will calculate happiness and sadness sentiments using social networking site i.e. Twitter, that will visualize satisfaction and dissatisfaction of Pakistani people on the current government. Proposed idea is to gather the dataset from Twitter and apply sentiment analysis techniques to find the satisfaction of people on the current government of Pakistan. We will collect tweets from January 2018 to show the sentiments of people before July 2018 election up till June 2021, right before our project evaluation to cover maximum tenure of the current government. A major constraint to our project is that we will not be covering tweets tweeted in Urdu or any other language except English or Roman Urdu. Positive and negative sentiment will be calculated based on tweets of Pakistani people to find patterns in sentiments, which we will use to plot and visualize the positive and negative index of people.

Project Objectives

We will use a scraper to gather dataset. A big challenge for us is to manipulate this scraper to fetch tweets in the geographical location of Pakistan as back as 2018. The data we are expected to collect will be quite large and it will be constant work as we will keep updating our data as time passes and will try to maximize the accuracy of our model. We will scrape tweets using keywords PTI, PMLN and PPP. Retrieving data in this way will be quite easy. Tweets would be retrieved based on language, topic, word, and location-wise. Firstly, we will be scraping data from twitter and making our own dataset. This project will collect tweets of people from Pakistan in English, Urdu and Roman Urdu. Tweets will be collected based on language and geographical location. We will collect tweets from January 2018 to show the sentiments of people before July 2018 election up till June 2021, right before our project evaluation to cover maximum tenure of the current government.

Then data will be filtered-out, and positive and negative comments will be calculated based on the tweets. Scraping and collecting the data only solves a part of our problem. We have to make a dataset that we can use for sentiment analysis and for that we only need relevant tweets. We will discard irrelevant tweets and only include tweets that are in anyway about the current government or political bodies. It will be a lot of effort on our end to finally make a dataset of actual use to us.

We will use sentiment analysis algorithms of machine learning to classify negative and positive words, and then calculate the overall sentiment of the tweet based on our calculations. As there will be neutral tweets as well, so this category will also be kept in mind to filter out neutral tweets i.e. having no sentiment. Positive and negative categories will be used for visualization. Consequently, stats are plotted on these sentiments which will give us an idea of frequent changes in happy or unsatisfactory mood patterns based on tweeting habits of people.

The goal of our project is to provide an application that will calculate happiness and sadness sentiments using social networking site i.e. Twitter, that will visualize satisfaction and dissatisfaction of Pakistani people on the current government. 

Project Implementation Method

The main idea is to gather the dataset from Twitter and apply sentiment analysis techniques to find the satisfaction of people on the current government of Pakistan (2018). We will scrape data from twitter to make dataset. The scraper is coded in Python. We will be using Python Language and its various libraries for NLP and building Machine Learning model. We will create an API. We will show an implementation of that API in an application which we will be building using Flutter.

Benefits of the Project

Stakeholders of this product are the individuals who have some contribution in its development or use. The user of our system can be any person interested in research or any person who wants to know the performance of the current government. The general public will be a supplier as their tweets will be used for sentiment analysis and will also be indirect audience of our application if they are concerned with the government’s performance. Any political body who wants to know if they have satisfied or dissatisfied the government can use our application to get some insight on that. Different events and campaigns affect people differently. Some stay neutral and some are enraged or happy. Different emotions of different people channelled by political activities can form a pattern for a certain geographical location. For instance, a campaign in Lahore will outrage the people there and they are more likely to voice out as compared to people in Karachi, whom this campaign doesn’t affect that much. Twitter is a hub for public and political opinions. The words used by people in their tweets can immediately reflect the emotion behind. Sometimes the government expects a positive reaction to a campaign but people either remain indifferent or react negatively. Some campaigns effect people in a mass and if we were to see a visualization of patterns of sentiments in certain areas, it can tell us a lot about the satisfaction or dissatisfaction of the people with the government. These visualizations can help the government to reach out to people to and communicate with the public in an efficient way. . Before the 2018 elections, people had certain expectations from the government and elected certain parties to fulfil those expectations. After the elections, whether the elected government satisfied or let down the people, is the right question to ask. This application will walk us through 2018 till present to visualize the change in sentiments of people before election, on election and since the government came into power and whether all those sentiments changed over time. It can also tell us if certain political campaigns and policies convinced people or dissatisfied them with the government even more. Hence the benefits of our project can be simply summed up as:

Technical Details of Final Deliverable

Most of our project is research based and focuses more on the backend of the system we are developing. Our aim is to use sentiment analysis techniques to evaluate how people in Pakistan feel about the current government. We will use both Naïve Bayes and LSVM classifiers for sentiment analysis and choose the model that provides more accuracy. Our goal is to provide a Multilingual Sentiment Analysis API.

The final deliverables of our project will be:

Final Deliverable of the Project Software SystemCore Industry ITOther IndustriesCore Technology Artificial Intelligence(AI)Other TechnologiesSustainable Development Goals Decent Work and Economic Growth, Industry, Innovation and Infrastructure, Partnerships to achieve the GoalRequired Resources
Item Name Type No. of Units Per Unit Cost (in Rs) Total (in Rs)
Total in (Rs) 75900
RAM Equipment3900027000
GPU Equipment3800024000
Harddrive Equipment3630018900
Overheads Miscellaneous 310003000
Printing Miscellaneous 215003000

More Posts