Sentiment analysis entails discerning whether text conveys positive, neutral, or negative sentiments to ascertain the mood of the public concerning a given entity. This method relies on natural language processing, computational linguistics, and text analysis to identify, extract, and methodically analyze affective and subjective data. The 2023 Nigerian presidential election holds immense significance for the nation, determining its leadership for the subsequent four years. Consequently, comprehending public sentiment regarding the electoral process becomes paramount. This study sought to gauge public sentiment concerning the 2023 Nigerian General Elections by analyzing tweets related to candidates and their political parties. Leveraging three machine learning (ML) techniques—SVM, RF, and XGBoost—we aimed to categorize tweets as negative, positive, or neutral. Our dataset comprised a substantial volume of tweets, meticulously pre-processed to eliminate irrelevant content and noise. Results showcased the outstanding performance of RF and XGBoost in tweets classification and sentiment identification about the electoral process with the highest accuracy (93%) and precision (96%), occurring on neutral opinions. These results findings offer crucial insights into public opinion regarding candidates, their political parties, and the electoral procedure, benefiting researchers, political analysts and decision-makers alike. It suggests that 43% of the electorate expressed neutral sentiments about the elections, while 33% expressed positive sentiments, such as optimism about the electoral process, support for specific candidates, satisfaction with the results of the election, or excitement for taking part in democracy. Meanwhile, 24% of the electorate expressed negative sentiments, such as dissatisfaction with political candidates, criticism of the electoral processes, worries about fairness, or skepticism about the outcome. This research underscores the significance of sentiment analysis in comprehending public opinion and its potential contributions to political discourse.
Keywords: 2023 Nigerian general elections, sentiment analysis, twitter discourse