---
title: "Arabic Offensive Language Detection with Attention-based Deep"
description: "For subtask B they create synthetic hate tweets by shuffling word order. 0.91 precision. 21 references, cited by 6 papers here."
authors: ["Bushr Haddad", "Zoher Orabe", "Anas Al-Abood", "Nada Ghneim"]
year: 2020
venue: "Proceedings of the 4th Workshop on Open-Source Arabic Corpora and Processing Tools, with a Shared Task on Offensive Language Detection"
source: "https://aclanthology.org/2020.osact-1.12/"
licence: "CC BY-NC 4.0 (ELRA, LREC proceedings)"
licence_url: "https://creativecommons.org/licenses/by-nc/4.0/"
summary_licence: "Elamur Cosmic License"
canonical: "https://research.elamur.ai/free/en/papers/haddad-2020-arabic-offensive-language-detection-attention/"
---
[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/haddad-2020-arabic-offensive-language-detection-attention/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2020](https://md.research.elamur.ai/free/en/papers/2020/page/7/) / Arabic Offensive Language Detection with Attention-based Deep Neural Networks

# Arabic Offensive Language Detection with Attention-based Deep Neural Networks

**Authors:** [Bushr Haddad](https://md.research.elamur.ai/free/en/authors/bushr-haddad/), [Zoher Orabe](https://md.research.elamur.ai/free/en/authors/zoher-orabe/), [Anas Al-Abood](https://md.research.elamur.ai/free/en/authors/anas-al-abood/) and [Nada Ghneim](https://md.research.elamur.ai/free/en/authors/nada-ghneim/) · **Year:** 2020 · **Venue:** [Proceedings of the 4th Workshop on Open-Source Arabic Corpora and Processing Tools, with a Shared Task on Offensive Language Detection](https://md.research.elamur.ai/free/en/venues/osact/) ([Workshop on Open-Source Arabic Corpora and Processing Tools with Shared Tasks 2020](https://md.research.elamur.ai/free/en/venues/osact/2020/)) · **Publisher:** [European Language Resources Association (ELRA)](https://md.research.elamur.ai/free/en/publishers/european-language-resources-association-elra/) · **Licence:** [CC BY-NC 4.0 (ELRA, LREC proceedings)](https://creativecommons.org/licenses/by-nc/4.0/)

**Links:** [Publisher's page](https://aclanthology.org/2020.osact-1.12/) · [PDF](https://aclanthology.org/2020.osact-1.12.pdf) · [OpenAlex](https://openalex.org/W3087984428)

**Citations:** 21 citations (OpenAlex, 2026-10-14) · [6](https://md.research.elamur.ai/free/en/papers/haddad-2020-arabic-offensive-language-detection-attention/cited-by/) in our library, of the 149,439 papers whose bibliographies we read

## Summary
This paper is a system description for the OSACT4 shared task on Arabic tweets. The task has two binary subtasks: spotting offensive language (subtask A) and spotting hate speech (subtask B). The 10,000-tweet dataset is heavily skewed. About 19% of tweets are offensive and only 5% are hateful, and every hateful tweet also counts as offensive. The authors clean the noisy dialectal text by stripping non-Arabic material, diacritics, punctuation and emoticons, unifying letter variants and collapsing stretched characters. They then rebalance the classes. For subtask A they borrow labelled YouTube comments from an existing Arabic corpus. For subtask B they create synthetic hate tweets by shuffling word order. Words are represented with AraVec skipGram vectors trained on Twitter. They compare a CNN and a Bi-GRU, each with and without an attention layer, plus several classic machine-learning baselines. The attention-augmented Bi-GRU (Bi-GRU_ATT) performs best, reaching a test F1 of about 0.85 on subtask A and 0.75 on subtask B. Validation and test scores are close. The work shows a workable recipe for noisy, imbalanced, dialect-heavy social media classification.

## Key points
- The data is the OSACT4 / OffensEval 2020 Arabic set: 10,000 tweets split 70/10/20 into train, validation and test, labelled OFF/NOT_OFF and HS/NOT_HS.
- Balancing changed the training counts in both subtasks:
  - Subtask A went from 1,330 offensive / 5,670 clean to 7,184 / 8,705, using YouTube comments from Alakrot et al. (2018).
  - Subtask B went from 361 hate / 6,639 non-hate to 7,486 / 6,639, using word-shuffle oversampling.
- External hate datasets were not used for subtask B for three reasons: they are too small, they cover only one type of hate (e.g. religious), or they cover only one dialect (Tunisian T-HSAB, Levantine L-HSAB).
- The embeddings are AraVec Twitter skipGram vectors, chosen because they match the tweet register and cover many dialect words.
- Bi-GRU_ATT test results:
  - Subtask A: accuracy 0.91, precision 0.88, recall 0.83, F1 0.85.
  - Subtask B: accuracy 0.95, precision 0.75, recall 0.74, F1 0.75.
- The authors credit attention mainly with raising precision.

## Interesting ideas
- To fill a rare class, the authors added data from another platform whose language is close to the target domain, instead of only reweighting the loss. This keeps the extra examples natural rather than synthetic.
- Minority examples were created by permuting the words of existing hateful tweets, which treats meaning as independent of order. A useful side effect is that such shuffled text makes a ready-made contrast set.
- Before vector lookup, letter variants are unified and stretched characters (laughter, emphatic vowels) are collapsed. This sharply reduces vocabulary sparsity in informal text.
- The authors explicitly measured how many dataset tokens are covered by the pretrained embedding vocabulary. This is a cheap diagnostic of how well a resource fits a domain.
- The task separates offensive from hateful language by the target of the attack: individuals versus groups such as a gender, religion or country. Hate is treated as a strict subset of offence.

## For Mova

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

- **I1** (learn): When silver data for a rare construction is thin, it could be drawn from a register-matched corpus, with the source tagged so evaluation can check whether it helped or hurt.
- **I2** (learn): Word-shuffled sentences could serve as a negative control: if a frame or answer stage scores them as well as the originals, it is secretly acting like a bag of words.
- **I3** (tokens): The English tokenizer could map elongations like "soooo" or "nooo" to a canonical lemma while keeping the original surface and an emphasis feature, so the step stays explainable.
- **I4** (tokens): A coverage report of the lexicon and morphology against each new text genre would show early where lemmas or tags will fall back to guesses.
- **I5** (frames): An insult speech-act frame could carry a target-type role (person vs group), letting pragmatics separate a plain insult from group-directed hostility in an explainable way.

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

## Institutions

- [Arab International University](https://md.research.elamur.ai/free/en/universities/arab-international-university/) — University, Ghabāghib, Syria · 13 works · 46 citations

📚 Shelves (4): [🖥️ Computer Science](https://md.research.elamur.ai/free/en/shelves/computer-science/) · 16,667 works · [🤖 Artificial Intelligence](https://md.research.elamur.ai/free/en/shelves/computer-science/artificial-intelligence/) · 16,194 works · [🤝 Social Sciences](https://md.research.elamur.ai/free/en/shelves/social-sciences/) · 1,772 works · [🤝 Communication](https://md.research.elamur.ai/free/en/shelves/social-sciences/communication/) · 97 works

🧭 Topics (2): [😊 Sentiment & emotion](https://md.research.elamur.ai/free/en/topics/sentiment-emotion/) · 972 works · [Semitic languages](https://md.research.elamur.ai/free/en/topics/semitic-languages/) · 2,908 works

## Cite

Cite as: Bushr Haddad, Zoher Orabe, Anas Al-Abood and Nada Ghneim. 2020. Arabic Offensive Language Detection with Attention-based Deep Neural Networks. Proceedings of the 4th Workshop on Open-Source Arabic Corpora and Processing Tools, with a Shared Task on Offensive Language Detection.

The paper itself, not this page. BibTeX from the library's record of the work.

```bibtex
@inproceedings{haddad2020arabic,
  title = {{Arabic Offensive Language Detection with Attention-based Deep Neural Networks}},
  author = {Bushr Haddad, Zoher Orabe, Anas Al-Abood and Nada Ghneim},
  booktitle = {Proceedings of the 4th Workshop on Open-Source Arabic Corpora and Processing Tools, with a Shared Task on Offensive Language Detection},
  year = {2020},
  doi = {10.5281/zenodo.19687050},
  url = {https://doi.org/10.5281/zenodo.19687050}
}
```

- [← previous A Large-Scale Leveled Readability Lexicon for Standard Arabic](https://md.research.elamur.ai/free/en/papers/khalil-2020-large-scale-leveled-readability-lexicon/)
- [next → Augmenting Data for Sarcasm Detection with Unlabeled Conversation Context](https://md.research.elamur.ai/free/en/papers/lee-2020-augmenting-data-sarcasm-detection-unlabeled/)
- [↑ back to papers of 2020](https://md.research.elamur.ai/free/en/papers/2020/page/7/)

## References

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

1. Alakrot, A., Murray, L., & Nikolov, N. S. (2018). Dataset construction for the detection of anti-social behaviour in online communication in Arabic. Procedia Computer Science, 142, 174-181. [find](https://scholar.google.com/scholar?q=Alakrot%2C+A%2E%2C+Murray%2C+L%2E%2C+%26+Nikolov%2C+N%2E+S%2E+%282018%29%2E+Dataset+construction+for+the+detection+of+anti%2Dsocial+behaviour+in+online+communication+in+Arabic%2E+Procedia+Computer+Science%2C+142%2C+174%2D181%2E)
2. Alakrot, A., Murray, L., & Nikolov, N. S. (2018). Towards accurate detection of offensive language in online communication in arabic. Procedia computer science, 142, 315-320. [find](https://scholar.google.com/scholar?q=Alakrot%2C+A%2E%2C+Murray%2C+L%2E%2C+%26+Nikolov%2C+N%2E+S%2E+%282018%29%2E+Towards+accurate+detection+of+offensive+language+in+online+communication+in+arabic%2E+Procedia+computer+science%2C+142%2C+315%2D320%2E)
3. Albadi, N., Kurdi, M., & Mishra, S. (2018, August). 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) (pp. 69-76). IEEE. [find](https://scholar.google.com/scholar?q=Albadi%2C+N%2E%2C+Kurdi%2C+M%2E%2C+%26+Mishra%2C+S%2E+%282018%2C+August%29%2E+Are+they+our+brothers%3F+Analysis+and+detection+of+religious+hate+speech+in+the+Arabic+Twittersphere%2E+In+2018+IEEE%2FACM+International+Conference+on+Adv)
4. Al-Hassan, A., & Al-Dossari, H. (2019). Detection of hate speech in social networks: a survey on multilingual corpus. In 6th International Conference on Computer Science and Information Technology. [find](https://scholar.google.com/scholar?q=Al%2DHassan%2C+A%2E%2C+%26+Al%2DDossari%2C+H%2E+%282019%29%2E+Detection+of+hate+speech+in+social+networks%3A+a+survey+on+multilingual+corpus%2E+In+6th+International+Conference+on+Computer+Science+and+Information+Technology%2E)
5. Badjatiya, P., Gupta, S., Gupta, M., & Varma, V. (2017, April). Deep learning for hate speech detection in tweets. In Proceedings of the 26th International Conference on World Wide Web Companion (pp. 759-760). [find](https://scholar.google.com/scholar?q=Badjatiya%2C+P%2E%2C+Gupta%2C+S%2E%2C+Gupta%2C+M%2E%2C+%26+Varma%2C+V%2E+%282017%2C+April%29%2E+Deep+learning+for+hate+speech+detection+in+tweets%2E+In+Proceedings+of+the+26th+International+Conference+on+World+Wide+Web+Companion+%28pp%2E+)
6. Bahdanau, D., Cho, K., & Bengio, Y. (2014). [Neural machine translation by jointly learning to align and translate](https://md.research.elamur.ai/free/en/papers/bahdanau-2014-neural-machine-translation-jointly-learning/). arXiv preprint arXiv:1409.0473. [↗](https://arxiv.org/abs/1409.0473)
7. Cambray, A., & Podsadowski, N. (2019). Bidirectional Recurrent Models for Offensive Tweet Classification. arXiv preprint arXiv:1903.08808. [↗](https://arxiv.org/abs/1903.08808)
8. Cui, Y., Jia, M., Lin, T. Y., Song, Y., & Belongie, S. (2019). Class-balanced loss based on effective number of samples. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (pp. 9268-9277). [find](https://scholar.google.com/scholar?q=Cui%2C+Y%2E%2C+Jia%2C+M%2E%2C+Lin%2C+T%2E+Y%2E%2C+Song%2C+Y%2E%2C+%26+Belongie%2C+S%2E+%282019%29%2E+Class%2Dbalanced+loss+based+on+effective+number+of+samples%2E+In+Proceedings+of+the+IEEE+Conference+on+Computer+Vision+and+Pattern+Recognitio)
9. Gambäck, B., & Sikdar, U. K. (2017, August). [Using convolutional neural networks to classify hate-speech](https://md.research.elamur.ai/free/en/papers/gamback-2017-convolutional-neural-networks-classify-hate/). In Proceedings of the first workshop on abusive language online (pp. 85-90).
10. Golub, D., & He, X. (2016). Character-level question answering with attention. arXiv preprint arXiv:1604.00727. [↗](https://arxiv.org/abs/1604.00727)
11. Haddad, H., Mulki, H., & Oueslati, A. (2019, October). T-HSAB: A Tunisian Hate Speech and Abusive Dataset. In International Conference on Arabic Language Processing (pp. 251-263). Springer, Cham. [find](https://scholar.google.com/scholar?q=Haddad%2C+H%2E%2C+Mulki%2C+H%2E%2C+%26+Oueslati%2C+A%2E+%282019%2C+October%29%2E+T%2DHSAB%3A+A+Tunisian+Hate+Speech+and+Abusive+Dataset%2E+In+International+Conference+on+Arabic+Language+Processing+%28pp%2E+251%2D263%29%2E+Springer%2C+Cham%2E)
12. Kim, Y. (2014). [Convolutional neural networks for sentence classification](https://md.research.elamur.ai/free/en/papers/kim-2014-convolutional-neural-networks-sentence-classification/). arXiv preprint arXiv:1408.5882. [↗](https://arxiv.org/abs/1408.5882)
13. Mohaouchane, H., Mourhir, A., & Nikolov, N. S. (2019, October). Detecting Offensive Language on Arabic Social Media Using Deep Learning. In 2019 Sixth International Conference on Social Networks Analysis, Management and Security (SNAMS) (pp. 466-471). IEEE. [find](https://scholar.google.com/scholar?q=Mohaouchane%2C+H%2E%2C+Mourhir%2C+A%2E%2C+%26+Nikolov%2C+N%2E+S%2E+%282019%2C+October%29%2E+Detecting+Offensive+Language+on+Arabic+Social+Media+Using+Deep+Learning%2E+In+2019+Sixth+International+Conference+on+Social+Networks+Analy)
14. Mubarak, H., Darwish, K., & Magdy, W. (2017, August). [Abusive language detection on Arabic social media](https://md.research.elamur.ai/free/en/papers/mubarak-2017-abusive-language-detection-arabic-social/). In Proceedings of the First Workshop on Abusive Language Online (pp. 52-56).
15. Mubarak, H., Darwish, K., Magdy, W., Elsayed, T., & Al-Khalifa, H. (2020). [Overview of OSACT4 Arabic Offensive Language Detection Shared Task](https://md.research.elamur.ai/free/en/papers/mubarak-2020-overview-osact4-arabic-offensive-language/). Proceedings of the 4th Workshop on Open-Source Arabic Corpora and Processing Tools (OSACT), 4.
16. Mulki, H., Haddad, H., Ali, C. B., & Alshabani, H. (2019, August). [L-HSAB: A Levantine Twitter Dataset for Hate Speech and Abusive Language](https://md.research.elamur.ai/free/en/papers/mulki-2019-l-hsab-levantine-twitter-dataset/). In Proceedings of the Third Workshop on Abusive Language Online (pp. 111-118).
17. Salem, F. (2017). Social media and the internet of things towards data-driven policymaking in the Arab world: potential, limits and concerns. The Arab Social Media Report, Dubai: MBR School of Government, 7. [find](https://scholar.google.com/scholar?q=Salem%2C+F%2E+%282017%29%2E+Social+media+and+the+internet+of+things+towards+data%2Ddriven+policymaking+in+the+Arab+world%3A+potential%2C+limits+and+concerns%2E+The+Arab+Social+Media+Report%2C+Dubai%3A+MBR+School+of+Governm)
18. Soliman, A. B., Eissa, K., & El-Beltagy, S. R. (2017). Aravec: A set of arabic word embedding models for use in arabic nlp. Procedia Computer Science, 117, 256-265. [find](https://scholar.google.com/scholar?q=Soliman%2C+A%2E+B%2E%2C+Eissa%2C+K%2E%2C+%26+El%2DBeltagy%2C+S%2E+R%2E+%282017%29%2E+Aravec%3A+A+set+of+arabic+word+embedding+models+for+use+in+arabic+nlp%2E+Procedia+Computer+Science%2C+117%2C+256%2D265%2E)
19. Xu, K., Ba, J., Kiros, R., Cho, K., Courville, A., Salakhudinov, R., ... & Bengio, Y. (2015, June). [Show, attend and tell: Neural image caption generation with visual attention](https://md.research.elamur.ai/free/en/papers/xu-2015-show-attend-tell-neural-image/). In International conference on machine learning (pp. 2048-2057). [↗](https://doi.org/10.48550/arxiv.1502.03044)
20. Zhang, Q., Gong, Y., Wu, J., Huang, H., & Huang, X. (2016, October). Retweet prediction with attention-based deep neural network. In Proceedings of the 25th ACM international on conference on information and knowledge management (pp. 75-84). [find](https://scholar.google.com/scholar?q=Zhang%2C+Q%2E%2C+Gong%2C+Y%2E%2C+Wu%2C+J%2E%2C+Huang%2C+H%2E%2C+%26+Huang%2C+X%2E+%282016%2C+October%29%2E+Retweet+prediction+with+attention%2Dbased+deep+neural+network%2E+In+Proceedings+of+the+25th+ACM+international+on+conference+on+informat)
21. Zhang, Z., & Luo, L. (2019). Hate speech detection: A solved problem? The challenging case of long tail on twitter. Semantic Web, 10(5), 925-945. [find](https://scholar.google.com/scholar?q=Zhang%2C+Z%2E%2C+%26+Luo%2C+L%2E+%282019%29%2E+Hate+speech+detection%3A+A+solved+problem%3F+The+challenging+case+of+long+tail+on+twitter%2E+Semantic+Web%2C+10%285%29%2C+925%2D945%2E)

*Updated 1 November 2026*
