A Computational Sentiment Analysis of Public Opinion on Nigerian 2023 Presidential Candidates from YouTube Video Comments

Authors

  • Olayemi J. Ibidoja Department of Mathematical Sciences, Faculty of Science, Federal University Gusau, Gusau, Nigeria https://orcid.org/0000-0003-4982-5209
  • Kayode R. Fowobaje Department of Epidemiology and Medical Statistics, Faculty of Public Health, University of Ibadan, Ibadan, Nigeria
  • Lukman A. Oladimeji Department of Statistics, Ladoke Akintola University of Technology, Ogbomoso, Nigeria
  • Gbolahan O. Kayode Department of Educational Foundations, Faculty of Education, Federal University Gusau, Gusau, Nigeria
  • Afeez O. Azeez Department of Linguistics and Nigerian Languages, Olabisi Onabanjo University, Ago-Iwoye, Ogun State, Nigeria
  • Majid K.M. Ali School of Mathematical Sciences, Universiti Sains Malaysia, USM-11800, Penang, Malaysia

DOI:

https://doi.org/10.15377/2409-5761.2026.13.11

Keywords:

Sentiment analysis, Public opinion dynamics, YouTube comment mining, Nigerian presidential election 2023, Natural Language Processing (NLP)

Abstract

YouTube has become an important platform for public expression, where users post comments to communicate their views and feelings about political issues and candidates. This study examined public sentiment and prominent words associated with presidential aspirants in Nigeria's 2023 presidential election using YouTube comments. Comments available online for 16 presidential aspirants who declared their intention to contest the 2023 presidential election were collected using the Google YouTube Data API. Sentiment analysis and word-cloud analysis were performed to identify the dominant emotional patterns and frequently occurring terms in the comments. In addition, the sentiment classifier was evaluated against a gold-standard annotated dataset using accuracy, precision, recall (sensitivity), F1-score, specificity, negative predictive value, balanced accuracy, and Cohen's kappa to assess its classification performance and agreement beyond chance. The results showed that negative sentiment constituted the largest proportion of the comments, followed by positive sentiment, whereas surprise had the lowest proportion. The most frequently occurring word was “Nigeria,” while the names “Tinubu,” “Sowore,” and “Orji Kalu” were prominent in the word cloud. The classifier achieved an accuracy of 78.39%, with a positive-class precision of 62.94%, recall of 93.04%, F1-score of 75.09%, specificity of 70.49%, negative predictive value of 94.95%, balanced accuracy of 81.77%, and Cohen's kappa of 0.5722. These findings demonstrate the sentiment patterns expressed in YouTube comments surrounding the 2023 Nigerian presidential election and provide an empirical assessment of the reliability of the sentiment classification approach.

References

[1] Jim JR, Talukder MAR, Malakar P, Kabir MM, Nur K, Mridha MF. Recent advancements and challenges of NLP-based sentiment analysis: a state-of-the-art review. Nat Lang Process J. 2024; 6: 100059. https://doi.org/10.1016/j.nlp.2024.100059

[2] Liu Y, Wang J, Long L, Li X, Ma R, Wu Y, et al. A multi-level sentiment analysis framework for financial texts: firm-specific industry-specific multi-level sentiment analysis downstream tasks. arXiv:2504.02429v1 [cs.CE] 03 Apr 2025 (preprint).

[3] Xu Z, Ye Z, Ye H, Zhu L, Lu K, Quan H, et al. Public opinion evolution law and sentiment analysis of campus online public opinion events. J Adv Comput Intell Intell Inform. 2024; 28: 990-1004. https://doi.org/10.20965/jaciii.2024.p0990

[4] Agathangelou P, Katakis I. Balancing between holistic and cumulative sentiment classification. Online Soc Netw Media. 2022; 29: 100199. https://doi.org/10.1016/j.osnem.2022.100199

[5] Ilyas B, Sharifi A. A systematic review of social media-based sentiment analysis in disaster risk management. Int J Disaster Risk Reduct. 2025; 123: 105487. https://doi.org/10.1016/j.ijdrr.2025.105487

[6] Sharma NA, Ali ABMS, Kabir MA. A review of sentiment analysis: tasks, applications, and deep learning techniques. Int J Data Sci Anal. 2025; 19: 351-88. https://doi.org/10.1007/s41060-024-00594-x

[7] Mao Y, Liu Q, Zhang Y. Sentiment analysis methods, applications, and challenges: a systematic literature review. J King Saud Univ Comput Inf Sci. 2024; 36: 102048. https://doi.org/10.1016/j.jksuci.2024.102048

[8] Tripathy G, Sharaff A. Traversing the landscape of aspect-based sentiment analysis: delving deeper into techniques, trends, and future directions. Comput Sci Rev. 2026; 60: 100885. https://doi.org/10.1016/j.cosrev.2025.100885

[9] Mao Y, Liu Q, Zhang Y. Sentiment analysis methods, applications, and challenges: a systematic literature review. J King Saud Univ Comput Inf Sci. 2024; 36: 102048. https://doi.org/10.1016/j.jksuci.2024.102048

[10] Tan KL, Lee CP, Lim KM. A survey of sentiment analysis: approaches, datasets, and future research. Appl Sci (Basel). 2023; 13: 4550. https://doi.org/10.3390/app13074550

[11] Liu W, Wu L, Zhao H. Improving sentiment analysis in tourism through LLM-enhanced irony detection. Tour Manag. 2026; 112: 105272. https://doi.org/10.1016/j.tourman.2025.105272

[12] Lakshmi L, Ali ABM, Devi KDS, Rafiq M, Shernazarov I, Othman NA, et al. Opinion mining in e-commerce: evaluating machine learning approaches for sentiment analysis. Results Control Optim. 2025; 19: 100575. https://doi.org/10.1016/j.rico.2025.100575

[13] He M, Ma C, Wang R. A data-driven approach for university public opinion analysis and its applications. Appl Sci (Basel). 2022; 12: 9136. https://doi.org/10.3390/app12189136

[14] Talaat AS. Sentiment analysis classification system using hybrid BERT models. J Big Data. 2023; 10: 81. https://doi.org/10.1186/s40537-023-00781-w

[15] Xing Y, Wang X, Qiu C, Li Y, He W. Research on opinion polarization by big data analytics capabilities in online social networks. Technol Soc. 2022; 68: 101902. https://doi.org/10.1016/j.techsoc.2022.101902

[16] Maruthupandi J, Sivakumar S, Kumar VS, Srikaanth PB. Sem-AI: a unique framework for sentiment analysis and opinion mining using social network data. SN Comput Sci. 2025; 6: 79. https://doi.org/10.1007/s42979-024-03628-0

[17] Cruz RMO, de Sousa WV, Cavalcanti GDC. Selecting and combining complementary feature representations and classifiers for hate speech detection. Online Soc Netw Media. 2022; 28: 100194. https://doi.org/10.1016/j.osnem.2021.100194

[18] Ferreyra NED, Hecking T, Aïmeur E, Heisel M, Hoppe HU. Community detection for access-control decisions: analysing the role of homophily and information diffusion in online social networks. Online Soc Netw Media. 2021; 29: 100203. https://doi.org/10.1016/j.osnem.2022.100203

[19] Aribowo AS, Basiron H, Yusof NFA, Khomsah S. Cross-domain sentiment analysis model on Indonesian YouTube comment. Int J Adv Intell Inform. 2021; 7: 12-25. https://doi.org/10.26555/ijain.v7i1.554

[20] Ojo OE, Gelbukh A, Calvo H, Adebanji OO. Performance study of N-grams in the analysis of sentiments. J Niger Soc Phys Sci. 2021; 3: 477-83. https://doi.org/10.46481/jnsps.2021.201

[21] Kim D, Chung CJ, Eom K. Measuring online public opinion for decision making: application of deep learning on political context. Sustainability (Basel). 2022; 14: 4113. https://doi.org/10.3390/su14074113

[22] Fagbola TM, Thakur SC. Lexicon-based bot-aware public emotion mining and sentiment analysis of the Nigerian 2019 presidential election on Twitter. Int J Adv Comput Sci Appl. 2019; 10(10): 329-36. https://doi.org/10.1016/S1350-4789(19)30412

[23] Onyenwe I, Nwagbo S, Mbeledogu N, Onyedinma E. The impact of political party/candidate on the election results from a sentiment analysis perspective using #AnambraDecides2017 tweets. Soc Netw Anal Min. 2020; 10: article number 55. https://doi.org/10.1007/s13278-020-00667-2

[24] Alhujaili RF, Yafooz WMS. Sentiment analysis for YouTube videos with user comments: review. In: Proceedings of the International Conference on Artificial Intelligence and Smart Systems (ICAIS 2021). Institute of Electrical and Electronics Engineers Inc.; 2021. p. 814–20. https://doi.org/10.1109/ICAIS50930.2021.9396049

[25] Singh R, Tiwari A. YouTube comments sentiment analysis. Int J Sci Res Eng Manag. 2021; 5: 1-11. https://doi.org/10.1109/ICAC2N63387.2024.10895870

[26] Chinedum A, Ogochukwu O. Application of Naïve Bayes and SVM techniques on sentiment analysis on Nigerian tweets. Int Res J Mod Eng Technol Sci. 2021: 2582-5208.

[27] de Guzman AB, Mesana JCB, Roman JAM. Beyond the tip of the iceberg: a qualitative sentiment analysis of YouTube viewers’ emotional valence toward older adults auditioning in worldwide Got Talent®. Educ Gerontol. 2021; 47: 103-20. https://doi.org/10.1080/03601277.2021.1881868

[28] Tehreem T, Hira T. Sentiment analysis for YouTube comments in Roman Urdu. 2021; arXiv . (Preprint). https://doi.org/10.1145/nnnnnnn.nnnnnnn

[29] Muhammad SH, Adelani DI, Ruder S, Ahmad IS, Abdulmumin I, Bello BS, et al. NaijaSenti: a Nigerian Twitter sentiment corpus for multilingual sentiment analysis. 2022.

[30] Fowobaje KR, Mashood LO, Ekholuenetale M, Ibidoja OJ. Qualitative content analysis of Nigerian heads-of-state and presidents’ inaugural addresses: text mining, topic modelling and sentiment analysis. SN Soc Sci. 2022; 2: 279. https://doi.org/10.1007/s43545-022-00570-x

[31] AminiMotlagh M, Shahhoseini H, Fatehi N. A reliable sentiment analysis for classification of tweets in social networks. Soc Netw Anal Min. 2022; 13: 7. https://doi.org/10.1007/s13278-022-00998-2

[32] Oyewola DO, Oladimeji LA, Julius SO, Kachalla LB, Dada EG. Optimizing sentiment analysis of Nigerian 2023 presidential election using two-stage residual long short term memory. Heliyon. 2023; 9: e14836. https://doi.org/10.1016/j.heliyon.2023.e14836

[33] Olabanjo O, Wusu A, Afisi O, Asokere M, Padonu R, Olabanjo O, et al. From Twitter to Aso-Rock: a sentiment analysis framework for understanding Nigeria 2023 presidential election. Heliyon. 2023; 9: e16085. https://doi.org/10.1016/j.heliyon.2023.e16085

[34] Elmas T, Gül İ. Opinion mining from YouTube captions using ChatGPT: a case study of street interviews polling the 2023 Turkish elections. 2023.

[35] Su V, Thakur N. COVID-19 on YouTube: a data-driven analysis of sentiment, toxicity. In: Proceedings of the 2025 IEEE 15th Annual Computing and Communication Workshop and Conference (CCWC). IEEE; 2025. p. 715-23.

[36] Adebomi OO. ‘The land of your fathers lieth in ruins’: a multimodal critical discourse analysis of Nigeria’s 2023 pre-election crises-related internet memes. Discourse Soc. 2025; 36: 3-22. https://doi.org/10.1177/09579265241252998

[37] Madukpe VN, Ugoala CB, Wokoma CU, Nwachukwu GC. Assessment of socioeconomic determinants of voting patterns: a spatio-temporal and multinomial logits analysis of the 2023 Nigerian presidential election. 2025.

[38] Dongo I, Cadinale Y, Aguilera A, Martínez F, Quintero Y, Barrios S. Web scraping versus Twitter API: a comparison for a credibility analysis. In: ACM International Conference Proceeding Series. 2020, p. 263-73. https://doi.org/10.1145/3428757.3429104

[39] Campos-Moinier K. Collecting data from YouTube using the official API: a tutorial and a ready-to-use tool. Behav Res Methods. 2026; 58(8): 236. https://doi.org/10.3758/s13428-026-03116-8

[40] Ali I, Asif M, Hamid I, Sarwar MU, Khan FA, Ghadi Y. A word embedding technique for sentiment analysis of social media to understand the relationship between Islamophobic incidents and media portrayal of Muslim communities. PeerJ Comput Sci. 2022; 8: e838. https://doi.org/10.7717/peerj-cs.838

[41] Cai Q, Abdel-Aty M, Zheng O, Wu Y. Applying machine learning and Google Street View to explore effects of drivers’ visual environment on traffic safety. Transp Res Part C Emerg Technol. 2022; 135: 103541. https://doi.org/10.1016/j.trc.2021.103541

[42] Khanday AMUD, Khan QR, Rabani ST. Identifying propaganda from online social networks during COVID-19 using machine learning techniques. Int J Inf Technol. 2021; 13: 115-22. https://doi.org/10.1007/s41870-020-00550-5

[43] Baskar SS, Arockiam L, Charles S. A systematic approach on data pre-processing in data mining. 2013; 2(11): 335-39.

[44] Malik JS, Goyal P, Sharma AK. A comprehensive approach towards data preprocessing techniques & association rules. In: Proceedings of the 4th National Conference, Bharati Vidyapeeth’s Institute of Computer Applications and Management (BVICAM); p. 1-12.

[45] Hidayat THJ, Ruldeviyani Y, Aditama AR, Madya GR, Nugraha AW, Adisaputra MW. Sentiment analysis of Twitter data related to Rinca Island development using Doc2Vec and SVM and logistic regression as classifier. Procedia Comput Sci. 2021; 197: 660-67. https://doi.org/10.1016/j.procs.2021.12.187

[46] Sipinen J, Belschner J, Anlar B. Age gaps in political representation: comparing local and national elections. Elect Stud. 2024; 88: 102763. https://doi.org/10.1016/j.electstud.2024.102763

[47] Castanho Silva B. No votes for old men: leaders’ age and youth turnout in comparative perspective. Eur J Polit Res. 2025; 64: 276-95. https://doi.org/10.1111/1475-6765.12694

[48] Heimerl F, Lohmann S, Lange S, Ertl T. Word cloud explorer: text analytics based on word clouds. In: Proceedings of the Annual Hawaii International Conference on System Sciences. IEEE Computer Society; 2014. p. 1833-42. https://doi.org/10.1109/HICSS.2014.231

[49] Kabir AI, Ahmed K, Karim R. Word cloud and sentiment analysis of Amazon earphones reviews with R programming language. Inform Econ. 2020; 24: 55-71. https://doi.org/10.24818/issn14531305/24.4.2020.05

[50] Kabir AI, Karim R, Newaz S, Hossain MI. The power of social media analytics: text analytics based on sentiment analysis and word clouds on R. Inform Econ. 2018; 22: 25-38. https://doi.org/10.12948/issn14531305/22.1.2018.03

[51] Anwar Hridoy SA, Ekram MT, Islam MS, Ahmed F, Rahman RM. Localized Twitter opinion mining using sentiment analysis. Decis Anal. 2015; 2: 6. https://doi.org/10.1186/s40165-015-0016-4

Downloads

Published

2026-10-22

Issue

Section

Articles

How to Cite

A Computational Sentiment Analysis of Public Opinion on Nigerian 2023 Presidential Candidates from YouTube Video Comments. (2026). Journal of Advances in Applied & Computational Mathematics, 13(2), 187-199. https://doi.org/10.15377/2409-5761.2026.13.11

Similar Articles

21-30 of 54

You may also start an advanced similarity search for this article.