Skip to content
Applications for the 2026/2027 academic year are now open. Visit the UENR admissions portal for details.
Back to Project Works
Undergraduate

TWITTER SENTIMENT ANALYSIS OF GHANAIANS AHEAD OF THE 2024 GENERAL ELECTIONS

WIAFE KEVIN, NAWAAK SOLOMON NAWAKZOR, PADMORE OFORI, EMMANUEL BOAHEN2023/2024

Project Abstract

This project explores the sentiment of Ghanaians on Twitter in the context of the upcoming 2024 general elections. Utilizing advanced sentiment analysis techniques, including natural language processing (NLP) and machine learning models such as Logistic Regression, Random Forest, Naïve Bayes and Support Vector Machines, this work analyzed tweets related to key political issues and candidates to gauge public opinion and its potential impact on voter behavior and election outcomes. The study employed the Tweepy library to collect real-time data from Twitter, facilitating an in-depth understanding of prevailing sentiments among voters. Model evaluation metrics, including accuracy, precision, and recall, revealed that Support Vector Machine model achieved an overall highest accuracy rate of 80%, followed by Random Forest with an accuracy rate of 79.8%, Logistic Regression achieved 78% and lastly, Naïve Bayes model achieved 74%, indicating a robust performance in sentiment classification. Findings indicated a significant correlation between social media discourse and electoral outcomes, highlighting the importance of digital platforms in shaping public perception. This work contributes to the growing body of literature on social media's role in political communication and offers valuable insights for stakeholders in the Ghanaian electoral landscape.

Main Objective

To analyze and understand the sentiments of Ghanaians ahead of the 2024 general elections using sentiment analysis techniques.