Twitter Sentiment Analysis of Lagos State 2023 Gubernatorial Election Using BERT

O. Olabanjo, A. Wusu, Rebecca Padonu, O. Afisi, Manuel Mazzara
{"title":"Twitter Sentiment Analysis of Lagos State 2023 Gubernatorial Election Using BERT","authors":"O. Olabanjo, A. Wusu, Rebecca Padonu, O. Afisi, Manuel Mazzara","doi":"10.33422/jarss.v6i2.1027","DOIUrl":null,"url":null,"abstract":"Many cutting-edge language models have been used in the past to forecast election results. Sentiment analysis aids in opinion mining – a common experiment used to detect public opinions – on a given topic. Twitter has gained popularity and established itself as a crucial instrument for analyzing public opinion on elections and other trending issues. The unexpected but interesting results of recently held Nigeria's presidential election shifted attention to the upcoming governorship race in Lagos State. In this work, we propose a Google’s Bidirectional Encoder Representations from Transformers (BERT) model for the sentiment analysis of governorship election in Lagos State, Nigeria, using Twitter data. A total of 800,000 personal and public tweets were scraped from twitter concerning the three prominent contesting Lagos State Gubernatorial candidates using carefully selected search queries. The tweets were preprocessed to avoid noise and inconsistencies and the preprocessed tweets were parsed into the pre-trained and finetuned BERT model. The result was analyzed to establish the sentiments of the public about the candidates. The social networks of the candidates were also presented and the effect of parameter using different learning rates (LR) was also considered. The BERT model achieved the maximum performance under varied learning rate and epoch sizes of 88% precision, 92% recall and 91% F1-Measure. Results also showed that the learning rate at 1e-7 gave the best performance. Also, the smaller the learning rate, the higher the accuracy but the larger the epoch size, the higher the accuracy. Applying the developed BERT model to the public’s tweet showed that the election will be a two-party race between the Labour Party and All Progressives Congress party, thereby challenging the status quo. The results of the experiment demonstrated that sentiment analysis and other Natural Language Processing activities can help with comprehension of the social media environment. Results also showed how much influence each candidate has over the outcome of the election. We come to the conclusion that estimating election results and providing insights for electoral parties can benefit from sentiment analysis and other language models.","PeriodicalId":14964,"journal":{"name":"Journal of Advanced Research in Social Sciences and Humanities","volume":"1 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2023-05-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Advanced Research in Social Sciences and Humanities","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.33422/jarss.v6i2.1027","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Many cutting-edge language models have been used in the past to forecast election results. Sentiment analysis aids in opinion mining – a common experiment used to detect public opinions – on a given topic. Twitter has gained popularity and established itself as a crucial instrument for analyzing public opinion on elections and other trending issues. The unexpected but interesting results of recently held Nigeria's presidential election shifted attention to the upcoming governorship race in Lagos State. In this work, we propose a Google’s Bidirectional Encoder Representations from Transformers (BERT) model for the sentiment analysis of governorship election in Lagos State, Nigeria, using Twitter data. A total of 800,000 personal and public tweets were scraped from twitter concerning the three prominent contesting Lagos State Gubernatorial candidates using carefully selected search queries. The tweets were preprocessed to avoid noise and inconsistencies and the preprocessed tweets were parsed into the pre-trained and finetuned BERT model. The result was analyzed to establish the sentiments of the public about the candidates. The social networks of the candidates were also presented and the effect of parameter using different learning rates (LR) was also considered. The BERT model achieved the maximum performance under varied learning rate and epoch sizes of 88% precision, 92% recall and 91% F1-Measure. Results also showed that the learning rate at 1e-7 gave the best performance. Also, the smaller the learning rate, the higher the accuracy but the larger the epoch size, the higher the accuracy. Applying the developed BERT model to the public’s tweet showed that the election will be a two-party race between the Labour Party and All Progressives Congress party, thereby challenging the status quo. The results of the experiment demonstrated that sentiment analysis and other Natural Language Processing activities can help with comprehension of the social media environment. Results also showed how much influence each candidate has over the outcome of the election. We come to the conclusion that estimating election results and providing insights for electoral parties can benefit from sentiment analysis and other language models.
利用BERT对拉各斯州2023年州长选举的Twitter情绪分析
许多先进的语言模型在过去被用来预测选举结果。情感分析有助于对给定主题进行意见挖掘——一种用于检测公众意见的常用实验。Twitter越来越受欢迎,并成为分析公众对选举和其他趋势问题的看法的重要工具。最近举行的尼日利亚总统选举出人意料但有趣的结果将人们的注意力转移到了即将到来的拉各斯州州长竞选上。在这项工作中,我们提出了一个谷歌的双向编码器表示来自变形金刚(BERT)模型,用于尼日利亚拉各斯州州长选举的情感分析,使用Twitter数据。通过精心挑选的搜索查询,从推特上抓取了关于拉各斯州三位著名州长候选人的总计80万条个人和公共推文。对推文进行预处理以避免噪声和不一致,并将预处理后的推文解析到预训练和微调的BERT模型中。分析结果是为了确定公众对候选人的看法。给出了候选对象的社会网络,并考虑了不同学习率(LR)下参数的影响。在不同的学习速率和epoch大小下,BERT模型达到了88%的准确率、92%的召回率和91%的F1-Measure的最佳性能。结果还表明,学习速度在1e-7给出了最好的表现。学习速率越小,准确率越高,epoch越大,准确率越高。将开发的BERT模型应用到公众推特上,可以看出这次选举将是工党和全进步大会党之间的两党竞争,从而挑战了现状。实验结果表明,情感分析和其他自然语言处理活动可以帮助理解社交媒体环境。结果还显示了每位候选人对选举结果的影响程度。我们得出的结论是,估计选举结果并为选举政党提供见解可以受益于情感分析和其他语言模型。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信