Back to results

University of Pretoria

Sentiment analysis using unsupervised learning for local government elections in South Africa

Abstract

dc:description.abstract

Understanding public sentiment is vital for political parties in order for them to be able to structure their election campaigns around voter expectations. The study focuses on unsupervised learning to assess the variation of polarity sentiment in tweets during the 2021 South African local government election campaign. The study uses a pre-trained twitter-roberta-base-sentiment-latest model from Hugging Face and unsupervised lexicon based pre-trained approaches, namely: VADER and TextBlob to determine the polarity sentiment in order to gain insight that could be applied towards informing political campaigns and to see if there are any distinct sentiment patterns or shifts during different phases of the 2021 local government elections campaigns. Furthermore, the study applies the use of suspicious patterns and K-Means methods to classify the users as either bots and human using to be able to identify the user behind the keyboard. The study also make use of OpenAI GPT model to label the dataset for fine-tuning and addresses the issue of class imbalance. VADER and TextBlob results show a significant difference from that of the twitter-roberta-base-sentiment-latest models when comparing the statistical distribution based on the sentiment results and the user classification results. Based on the results, there is a significant variation across all sentiment classes and they vary over time. Furthermore, the results revealed TRBSL and TRBSL** outperforms VADER and TextBlob based on the scores for weighted accuracy and F1-scores. It was discovered that most of the tweets were generated by humans, with only few being identified as bot-generated and having a negative sentiments.

Degree

thesis:*
Grantor dc:publisher
University of Pretoria
Year dc:date.issued
2023

Author and committee

dc:creator, dc:contributor.*
Advisor dc:contributor.advisor
  • Marivate, Vukosi

Subjects

dc:subject × 7

Rights

dc:rights
Statement dc:rights
  • © 2021 University of Pretoria. All rights reserved. The copyright in this work vests in the University of Pretoria. No part of this work may be reproduced or transmitted in any form or by any means, without the prior written permission of the University of Pretoria.
Language dc:language.iso
en

Identifiers

dc:identifier.*
Dc Identifier Other
A2024
OAI identifier oai:identifier
oai:repository.up.ac.za:2263/98196

Chain of custody

source
Harvested from
University of Pretoria
Base URL
repository.up.ac.za/server/oai/request
Last updated
2026-07-24
Source record
OAI-PMH GetRecord
citation

Sentiment analysis using unsupervised learning for local government elections in South Africa. University of Pretoria, 2023. http://hdl.handle.net/2263/98196