Abstract
Toxic language is one of the major barrier to safe online participation, yet robust mitigation tools are scarce for African languages. This study addresses this critical gap by investigating automatic text detoxification (toxic to neutral rewriting) for two low-resource African languages, isiXhosa and Yorùbá. The work contributes a novel, pragmatic hybrid methodology: a lightweight, interpretable TF-IDF and Logistic Regression model for transparent toxicity detection, and a controlled lexicon- and token-guided rewriting component. A parallel corpus of toxic to neutral rewrites, which captures idiomatic usage, diacritics, and code switching, was developed to train and evaluate the model. The detection component achieved stratified K-fold accuracies of 61-72% (isiXhosa) and 72-86% (Yorùbá), with per-language ROC-AUCs up to 0.88. The rewriting component successfully detoxified all detected toxic sentences while preserving 100% of non-toxic sentences. These results demonstrate that scalable, interpretable machine learning detectors combined with rule-based edits offer a competitive and resource-efficient solution for culturally adaptive safety tooling, setting a new benchmark for low-resource Text Style Transfer (TST) in African languages.
Abstract (translated)
毒性语言是在线安全参与的主要障碍之一,但针对非洲语言的有效缓解工具却极为稀缺。本研究通过调查两种低资源非洲语言(isiXhosa 和 Yorùbá)的自动文本去毒化(将有毒内容转化为中立表述),来填补这一重要空白。 该研究提出了一种新颖且实用的混合方法:一个轻量级、可解释性高的 TF-IDF 和逻辑回归模型,用于透明度高的毒性检测;以及一个受控词典和标记引导重写组件。为了训练和评估模型,开发了一个平行语料库,其中包括有毒到中立表述转换,并捕捉了惯用表达、音标以及代码切换现象。 在isiXhosa语言上,该方法的检测部分实现了61-72%的分层K折准确率;而在Yorùbá语言上,则实现了72-86%的准确率。每种语言的最大ROC-AUC值达到了0.88。重写组件成功地去毒化了所有被检出的有毒句子,同时保持了非有毒句子100%的完整性。 这些结果表明,结合规则编辑和可解释性强、可扩展性好的机器学习检测器能够为文化适应性的安全工具提供竞争性和资源效率高的解决方案,并在非洲语言中的低资源文本风格转换(TST)领域树立新的标准。
URL
https://arxiv.org/abs/2601.05624