LLM-based Code-Switched Text Generation for Grammatical Error Correction

Tom Potter, Zheng Yuan

With the rise of globalisation, code-switching (CSW) has become a ubiquitous part of multilingual conversation, posing new challenges for natural language processing (NLP), especially in Grammatical Error Correction (GEC). This work explores the complexities of applying GEC systems to CSW texts. Our objectives include evaluating the performance of state-of-the-art GEC systems on an authentic CSW dataset from English as a Second Language (ESL) learners, exploring synthetic data generation as a solution to data scarcity, and developing a model capable of correcting grammatical errors in monolingual and CSW texts. We generated synthetic CSW GEC data, resulting in one of the first substantial datasets for this task, and showed that a model trained on this data is capable of significant improvements over existing systems. This work targets ESL learners, aiming to provide educational technologies that aid in the development of their English grammatical correctness without constraining their natural multilingualism.

Translation-based CSW Text Generation re-
quired a monolingual corpus, a machine transla-
tion (MT) algorithm, and a sentence parser. To
generate a CSW utterance, we used the Stanford
Parser v4.5.43 (Manning et al., 2014) to build a syn-
tactic parse tree. We then randomly selected and
translated a subtree using the ArgosTranslate MT
package4 (Finlay, 2023; Klein et al., 2017). This
method generates plausible CSW text. However,
performance is dependent on the strength of the
parsing and translation algorithms; and the style of
language within the corpus. To approximate the
style of our authentic CSW text, we used corrected
monolingual sentences from the Lang-8 corpus.

References

P.J. Finlay. 2023. Argos translate. Open-source offline
translation library written in Python