Preprint
Article

This version is not peer-reviewed.

Detect Then Rewrite: A Two-Stage Pipeline for Arabic Toxicity Moderation under Data Scarcity

Submitted:

23 August 2026

Posted:

02 September 2026

You are already at the latest version

Abstract
Arabic harmful-content moderation is commonly framed as toxicity detection, but many practical settings also require safer alternatives to toxic text rather than only blocking or labeling it. We study Arabic toxicity handling as a low-resource detect–then–rewrite problem. The first stage classifies comments as normal, hate, or abusive using a multi-dialect Arabic encoder, while the second stage rewrites toxic inputs into neutral alternatives using an Arabic sequence-to-sequence model. The detector is fine-tuned on Tun-EL, and the rewriter is trained with hybrid supervision from human rewrites, span-targeted rule-based augmentation, and multilingual ParaDetox transfer pairs. Our main focus is rewrite informativeness: many toxic–neutral pairs are identical or minimally edited, which may encourage copying rather than meaningful detoxification. The classifier achieves 82.42\% accuracy and 0.93 macro AUC. For rewriting, the more informative supervision variant improves sacreBLEU from 49.09 to 61.19, while the lower-informativeness variant gives stronger relative toxicity reduction under the current evaluation. These results suggest that Arabic detoxification is sensitive to supervision quality under data scarcity.
Keywords: 
;  ;  ;  ;  ;  ;  ;  

1. Introduction

Recent advances in generative language models have expanded the role of automated content moderation beyond toxicity detection toward toxicity transformation, where harmful content is rewritten into safer alternatives rather than simply blocked or removed. Such capabilities are particularly relevant for educational, governmental, and community-driven platforms, where preserving the user’s communicative intent may be preferable to suppressing content entirely. While large language models have demonstrated strong text generation capabilities, controlled detoxification remains challenging, especially in low-resource languages where toxic–neutral parallel data are scarce.
Existing Arabic toxicity research has focused primarily on sentence-level classification, leveraging pretrained language models such as AraBERT and MARBERT to identify abusive, hateful, or offensive content [1,2,3]. In contrast, Arabic toxic-to-neutral rewriting remains comparatively underexplored. Recent detoxification studies in English and multilingual settings have shown that generative models can reduce toxicity while preserving meaning [4,5]. However, these approaches rely on parallel toxic–neutral supervision, a resource that remains limited for Arabic, particularly across dialects.
Arabic presents additional challenges for detoxification. Unlike toxicity classification, detoxification requires both identifying harmful content and generating an acceptable alternative while preserving meaning and dialectal context. Toxic expressions are often dialectal, informal, and highly context-dependent. The same offensive intent may be expressed differently across Egyptian, Lebanese, and Tunisian Arabic, making both detection and rewriting difficult. Moreover, available Arabic toxic–neutral pairs are often minimally edited, where the neutral target differs from the original text by only a single token replacement or deletion. Although such pairs increase dataset size, they may provide weak supervision signals by encouraging copying behavior rather than meaningful rewriting.
In this paper, we study Arabic toxicity handling as a low-resource detect–then–rewrite problem. As illustrated in Figure 1, the first stage identifies whether an input is normal, hate, or abusive, while the second stage leverages a generative Arabic sequence-to-sequence model to rewrite toxic content into a neutral alternative. Rather than focusing solely on model architecture, we investigate an often-overlooked aspect of detoxification systems: the quality of rewrite supervision.
Specifically, we ask:
How does rewrite-supervision quality affect Arabic detoxification behavior under low-resource conditions?
To answer this question, we construct two detoxification corpora that differ in the proportion of informative toxic–neutral rewrites. The corpora combine human rewrites, rule-based span-level augmentation, and multilingual transfer pairs while keeping the generation architecture and training configuration fixed. This design isolates the effect of rewrite supervision while keeping the generation model fixed.
Our results suggest that supervision quality influences detoxification behavior. The higher-quality supervision setting improves reference alignment, while the lower-quality setting achieves stronger relative toxicity reduction. These findings highlight the importance of supervision quality in low-resource Arabic detoxification and suggest that Arabic detoxification involves a trade-off between conservative reference-aligned rewriting and more aggressive toxicity removal.
The main contributions of this work are the following:
  • We formulate Arabic toxicity moderation as a low-resource detect–then–rewrite task that combines classification and generative detoxification.
  • We provide empirical evidence that rewrite-supervision quality influences Arabic detoxification behavior under multi-dialect and low-resource conditions.
  • We identify identical and near-identical toxic–neutral pairs as a source of weak supervision that may encourage copying behavior.
  • We compare two supervision-quality settings and analyze their impact on reference alignment and toxicity reduction.
  • Upon acceptace we will release code, preprocessing scripts, and experimental splits to support reproducible research in Arabic detoxification.

3. Task Definition

We formulate Arabic toxicity handling as two interrelated tasks: toxicity classification and toxic-to-neutral rewriting.
  • Task 1: Toxicity classification.
Given an Arabic input sentence x, the classification model assigns one of three labels:
y { normal , hate , abusive } .
The normal label denotes non-offensive content. The hate label denotes derogatory or dehumanizing language directed toward a group or identity. The abusive label denotes offensive or insulting language that is not necessarily group-targeted, such as profanity or personal insults.
  • Task 2: Detoxification.
For inputs classified as hate or abusive, the rewriting model generates a neutral version x ^ . The objective is to remove or soften toxic expressions while preserving the main communicative intent and dialectal context of the original sentence. Inputs classified as normal are passed through unchanged. Table 1 presents representative rewrite operations, including substitution, deletion, and softening.

4. Dataset and Resources

This section documents the resources used in both stages of the pipeline: (1) multi-dialect Arabic toxicity detection (Task 1) and (2) toxic→neutral detoxification (Task 2). For clarity and reproducibility, we distinguish between adopted datasets (public, pre-existing) and constructed resources (created in this work).

4.1. Adopted Resources

  • Tun-EL Dataset.1 Tun-EL serves two roles in our pipeline: (i) the benchmark dataset for Task 1 toxicity detection, and (ii) the source of toxic inputs for constructing rewrite supervision in Task 2.
Tun-EL merges five Arabic datasets spanning three dialects (Tunisian, Egyptian, Lebanese) under a unified 3-way label scheme: normal, hate, and abusive [3]. The dataset contains 23 , 033 comments: 12 , 353  normal (53.6%), 6 , 830  hate (29.7%), and 3 , 850  abusive (16.7%).
We apply a stratified 60/20/20 train/validation/test split over the three labels. The resulting split statistics are shown in Table 2. During preprocessing, we detect 6 , 228 duplicate rows ( 27 % ). To preserve benchmark comparability, we retain duplicates, though they may inflate scores if identical texts appear across partitions.
  • ParaDetox (Multilingual Transfer). We incorporate 3 , 600 multilingual toxic→neutral pairs (400 per language across nine languages, including Arabic) from ParaDetox.2 We use this resource as cross-lingual auxiliary supervision and do not apply rule-based augmentation to it.

4.2. Constructed Resources for Task 2: Arabic Detoxification

To train the detoxification model under data scarcity, we construct a hybrid toxic-to-neutral parallel corpus using toxic examples from the training split only. Validation and test instances are kept separate and are used only for evaluation.
The corpus combines three sources of supervision: (i) human toxic-to-neutral rewrites derived from Tun-EL, (ii) rule-based augmented toxic-to-neutral pairs, and (iii) multilingual transfer pairs from ParaDetox.
  • Human rewrites.
Tun-EL provides aligned toxic comments and detoxified versions through the commentaire and detoxified_commentaire columns. The alignment is preserved by row index. These rewrites are generally localized rather than full-sentence paraphrases: toxic spans are often substituted, softened, or deleted while the surrounding dialectal context is preserved. As shown in Table 3, only 26–35% of examples differ from the original input across dialects, with small average token and character changes. This confirms that the available supervision is mostly span-level and conservative.
  • Rule-based augmentation.
To increase coverage, we apply deterministic span-level augmentation to toxic training examples from the hate and abusive classes. The augmentation module combines a curated toxic-word lexicon, phrase-level insult patterns, and regex-based span detection. We retain only examples modified by one of three operations: substitution, softening, or deletion. This provides controllable supervision, but we treat it as supplemental because it may miss implicit toxicity and can introduce repetitive neutral patterns.
  • Supervision variants.
During corpus construction, we found that many toxic-neutral pairs were identical or near-identical, providing weak learning signals for detoxification. We therefore construct two variants: D detox ( 1 ) , a lower-quality supervision setting, and D detox ( 2 ) , a refined setting with more informative human rewrites and reduced reliance on rule-based pairs. Table 4 summarizes the final composition.

5. Evaluation Measures

We evaluate the two tasks defined in Section 3: (i) three-way toxicity classification and (ii) toxic-to-neutral detoxification. For Task 1, we evaluate classification performance on the held-out test set. For Task 2, we evaluate detoxification under an oracle-gated setting, where toxic inputs are selected using gold labels from the held-out test set. This study focuses on component-level evaluation under oracle gating to isolate rewrite behavior. End-to-end predicted-gated evaluation remains future work.

5.1. Task 1: Toxicity Classification

We report accuracy, macro-averaged precision, recall, and F1 across the three classes: normal, hate, and abusive. We also report per-class F1 and multi-class AUC using a One-vs-Rest scheme from predicted class probabilities.

5.2. Task 2: Detoxification

We compare two detoxification training corpora, D detox ( 1 ) and D detox ( 2 ) , that differ in rewrite supervision quality. Both experiments use the same model architecture, training hyperparameters, checkpoint selection, and decoding configuration; only the detoxification training corpus changes.
We define rewrite quality (RQ) as the proportion of informative human rewrites in the full detoxification training corpus:
R Q ( D detox ) = N human , informative | D detox | .
In this work, a human rewrite is treated as informative when the toxic input and neutral target are non-identical under exact text comparison. Under this definition, D detox ( 1 ) has RQ = 36.3%, while D detox ( 2 ) has RQ = 60.8% (Table 4).
Because the two corpora are not size-matched, observed differences may reflect both rewrite supervision quality and corpus size. We therefore interpret the comparison as a realistic low-resource study rather than a fully isolated causal ablation.
  • Reference overlap.
We report sacreBLEU and ROUGE-L F1 between the generated rewrite x ^ and the reference rewrite r. These metrics measure reference alignment, not fluency directly.
  • Toxicity reduction.
We use a fixed external toxicity scorer to score the original input and generated output. Let T o x o r i g denote the toxicity score of the original input and T o x g e n denote the toxicity score of the generated rewrite. We compute relative toxicity reduction as:
T o x R e d = T o x o r i g T o x g e n T o x o r i g .

6. Implementation Details

6.1. Toxicity Classifier

We fine-tune two pretrained Arabic transformer encoders for three-way sequence classification: AraBERTv02 [1] and MARBERT [2]. Each model uses a standard classification head over the labels normal, hate, and abusive. We train and evaluate using the stratified Tun-EL splits described in Section 4. Duplicates are retained to preserve comparability with the original benchmark setting, but we discuss the resulting leakage risk in Section 8.

6.2. Detoxification Generator

We implement detoxification as conditional sequence-to-sequence generation using AraT5v2-base-1024 [8,13]. Given a toxic input sentence x, the model generates a neutral rewrite x ^ . We train two generator variants using D detox ( 1 ) and D detox ( 2 ) from Table 4. All training and decoding settings are kept fixed across the two variants.
Checkpoint selection is based on validation sacreBLEU. At inference time, we use beam search with beam size 4, maximum output length 128, default length penalty, and early stopping disabled. The main training and decoding hyperparameters used for both tasks are summarized in Table 6.
Table 5. Task 1 overall test-set performance comparison between AraBERTv02 and MARBERT.
Table 5. Task 1 overall test-set performance comparison between AraBERTv02 and MARBERT.
Metric AraBERTv02 MARBERT
Accuracy 82.42% 82.03%
Precision 82.30% 82.10%
Recall 82.42% 82.03%
F1-Score 82.31% 82.04%
AUC (macro, OvR) 0.93 0.91
Table 6. Main training and decoding hyperparameters.
Table 6. Main training and decoding hyperparameters.
Parameter Classifier (Task 1) Generator (Task 2)
Max length 128 128
Batch size 16 8
Gradient accumulation 4
Epochs 3 3
Optimizer AdamW AdamW
Learning rate 5 × 10 5 / 2 × 10 5 * 2 × 10 5
Loss / objective Cross-entropy Seq2seq NLL
Decoding Beam (4)

6.3. Toxicity Scoring

For detoxification evaluation, we use the fixed external scorer textdetox/bert-multilingual -toxicity-classifier. The scorer is applied to the original toxic input and the generated rewrite to compute T o x R e d . The Task 1 classifier is used for toxicity detection in the proposed pipeline, but it is not used as the toxicity scorer for the reported detoxification results.
Table 7. Representative detoxification examples from the Experiment 2 test set. Placeholders are used for safety and mark targeted spans (e.g., <INSULT>, <SLUR>). ToxRed shown as Tox o r i g Tox g e n .
Table 7. Representative detoxification examples from the Experiment 2 test set. Placeholders are used for safety and mark targeted spans (e.g., <INSULT>, <SLUR>). ToxRed shown as Tox o r i g Tox g e n .
Transformation Dialect Toxic Input Generated Output Category ToxRed
Figure 2. Multi-class ROC curve (One-vs-Rest) on the test set. AUCs: Normal=0.94, Hate=0.90, Abusive=0.95.
Figure 2. Multi-class ROC curve (One-vs-Rest) on the test set. AUCs: Normal=0.94, Hate=0.90, Abusive=0.95.
Preprints 229803 g002
Figure 3. Confusion matrix of AraBERTv02 on the test set.
Figure 3. Confusion matrix of AraBERTv02 on the test set.
Preprints 229803 g003
Table 8. Task 2 detoxification results under the lower-RQ and higher-RQ supervision settings. Detoxification is evaluated under oracle-gated selection using gold toxic labels.
Table 8. Task 2 detoxification results under the lower-RQ and higher-RQ supervision settings. Detoxification is evaluated under oracle-gated selection using gold toxic labels.
Metric Exp. 1 Exp. 2
BLEU (sacreBLEU) 49.09 61.19
ROUGE-L 0.1372 0.0983
Tox o r i g 0.6748 0.6173
Tox g e n 0.4495 0.4388
ToxRed 33.4% 28.9%
Tox r e f 0.2867 0.2773

7. Results

This section presents the results for the two components of the proposed detect–then–rewrite pipeline. We first evaluate toxicity classification on the held-out Tun-EL test set and then evaluate toxic-to-neutral rewriting under the two rewrite-supervision settings described in Section 5. Detoxification experiments are reported under an oracle-gated setting in which toxic inputs are selected using gold labels.

7.1. Task 1: Toxicity Classification

The held-out test set contains 4,607 instances, comprising 2,471 normal comments, 1,366 hate comments, and 770 abusive comments. Table 5 reports the overall performance of AraBERTv02 and MARBERT.
AraBERTv02 achieves the strongest overall performance, obtaining 82.42% accuracy, 82.31% macro F1, and 0.93 macro AUC. MARBERT achieves comparable results, with 82.03% accuracy, 82.04% macro F1, and 0.91 macro AUC. The small performance gap indicates that both pretrained Arabic encoders provide effective representations for multi-dialect toxicity classification, although AraBERTv02 consistently performs slightly better across all reported metrics.
Figure 2 presents the One-vs-Rest ROC curves for AraBERTv02. The abusive class achieves the highest AUC (0.95), followed by the normal class (0.94), while the hate class achieves the lowest AUC (0.90). This pattern suggests that abusive content is more separable than hate content in the Tun-EL benchmark.
The confusion matrix in Figure 3 further illustrates the error distribution. Most normal comments are classified correctly, whereas hate instances exhibit higher confusion with both normal and abusive classes. These results indicate that hate speech remains the most challenging category in the three-way classification setting.

7.2. Task 2: Detoxification

Table 8 reports detoxification performance for the two supervision variants. Experiment 1 uses the lower-RQ corpus D detox ( 1 ) , whereas Experiment 2 uses the higher-RQ corpus D detox ( 2 ) .
Experiment 2 achieves higher reference-overlap performance, improving sacreBLEU from 49.09 to 61.19 (+12.10 points). In contrast, ROUGE-L decreases from 0.1372 to 0.0983. Taken together, these results indicate that increasing rewrite-supervision quality improves BLEU-based agreement with the reference rewrites, although the improvement is not reflected consistently across all overlap measures.
The toxicity-reduction results show a different pattern. Experiment 1 achieves a higher relative toxicity reduction, with ToxRed increasing from 28.9% in Experiment 2 to 33.4%. However, the generated toxicity scores remain similar across both settings ( Tox g e n = 0.4495 and 0.4388 , respectively). Thus, the observed difference in ToxRed should be interpreted in the context of the corresponding original toxicity scores reported for each experiment.
Overall, the two supervision settings exhibit different strengths. The higher-RQ corpus yields stronger BLEU-based reference alignment, whereas the lower-RQ corpus achieves higher relative toxicity reduction according to the external toxicity scorer. Because the two training corpora differ in both supervision composition and total size, the comparison should be interpreted as evidence of differing detoxification behavior under realistic low-resource conditions rather than as a fully controlled causal ablation.

8. Discussion

The results suggest that rewrite-supervision quality influences Arabic detoxification behavior under low-resource conditions. While both supervision settings produce effective detoxification models, they lead to different generation characteristics.
  • Detection as a routing stage.
Both AraBERTv02 and MARBERT achieve strong performance on the three-way classification task, indicating that pretrained Arabic encoders can serve as effective front-end components in a detect–then–rewrite pipeline. However, hate speech remains the most challenging category, suggesting that improvements in hate-speech detection may directly improve downstream moderation performance.
  • Effect of rewrite-supervision quality.
Increasing the proportion of informative toxic–neutral rewrites improves BLEU-based agreement with the reference outputs. This finding supports the hypothesis that identical or minimally modified pairs provide a weaker learning signal and may encourage copying behavior rather than meaningful rewriting. However, the differing BLEU and ROUGE-L trends indicate that no single overlap metric fully captures detoxification quality.
  • Reference alignment versus toxicity reduction.
The two supervision settings exhibit different strengths. The higher-RQ corpus produces stronger reference alignment, whereas the lower-RQ corpus achieves greater relative toxicity reduction according to the external toxicity scorer. This suggests that reference alignment and toxicity reduction represent related but distinct objectives in detoxification systems.
  • Qualitative observations.
Representative examples are presented in Table 7. The examples show that the model can successfully replace toxic spans while preserving surrounding dialectal context. However, under-detoxification remains a common failure mode, particularly when toxic expressions fall outside the coverage of the available supervision signals. This highlights the importance of accurate span-level transformations in Arabic detoxification.
  • Limitations.
Several limitations should be considered. First, the two detoxification corpora are not size-matched, making it difficult to isolate the effect of supervision quality from corpus size. Second, evaluation is performed under oracle-gated selection rather than end-to-end deployment. Third, the current evaluation relies on automatic metrics and does not assess fluency, meaning preservation, or perceived offensiveness through human judgment. Finally, duplicate instances were retained to preserve benchmark comparability, and future work should examine duplicate-aware evaluation protocols.
Overall, the findings support the central claim that supervision quality affects Arabic detoxification behavior under data scarcity. They further suggest that improving reference alignment does not necessarily lead to stronger toxicity reduction, motivating future work on size-matched ablations and human-centered evaluation.

9. Conclusions and Future Work

This paper studied Arabic toxicity handling under data scarcity using a two-stage detect–then–rewrite pipeline. The framework combines multi-dialect toxicity classification with toxic-to-neutral rewriting, allowing moderation systems to produce safer alternatives rather than only label harmful content.
We constructed a hybrid Arabic detoxification corpus from human rewrites, rule-based augmentation, and multilingual transfer pairs. The results show that rewrite-supervision quality affects detoxification behavior: higher-quality supervision improves reference alignment, while lower-quality supervision yields stronger relative toxicity reduction under the current evaluation. This suggests that reference alignment and toxicity reduction capture different aspects of detoxification quality.
Future work should include size-matched ablations, predicted-gated end-to-end evaluation, and human judgments of fluency, meaning preservation, and perceived toxicity. Further work should also explore span-aware and controllable detoxification methods for better preserving dialectal context while reducing harmful content.

References

  1. Antoun, W.; Baly, F.; Hajj, H. AraBERT: Transformer-Based Model for Arabic Language Understanding. In Proceedings of the Proceedings of the 4th Workshop on Open-Source Arabic Corpora and Processing Tools (OSACT), Marseille, France, 2020; pp. 9–15.
  2. Abdul-Mageed, M.; Elmadany, A.; Kübler, S. MarBERT: Deep Bidirectional Transformers for Arabic. In Proceedings of the Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics (ACL), Virtual Event, 2021; pp. 8458–8467.
  3. Badri, N.; Kboubi, F.; Habacha, A. Towards Automatic Detection of Inappropriate Content in Multi-Dialectic Arabic Text. In Advances in Computational Collective Intelligence; Springer, 2022. Tun-EL resources: https://github.com/NabilBADRI/Towards-Automatic-Detection-of-Inappropriate-Content-in-Multi-dialectic-Arabic-Text.
  4. Dale, D.; Voronov, A.; Dementieva, D.; Logacheva, V.; Kozlova, O.; Semenov, N.; Panchenko, A. Text Detoxification using Large Pre-trained Neural Models. In Proceedings of the Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2021, pp. 7979–7996.
  5. Laugier, L.; Pavlopoulos, J.; Sorensen, J.; Dixon, L. Civil Rephrases of Toxic Texts with Self-Supervised Transformers. In Proceedings of the Proceedings of EACL, 2021, pp. 1442–1461.
  6. Mubarak, H.; Darwish, K.; Magdy, W.; Elsayed, T.; Al-Khalifa, H. Overview of OSACT4 Arabic Offensive Language Detection Shared Task. In Proceedings of the Proceedings of the 4th Workshop on Open-Source Arabic Corpora and Processing Tools (OSACT4), 2020, pp. 48–52.
  7. Nagoudi, E.M.B.; Elmadany, A.; Abdul-Mageed, M. AraT5: Text-to-Text Transformers for Arabic Language Generation. In Proceedings of the Proceedings of ACL, 2022, pp. 628–647.
  8. Nagoudi, E.M.B.; Elmadany, A.; Abdul-Mageed, M. AraT5v2: Empowering Arabic Text Generation with Prompt-Based Fine-Tuning. In Proceedings of the Proceedings of the 29th International Conference on Computational Linguistics (COLING), 2022, pp. 3141–3152.
  9. Xue, L.; Constant, N.; Roberts, A.; Kale, M.; Al-Rfou, R.; Siddhant, A.; Barua, A.; Raffel, C. mT5: A Massively Multilingual Pre-trained Text-to-Text Transformer. In Proceedings of the Proceedings of NAACL-HLT, 2021, pp. 483–498. [CrossRef]
  10. Liu, Y.; Gu, J.; Goyal, N.; Li, X.; Edunov, S.; Ghazvininejad, M.; Lewis, M.; Zettlemoyer, L. Multilingual Denoising Pre-training for Neural Machine Translation. Transactions of the Association for Computational Linguistics 2020, 8, 726–742. [CrossRef]
  11. Hedderich, M.A.; Lange, L.; Adel, H.; Strötgen, J.; Klakow, D. A Survey on Recent Approaches for Natural Language Processing in Low-Resource Scenarios. In Proceedings of the Proceedings of NAACL-HLT, 2021, pp. 2545–2568.
  12. Wei, J.; Zou, K. EDA: Easy Data Augmentation Techniques for Boosting Performance on Text Classification Tasks. In Proceedings of the Proceedings of EMNLP-IJCNLP, 2019, pp. 6382–6388.
  13. UBC-NLP. AraT5v2-base-1024. Hugging Face model card, 2023. https://huggingface.co/UBC-NLP/AraT5v2-base-1024.
Figure 1. Overview of the proposed Arabic toxicity handling framework. Task 1 performs three-way toxicity classification, while Task 2 rewrites toxic inputs into neutral alternatives. The components are evaluated using classification and detoxification metrics.
Figure 1. Overview of the proposed Arabic toxicity handling framework. Task 1 performs three-way toxicity classification, while Task 2 rewrites toxic inputs into neutral alternatives. The components are evaluated using classification and detoxification metrics.
Preprints 229803 g001
Table 1. Illustrative detoxification examples. Placeholders are used for safety and mark targeted spans (e.g., <INSULT>, <GROUP>).
Table 1. Illustrative detoxification examples. Placeholders are used for safety and mark targeted spans (e.g., <INSULT>, <GROUP>).
Transformation Dialect Toxic Input Neutral Output Operation
Animal insult Egyptian إنت <INSULT> إنت شخص Substitution
Softening Lebanese إنت <INSULT> تصرّفك غير مناسب softening
Table 2. Tun-EL label distribution under the stratified 60/20/20 train-validation-test split.
Table 2. Tun-EL label distribution under the stratified 60/20/20 train-validation-test split.
Split #Abusive #Hate #Normal #Total
Train 2310 4098 7411 13819
Validation 770 1366 2471 4607
Test 770 1366 2471 4607
Total 3850 6830 12353 23033
Table 3. Detoxification behavior across dialects in the pipeline. “Changed” denotes the percentage of instances where the detoxified output differs from the original input. Δ Tok and Δ Char represent average token and character differences, reflecting the localized nature of span-level rewriting.
Table 3. Detoxification behavior across dialects in the pipeline. “Changed” denotes the percentage of instances where the detoxified output differs from the original input. Δ Tok and Δ Char represent average token and character differences, reflecting the localized nature of span-level rewriting.
Dialect N Changed (%) Δ Tok Δ Char
Egyptian 1,100 26.0 +0.27 +0.99
Lebanese 9,196 34.9 +0.20 +0.44
Tunisian 6,460 28.9 +0.25 +0.78
Table 4. Detoxification training data composition. RQ denotes the proportion of informative human rewrites in the full detoxification training corpus.
Table 4. Detoxification training data composition. RQ denotes the proportion of informative human rewrites in the full detoxification training corpus.
Source D detox ( 1 ) D detox ( 2 )
Informative human rewrites 2,390 5,683
Rule-based pairs 591 68
ParaDetox transfer pairs 3,600 3,600
Total pairs 6,581 9,351
Rewrite quality (RQ) 36.3% 60.8%
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.