News-Based Political Sentiment Analysis for Election Outcome Verification: A BERT-Based Study of the 2024 UK General Election

Authors

Keywords:

BERT, Election outcome verification, Online news media, sentiment analysis, Transformer-based models, Sentiment analysis, Transformer-based models.

Abstract

Accurate verification of general election outcomes is essential for understanding political dynamics and democratic processes. However, traditional forecasting methods such as opinion polls and voter surveys often suffer from sampling bias, delayed responses, and limited ability to capture rapid sentiment shifts. This study aims to propose and evaluate a transformer-based political sentiment analysis framework using online news articles to verify the outcome of the 2024 United Kingdom General Election. A dataset of 2,299 online news articles published between January and July 2024 was collected from seven major UK news outlets. A semi-supervised labelling approach was applied to assign sentiment polarity toward the Conservative Party and the Labour Party. To handle long-form political texts exceeding transformer token limits, articles were summarised before being processed. A fine-tuned BERT-base (uncased) model was trained to classify sentiment into positive, neutral, and negative categories. Model performance was assessed using accuracy, precision, recall, and F1-score, while temporal sentiment aggregation was conducted to compare predicted trends with the actual election outcome. The fine-tuned BERT model achieved strong sentiment classification performance, demonstrating robustness in identifying political sentiment from structured news media. Temporal analysis revealed a predominance of negative sentiment toward the Conservative Party, while the Labour Party received significantly higher levels of positive sentiment, particularly in the weeks leading up to the election. These aggregated sentiment trends successfully aligned with and verified the actual election outcome. The findings confirm that online news articles are a reliable alternative data source for political sentiment analysis and election outcome verification. Additionally, the study demonstrates the effectiveness of domain-adapted transformer-based models, such as BERT, in capturing meaningful sentiment shifts that reflect real-world electoral results.

Downloads

How to Cite

News-Based Political Sentiment Analysis for Election Outcome Verification: A BERT-Based Study of the 2024 UK General Election. (2026). Global Journal of Computer Science and Technology, 26(D1), 24-32. https://doi.org/10.34257/GJCSTD253420

Author Biography

Kushani Maduhansi Hettiarachchi

Kushani Maduhansi Hettiarachchi is a researcher affiliated with Institute of Information Technology. She is credited with Conceptualization, Methodology, Software, Validation, Formal analysis, Investigation, Resources, Data curation, Writing—original draft preparation, Writing—review and editing, and Visualization.

References

News-Based Political Sentiment Analysis for Election Outcome Verification: A BERT-Based Study of the 2024 UK General Election

Published

2026-02-17

How to Cite

News-Based Political Sentiment Analysis for Election Outcome Verification: A BERT-Based Study of the 2024 UK General Election. (2026). Global Journal of Computer Science and Technology, 26(D1), 24-32. https://doi.org/10.34257/GJCSTD253420