Elamur Research⌕
☰
home / papers / 2023 / Hate speech detection in algerian dialect using deep learning

Hate speech detection in algerian dialect using deep learning

Summary

The paper addresses automatic detection of hateful messages written in the Algerian dialect. This variety of Arabic has no fixed spelling or grammar and varies strongly between regions, and few NLP resources exist for it. The authors built a project pipeline covering collection, annotation, feature extraction, modelling, evaluation and inference. They gathered posts and comments from Facebook, YouTube and Twitter spanning 2017–2023 and labelled them as hateful or non-hateful. The resulting corpus holds over 13.5K documents in Arabic script. On this data they compared several families of models: recurrent networks over a dialect-tuned FastText, DziriBERT adapted with PEFT and LoRA, fine-tuned multilingual sentence encoders, an AraT5v2-based classifier, and DzaraShield, an encoder-only model built on a Dzarabert base. DzaraShield performed best, with high precision and a good balance between precision and recall. The LSTM variants did worst. The work matters because it supplies a labelled resource and a broad model comparison for an under-served dialect. It also shows that dialect-aware pretraining outweighs architectural complexity when labelled data is scarce.

Key points

  • The corpus has more than 13.5K Algerian-dialect documents in Arabic characters, drawn from Facebook, YouTube and Twitter (2017–2023), with a binary hateful vs. non-hateful annotation.
  • The models compared were LSTM and BiLSTM with FastText-DZ (an Arabic FastText further tuned on Algerian text), DziriBERT with PEFT+LoRA, fine-tuned Multilingual-E5-base and sbert-distill-multilingual, AraT5v2-HateDetect, and DzaraShield.
  • DzaraShield was the top model. AraT5v2-HateDetect came slightly behind it, which the authors attribute to a harder fine-tuning problem with limited compute and data.
  • The LSTM/BiLSTM models were among the weakest, mainly because they misclassified the hate class, which gave them low precision.
  • Text written in Latin script (Arabizi) was left out. Handling it, along with enlarging the corpus and speeding up inference, is planned as future work.

Interesting ideas

  • I1. Testing many architectures on one corpus showed that a modest encoder pretrained on the right dialect beats larger, more complex models when labelled data is limited; this makes domain-matched pretraining the first lever to try.
  • I2. Parameter-efficient adaptation (PEFT with LoRA) of a dialect-specific encoder gives a strong classifier while keeping training cost low, which suits groups with small compute budgets.
  • I3. The paper points out that a single word can carry different meanings by region ('Flouka' means earrings or a small boat), and that one expression has many spellings (Inchallah, nchallah, n'shala). Reliable processing therefore needs explicit handling of spelling variants and of sense ambiguity.
  • I4. The authors read precision and recall per class rather than trusting one aggregate score, and treat a gap between the two as a sign of something specific in the data worth investigating.
  • I5. The background splits hate speech by its target: gendered, religious, racist, disability-related and political. This turns a vague label into a structured question about who is attacked and on what grounds.

For Mova

How these ideas could serve Mova, our small open language model — its files, stages and tests:

  • I1 (learn): Before scaling a model up, check whether pretraining or silver data closer to the target text genre gives larger gains, and record this as a controlled comparison.
  • I2 (tree): LoRA-style adapters on gparse could tailor the GPU parser to a new treebank or text genre without retraining the whole transformer.
  • I3 (tokens): Keep an explainable table that maps spelling variants to one lemma, kept separate from sense choice, so informal or noisy English spellings still reach the correct lemma.
  • I4 (learn): Evaluation reports could flag precision/recall imbalances per label or relation type as automatic triggers for error analysis and repair-rule induction.
  • I5 (frames): An "insult/attack" speech act in prag could carry a target role and a protected-attribute slot, so hostile utterances are explained as frames instead of being flagged by keywords.

Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.

Fields: Linguistics & languages

Topics Sentiment & emotion Semitic languages Bias, fairness & safety

Cite

Cite as Dihia Lanasri, Juan Olano, Sifal Klioui, Sin Liang Lee and Lamia Sekkai. 2023. Hate speech detection in algerian dialect using deep learning. arXiv:2309.11611.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.2309.11611 · arXiv 2309.11611

@misc{lanasri2023hate,
  title = {{Hate speech detection in algerian dialect using deep learning}},
  author = {Dihia Lanasri, Juan Olano, Sifal Klioui, Sin Liang Lee and Lamia Sekkai},
  year = {2023},
  doi = {10.48550/arxiv.2309.11611},
  eprint = {2309.11611},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2309.11611}
}

References

43 references, 11 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

  1. Sean MacAvaney, Hao-Ren Yao, Eugene Yang, Katina Russell, Nazli Goharian, and Ophir Frieder. Hate speech detection: Challenges and solutions. PloS one, 14(8):e0221152, 2019. find
  2. Mirela P Bogdani, Federico Faloppa, and Xheni Karaj. Beyond definitions. a call for action against hate speech in albania. a comprehensive study november 2021. 2021. find
  3. JT Nockleby. hate speech in encyclopedia of the american constitution. electronic journal of academic and special librarianship. 2000. find
  4. Imane Guellil, Ahsan Adeel, Faical Azouaou, Mohamed Boubred, Yousra Houichi, and Akram Abdelhaq Moumna. Ara-women-hate: An annotated corpus dedicated to hate speech detection against women in the arabic community. In Proceedings of the Workshop on Dataset Creation for Lower-Resourced Languages within the 13th Language Resources and Evaluation Conference, pages 68–75, 2022. find
  5. Thomas Davidson, Dana Warmsley, Michael Macy, and Ingmar Weber. Automated hate speech detection and the problem of offensive language. In Proceedings of the international AAAI conference on web and social media, volume 11, pages 512–515, 2017. our card
  6. Paula Fortuna and Sérgio Nunes. A survey on automatic detection of hate speech in text. ACM Computing Surveys (CSUR), 51(4):1–30, 2018. find
  7. Anna Schmidt and Michael Wiegand. A survey on hate speech detection using natural language processing. In Proceedings of the fifth international workshop on natural language processing for social media, pages 1–10, 2017. our card
  8. Delphine Battistelli, Cyril Bruneau, and Valentina Dragos. Building a formal model for hate detection in french corpora. Procedia Computer Science, 176:2358–2365, 2020. find
  9. Fatimah Alkomah and Xiaogang Ma. A literature review of textual hate speech detection methods and datasets. Information, 13(6):273, 2022. find
  10. Flor Miriam Plaza-del Arco, M Dolores Molina-González, L Alfonso Urena-López, and M Teresa Martín-Valdivia. Comparing pre-trained language models for spanish hate speech detection. Expert Systems with Applications, 166: 114120, 2021. find
  11. Nuha Albadi, Maram Kurdi, and Shivakant Mishra. Are they our brothers? analysis and detection of religious hate speech in the arabic twittersphere. In 2018 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining (ASONAM), pages 69–76. find
  12. Hala Mulki, Hatem Haddad, Chedi Bechikh Ali, and Halima Alshabani. L-hsab: A levantine twitter dataset for hate speech and abusive language. In Proceedings of the third workshop on abusive language online, pages 111–118, 2019. find
  13. Fréha Mezzoudj, Mourad Loukam, and Fatma Zohra Belkredim. Arabic algerian oranee dialectal language modelling oriented topic. International Journal of Informatics and Applied Mathematics, 2(2):1–14, 2019. find
  14. Oussama Boucherit and Kheireddine Abainia. Offensive language detection in under-resourced algerian dialectal arabic language. arXiv preprint arXiv:2203.10024, 2022. ↗ our card
  15. Djamila Menifi, Wiam Moussa, and Ahmed Cherif Mazari. Transfer Learning and Deep Learning for Multilingual Algerian Dialect Hate Speech Detection. PhD thesis, 2022. find
  16. Adel Abdelli, Fayçal Guerrouf, Okba Tibermacine, and Belkacem Abdelli. Sentiment analysis of arabic algerian dialect using a supervised method. In 2019 International Conference on Intelligent Systems and Advanced Computing Sciences (ISACS), pages 1–6. find
  17. Imane Guellil, Ahsan Adeel, Faical Azouaou, Mohamed Boubred, Yousra Houichi, and Akram Abdelhaq Moumna. Sexism detection: The first corpus in algerian dialect with a code-switching in arabic/french and english. arXiv preprint arXiv:2104.01443, 2021. ↗ our card
  18. Ona De Gibert, Naiara Perez, Aitor García-Pablos, and Montse Cuadros. Hate speech dataset from a white supremacy forum. arXiv preprint arXiv:1809.04444, 2018. ↗ our card
  19. Areej Al-Hassan and Hmood Al-Dossari. Detection of hate speech in social networks: a survey on multilingual corpus. In 6th international conference on computer science and information technology, volume 10, pages 10–5121, 2019. find
  20. Naaima Boudad, Rdouan Faizi, Rachid Oulad Haj Thami, and Raddouane Chiheb. Sentiment analysis in arabic: A review of the literature. Ain Shams Engineering Journal, 9(4):2479–2490, 2018. find
  21. Nizar Y Habash. Introduction to Arabic natural language processing. Springer Nature, 2022. find
  22. Abdul-Baquee M Sharaf and Eric Atwell. Qurana: Corpus of the quran annotated with pronominal anaphora. In Lrec, pages 130–137, 2012. find
  23. Kheireddine Abainia, Kenza Kara, and Tassadit Hamouni. A new corpus and lexicon for offensive tamazight language detection. In Proceedings of the 7th International Workshop on Social Media World Sensors, pages 1–6, 2022. find
  24. Ahmed Cherif Mazari and Hamza Kheddar. Deep learning-based analysis of algerian dialect dataset targeted hate speech, offensive language and cyberbullying. International Journal of Computing and Digital Systems, 2023. find
  25. Imane Guellil, Ahsan Adeel, Faical Azouaou, Sara Chennoufi, Hanene Maafi, and Thinhinane Hamitouche. Detecting hate speech against politicians in arabic community on social media. International Journal of Web Information Systems, 16(3):295–313, 2020. find
  26. Djamila Mohdeb, Meriem Laifa, Fayssal Zerargui, and Omar Benzaoui. Evaluating transfer learning approach for detecting arabic anti-refugee/migrant speech on social media. Aslib Journal of Information Management, 74(6): 1070–1088, 2022. find
  27. Reem ALBayari and Sherief Abdallah. Instagram-based benchmark dataset for cyberbullying detection in arabic text. Data, 7(7):83, 2022. find
  28. Monirah A Al-Ajlan and Mourad Ykhlef. Optimized twitter cyberbullying detection based on deep learning. In 2018 21st Saudi Computer Society National Computer Conference (NCC), pages 1–5. find
  29. Batoul Haidar, Maroun Chamoun, and Ahmed Serhrouchni. Arabic cyberbullying detection: Enhancing performance by using ensemble machine learning. In 2019 international conference on internet of things (ithings) and ieee green computing and communications (greencom) and ieee cyber, physical and social computing (cpscom) and ieee smart data (smartdata), pages 323–327. find
  30. Hamdy Mubarak, Kareem Darwish, and Walid Magdy. Abusive language detection on arabic social media. In Proceedings of the first workshop on abusive language online, pages 52–56, 2017. our card
  31. Azalden Alakrot, Liam Murray, and Nikola S Nikolov. Dataset construction for the detection of anti-social behaviour in online communication in arabic. Procedia Computer Science, 142:174–181, 2018. find
  32. Hatem Haddad, Hala Mulki, and Asma Oueslati. T-hsab: A tunisian hate speech and abusive dataset. In International conference on Arabic language processing, pages 251–263. Springer, 2019. find
  33. Hamdy Mubarak, Ammar Rashed, Kareem Darwish, Younes Samih, and Ahmed Abdelali. Arabic offensive language on twitter: Analysis and experiments. arXiv preprint arXiv:2004.02192, 2020. ↗ our card
  34. Hala Mulki and Bilal Ghanem. Let-mi: an arabic levantine twitter dataset for misogynistic language. arXiv preprint arXiv:2103.10195, 2021. ↗
  35. Rehab Duwairi, Amena Hayajneh, and Muhannad Quwaider. A deep learning framework for automatic detection of hate speech embedded in arabic tweets. Arabian Journal for Science and Engineering, 46:4001–4014, 2021. find
  36. Wassen Aldjanabi, Abdelghani Dahou, Mohammed AA Al-qaness, Mohamed Abd Elaziz, Ahmed Mohamed Helmi, and Robertas Damaševičius. Arabic offensive and hate speech detection using a cross-corpora multi-task learning model. In Informatics, volume 8, page 69. MDPI, 2021. find
  37. Batoul Haidar, Maroun Chamoun, and Ahmed Serhrouchni. A multilingual system for cyberbullying detection: Arabic content detection using machine learning. Advances in Science, Technology and Engineering Systems Journal, 2(6): 275–284, 2017. find
  38. Ahmed Abdelali, Kareem Darwish, Nadir Durrani, and Hamdy Mubarak. Farasa: A fast and furious segmenter for arabic. In Proceedings of the 2016 conference of the North American chapter of the association for computational linguistics: Demonstrations, pages 11–16, 2016. our card
  39. Amine Abdaoui, Mohamed Berrimi, Mourad Oussalah, and Abdelouahab Moussaoui. Dziribert: a pre-trained language model for the algerian dialect. arXiv preprint arXiv:2109.12346, 2021. ↗ our card
  40. Sourab Mangrulkar, Sylvain Gugger, Lysandre Debut, Younes Belkada, and Sayak Paul. Peft: State-of-the-art parameter-efficient fine-tuning methods. https://github.com/huggingface/peft, 2022. ↗
  41. Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models. arXiv preprint arXiv:2106.09685, 2021. ↗ our card
  42. Liang Wang, Nan Yang, Xiaolong Huang, Binxing Jiao, Linjun Yang, Daxin Jiang, Rangan Majumder, and Furu Wei. Text embeddings by weakly-supervised contrastive pre-training. arXiv preprint arXiv:2212.03533, 2022. ↗ our card
  43. E Moatez Billah Nagoudi, A Elmadany, and M Abdul-Mageed. Arat5: Text-to-text transformers for arabic language understanding and generation. arXiv preprint arXiv:2109.12068, 2021. ↗

↑ back to top

This page in Markdown → https://md.research.elamur.ai/free/en/papers/lanasri-2023-hate-speech-detection-algerian-dialect/