A Deep Learning Model for Classifying Candidate-Related Tweets in the 2023 Nigerian Presidential Election
Keywords:
Deep Learning, Tweet Classification, Political Communication, Convolutional Neural Network, Social Media Analytics, Nigerian ElectionAbstract
The increasing use of social media for political communication has transformed electoral discourse in Nigeria, particularly during the 2023 presidential election. While existing studies have largely focused on sentiment analysis or electoral prediction, limited attention has been given to candidate-level classification of political discourse as a distinct computational task. This study develops a deep learning framework for classifying tweets associated with the three leading presidential candidates Atiku Abubakar (PDP), Bola Ahmed Tinubu (APC), and Peter Obi (LP) based on their online presence. Twitter data were collected from six campaign-related hashtags between August 1, 2022 and February 28, 2023 to capture real-time political engagement. After preprocessing procedures including text cleaning, normalization, and duplicate removal, a total of 121,958 unique tweets were retained for model development. Two models were implemented: a baseline Artificial Neural Network (ANN) using TF-IDF vectorized features, and a Convolutional Neural Network (CNN) employing distributed word embeddings trained from scratch to capture localized campaign expressions and Nigerian political slang. Both models were evaluated using accuracy, precision, recall, F1-score, and AUC. The ANN achieved an accuracy of 0.5142, indicating limited effectiveness in distinguishing candidate-related tweet patterns. In contrast, the CNN achieved an accuracy of 0.9673 with balanced precision and recall, demonstrating superior performance in learning contextual and linguistic structures within short, informal political text. These findings confirm that CNN-based architectures are well suited for structuring large-scale candidate-related political discourse on social media. While this study does not infer voter preference or predict election outcomes, it provides a robust computational approach for analyzing digital political communication in Nigeria. Future research may extend this framework using multilingual datasets, transformer-based language models, and cross-platform political discourse analysis.
References
Ajayi, O. O., & Akinrolabu, O. D. (2023). Machine perception of political manifestos in predicting performance of public office holders. JPPUMA JurnalIlmu Pemerintahan Dan Sosial Politik Universitas Medan Area, 11(2), 138–148. https://doi.org/10.31289-/jppuma.v11i2.10716.
Akande, P. A., Adeleke, O. F., Ajao, R. A., & Amusa, A. K. (2023). A Semantic Analysis of Selected Peter Obi’s Political Campaign Tweets and Readers’ Comments. International Journal of Social Sciences and Management Review, 06(06), 197–216. https://doi.org/10.3-7602/ijssmr.2023.6615
Alhaimer, R. S. (2023). Unveiling the digital persona image: the influence of social media on political candidates’ brand personality and voter behaviour in Kuwait. Humanities and Social Sciences Communications, 10(1). https://doi.org/-10.1057/s41599-023-02420-4
Attai, K., Asuquo, D., Okonny, K. E., Johnson, E. A., Bassey, A., John, A., Bardi, I., Iroanwusi, C., & Michael, O. (2024). Sentiment analysis of Twitter discourse on the 2023 Nigerian general elections. European Journal of Computer Science and Information Technology, 12(4), 18–35. https://doi.org/10.37745/ejcsit.2013/-vol12n41835
Ikefuama, A. E. (2023). Social media and political participation in Nigeria: examining the use of Twitter in election campaigning. dspace.ub.uni-siegen.de. https://doi.org/1-0.25819/ubsi/10434
López, O. a. M., López, A. M., & Crossa, J. (2022). Fundamentals of artificial neural networks and deep learning. In Springer eBooks (pp. 379–425). https://doi.org/10.-1007/978-3-030-89010-0_10
Mbunge, E., & Batani, J. (2023). Application of deep learning and machine learning models to improve healthcare in sub-Saharan Africa: Emerging opportunities, trends and implications. Telematics and Informatics Reports, 11, 100097. https:-//doi.org/10.1016/j.teler.2023.100097.
Odegbile, A., & Oyelami, O. (2024). “Nigeria’s 2023 Presidential Election Dataset”, Mendeley Data, V2. https://10.17632/-whb6rychpx.2
Olabanjo, O., Wusu, A., Afisi, O., Asokere, M., Padonu, R., Olabanjo, O., Ojo, O., Folorunso, O., Aribisala, B., & Mazzara, M. (2023). From Twitter to Aso-Rock: A sentiment analysis framework for understanding Nigeria 2023 presidential election. Heliyon, 9(5), e16085. https://-doi.org/10.1016/j.heliyon.2023.e16085
Zhang, Z., Chen, K., Wang, R., Utiyama, M., Sumita, E., Li, Z., & Zhao, H. (2023). Universal multimodal representation for language understanding. IEEE Transactions on Pattern Analysis and Machine Intelligence, 45(7), 1–18. https-://doi.org/10.1109/tpami.2023.3234170
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Researchers Journal of Science and Technology

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.



