[Paper Review] Transformers and Ensemble methods: A solution for Hate Speech Detection in Arabic languages
This paper proposes an ensemble of six Arabic-specific and multilingual transformer models—AraBERT, AraELECTRA, Albert-Arabic, AraGPT2, mBERT, and XLM-RoBERTa—for hate speech detection in Arabic social media text. Using a majority vote ensemble method on fine-tuned models, the approach achieves an F1-score of 0.60 and accuracy of 0.86 on the test set, outperforming individual models and demonstrating the effectiveness of ensemble learning in low-resource Arabic NLP tasks.
This paper describes our participation in the shared task of hate speech detection, which is one of the subtasks of the CERIST NLP Challenge 2022. Our experiments evaluate the performance of six transformer models and their combination using 2 ensemble approaches. The best results on the training set, in a five-fold cross validation scenario, were obtained by using the ensemble approach based on the majority vote. The evaluation of this approach on the test set resulted in an F1-score of 0.60 and an Accuracy of 0.86.
Motivation & Objective
- To address the challenge of hate speech detection in low-resource Arabic dialects and formal Arabic used in social media.
- To evaluate the performance of six pre-trained transformer models specifically fine-tuned for Arabic hate speech detection.
- To investigate whether ensemble methods can improve classification performance beyond individual transformer models.
- To contribute a robust, open-source solution to the CERIST NLP Challenge 2022 task on Arabic hate speech detection.
Proposed method
- Fine-tuned six transformer models—AraBERT, AraELECTRA, Albert-Arabic, AraGPT2, mBERT, and XLM-RoBERTa—on a multilingual Arabic hate speech dataset from Twitter.
- Applied five-fold cross-validation to determine optimal hyperparameters, including learning rate (1e-5), dropout (0.3), sequence length (128 tokens), and batch size (18).
- Used majority vote ensemble: the final prediction is the class most frequently predicted across all models, with random tie-breaking.
- Implemented a second ensemble method, Highest Sum, which aggregates model confidence scores and selects the class with the highest total score.
- Optimized for the official CERIST NLP Challenge 2022 metric: F1-score on the positive (hateful) class.
- Selected the best-performing model based on cross-validation and submitted predictions using the majority vote ensemble on the test set.
Experimental results
Research questions
- RQ1How do Arabic-specific and multilingual transformer models perform in detecting hate speech in low-resource Arabic social media text?
- RQ2Can ensemble methods improve the F1-score and robustness of hate speech detection models compared to individual transformer models?
- RQ3Which ensemble strategy—majority vote or highest sum—yields better generalization on unseen test data?
- RQ4How do different pre-trained models balance precision, recall, and accuracy in the context of imbalanced hate speech detection?
- RQ5To what extent do fine-tuned transformers achieve high recall while suffering from low precision and accuracy, and how does ensembling mitigate this?
Key findings
- The majority vote ensemble achieved the highest F1-score (0.76) and accuracy (0.95) on the training set during five-fold cross-validation, outperforming all individual models.
- AraBERT achieved the second-highest F1-score (0.68) among individual models, followed by AraGPT2 (0.61), while AraELECTRA, Arabic-ALBERT, mBERT, and XLM-RoBERTa showed poor F1 and precision despite high recall.
- The majority vote ensemble achieved an F1-score of 0.60 and accuracy of 0.86 on the official test set, closely matching its cross-validation performance.
- The Highest Sum ensemble method achieved a high recall (0.96) but low precision (0.45) and F1-score (0.62), indicating over-prediction of the positive class.
- Models like AraELECTRA and mBERT achieved near-perfect recall (1.00) but extremely low accuracy and F1 due to misclassifying most negative (non-hateful) samples.
- The results confirm that ensemble methods, particularly majority vote, are more robust than individual models in handling class imbalance and improving generalization in Arabic hate speech detection.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.