University of Pretoria
Quality evaluation strategies for synthetic code-switched data in support of language learning applications
Abstract
dc:description.abstractIn a world where almost half of the population is bilingual and a significant proportion is multilingual, code-switching is a common linguistic phenomenon in both spoken and written communication. Increasingly recognised as an intentional and structured practice rather than a linguistic deficiency, code-switching research remains constrained by the lack of high-quality, annotated resources and appropriate evaluation methodologies. These limitations are particularly pronounced in educational natural language processing technologies, where code-switching plays an important role in language learning applications. This thesis addresses the issue of code-switched data scarcity and the challenge of evaluating its syntactic quality. Large language models (LLMs) were leveraged to generate synthetic Afrikaans--English code-switched data using carefully designed prompt templates. The generated data was assessed through human evaluation and LLM-as-a-judge. Findings show that GPT-4o produced more acceptable sentences compared to Gemini 2.0 Flash, while LLM-as-a-judge revealed notable inconsistencies regarding the ability of LLMs to serve as fair evaluators of quality. Word-level language identification and part-of-speech tagging were further introduced, with rule-based and joint tagger approaches outperforming LLM-based methods. To support evaluation of syntactic quality, two evaluation methodologies were explored: a heuristic model and BERT-based classifiers. The heuristic model, based on explicit grammar rules for Afrikaans--English code-switching, achieved strong baseline performance (90.5% F1 score). A multi-input XLM-R classifier using word embeddings, language identification and part-of-speech tags, achieved the highest performance with a 97.5% F1 score. Due to the black-box nature of XLM-R models, interpretability was further explored through gradient- and occlusion-based attribution analyses, which in some cases provided complementary insights into classifier behaviour. However, it remains unclear whether the model consistently relies on linguistically appropriate signals. The final proposed evaluation strategy is a hybrid framework that combines the heuristic rule-based model with the multi-input XLM-R classifier into a meta-classifier, and optimised to reduce false negatives (incorrect CS sentences misclassified as correct). This hybrid model achieved a 93.2% F1 score with 95.0% recall on the incorrect class, balancing rule-based precision with neural generalisation. The main contributions of this thesis include (i) a framework for synthetic code-switched text generation with LLMs, (ii) a curated Afrikaans--English code-switched data set, (iii) a comprehensive evaluation strategy integrating grammar rules, neural models and explainability techniques, and (iv) a proposed set of requirements for a data set tailored to first/second language learning applications. Collectively, these contributions advance both the generation and evaluation of code-switched data, while laying a foundation for future research into educational technologies for code-switching.
Degree
thesis:*- Department dc:contributor.department
- Computer Science
- Grantor dc:publisher
- University of Pretoria
- Year dc:date.issued
- 2025
Author and committee
dc:creator, dc:contributor.*- Advisors dc:contributor.advisor
-
- Marivate, Vukosi
- Olaleye, Kayode
Subjects
dc:subject × 7Rights
dc:rights.accessrights- Statement dc:rights.accessrights
-
- Unrestricted
- © 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.*- Identifier URI
- http://hdl.handle.net/2263/107731
- Dc Identifier Citation
- *
- Dc Identifier Other
- A2026