University of Pretoria
Machine learning for social event analysis : public perceptions during COVID-19 and collective violence in South Africa
Abstract
dc:description.abstractSocial media data is a rich source for understanding social phenomena. The computational analysis of the dataset provides a different perspective on the observed phenomena. The data provided on social media platforms allows users to communicate and engage in discourse without the restrictions that traditional surveys and polls sometimes impose. Although surveys and polls are not always restrictive, social media data provides an opportunity for freer public discourse on any social event. The advancement in natural language processing, computing power, and pretrained language models has given rise to advanced text analysis. Computational analysis of social media complements the sociology framework that theorises human behaviour during a public health crisis or societal instability. Using a mixed-methods research design, the study aimed to explore how machine learning grounded in social theories can enhance the understanding of human compliance, adjustment and collective violence. The study analysed Twitter conversations (currently known as X), combining natural language processing from computer science with social theories from sociology to explore, explain, and interpret human behaviour during the COVID-19 pandemic and the July 2021 unrest in South Africa. To be specific, sentiment analysis served as a proxy for understanding public perception and compliance with non-pharmaceutical interventions by the South African government during the pandemic in the first study. In the second longitudinal study, sentiment analysis provided an empirical evaluation of adjustment phases during the pandemic. The third study showed the utility of sentiment analysis in measuring the diffusion of collective behaviour during the jailing of former President Zuma, which sparked the unrest. In addition, topic modelling enabled the in-depth exploration of discourse that occurred during compliance with government policy during the COVID-19 pandemic, the adjustment phases, and the spread of unrest in South Africa. The study produced two gold-standard datasets to support the findings. Humans created one dataset, while a pre-trained language model generated the other. The production process is outlined to demonstrate reproducibility in other scenarios. The datasets are a valuable resource for computational scientists and sociologists advancing the study of human behaviour in similar or different social events and contexts. The study's introduction of sentiment analysis as a social marker of compliance, adjustment and collective behaviour highlights empirical evaluation of sociological theories and how computational analysis contributes to the growing field of sociology. The findings of the first study showed widespread negative sentiment, indicating a lack of public confidence in the South African government’s response to the pandemic. The second study showed that the adjustment phases to non-pharmaceutical interventions during COVID-19 were complete and followed the W-curve adjustment model, although the curve was inverted. By tracking sentiment over time, the study introduced sentiment as a measure of human adjustment and suggested that the interval between the four adjustment phases seems to be within 3 months. The third study showed that the spread of violence during the July unrest followed an S-curve diffusion pattern in sentiment. These findings underscore that social media serves as an early indicator of public health and urban safety crises, and computational analysis complements sociological frameworks. The machine learning models provided in the study, when interpreted within sociological frameworks, can provide monitoring of compliance, adjustment, and diffusion. This integral approach provides feedback on government policies and policing, serving as an evidence-based strategy for maintaining safer cities and healthier societies.
Degree
thesis:*- Grantor dc:publisher
- University of Pretoria
- Year dc:date.issued
- 2025
Author and committee
dc:creator, dc:contributor.*- Advisor dc:contributor.advisor
-
- Hattingh, Maria J. (Marie)
Subjects
dc:subject × 8Rights
dc:rights- Statement dc:rights
-
- © 2024 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
- A2026
- OAI identifier oai:identifier
- oai:repository.up.ac.za:2263/108554