Arabic Offensive Language Detection Using Machine Learning and Ensemble Machine Learning Approaches
Summary
Husain studies whether ensemble learners classify offensive Arabic tweets better than single classifiers. Arabic social media text is hard to classify because it is informal, full of slang and emojis, and written in many dialects. The data comes from the OSACT shared task at LREC 2020. The official test labels were not yet released, so the author held out 20% of the training tweets as a development set and used the official development set as the test set. Preprocessing has four parts:
- every Unicode emoji is replaced by an Arabic description of it,
- hashtags are split into plain words,
- several Arabic letter variants are normalized,
- dialectal variants of selected nouns are mapped to Modern Standard Arabic.
Using word-level and character-level features, the study compares SVM, logistic regression and decision tree against bagging, AdaBoost and random forest. Bagging scores best with an F1 of 88%, about six points above the strongest single model. The author concludes that ensembles are a cheap and promising route for this task, even without deep learning or user-account metadata.
Key points
- Data: the OSACT 2020 (LREC 2020) offensive-language shared task on Arabic Twitter. Its sub-task A is offensive vs. not offensive, and sub-task B is hate speech vs. not. User mentions, URLs and line breaks were already masked by the organizers as
@USER,URLand<LF>. - Splits used: 5,468 training tweets, 1,367 development tweets (carved from the training set) and 1,000 test tweets (the official dev set). The classes are skewed toward not offensive.
- Emoji handling: the full Unicode.org list of 1,374 emojis was scraped with Beautifulsoup4. Their English names were machine-translated to Arabic with the
translatepackage. - Normalization:
- Alif forms are unified, and so are Alif Maqsura and Ta Marbouta.
- Characters repeated more than twice are reduced to two.
- Hashtags lose the
#, and underscores become spaces.
- Models: SVM, logistic regression and decision tree (single learners), and bagging, AdaBoost and random forest (ensembles). Bagging reaches 88% F1, roughly 6% above the best single learner.
Interesting ideas
- I1. Replace each emoji with a written description from the complete Unicode inventory, not a hand-picked subset, so coverage grows with the standard and the classifier sees ordinary words. — For Mova (tokens): the tokenizer could rewrite emojis as English descriptive tokens with lemmas and POS, so the tagger and parser treat them as real words instead of unknown symbols.
- I2. Cap runs of the same character at two, which merges expressive lengthenings into one form while still keeping legitimate double letters. — For Mova (tokens): applying this before lemma lookup would map "sooooo" or "nooo" to forms the morphology already knows, cutting out-of-vocabulary noise in informal English.
- I3. Turn hashtags into ordinary word sequences by dropping the marker and splitting on underscores, since hashtags often carry the key phrase of a post. — For Mova (tokens): splitting hashtags into separate tokens lets them get tags and attach in the dependency tree, instead of being one opaque blob.
- I4. Map dialectal variants of frequent nouns to one standard form through a small lexicon, so different spellings of one concept become a single feature. — For Mova (world): a variant-to-canonical lexicon (e.g. regional English words for the same thing) could link entity mentions to one ontology node, making referents consistent across dialects.
- I5. Bagging several copies of a simple learner beat every single model, which suggests that variance reduction pays off cheaply when data is small and noisy. — For Mova (learn): training several perceptron parsers on bootstrap resamples could supply extra witness parsers for silver-data agreement, with disagreement among them marking unreliable trees.
Cite
@misc{husain2020arabic,
title = {{Arabic Offensive Language Detection Using Machine Learning and Ensemble Machine Learning Approaches}},
author = {Husain, Fatemah},
year = {2020},
doi = {10.48550/arxiv.2005.08946},
eprint = {2005.08946},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2005.08946}
}References
- Abdelfatah, K., Terejanu, G., and and Alhelbawy, A. (2017). Unsupervised Detection of Violent Content In Arabic Social Media. Comput. Sci. Inf. Technol. (CS IT), pp. 1–7, 2017 find
- Abozinadah, E. , Mbaziira, A., and Jones, J. (2015). Detection of Abusive Accounts with Arabic Tweets. International Journal of Knowledge Engineering, Vol. 1, No. 2. DOI: 10.7763/IJKE.2015.V1.19 ↗
- Abozinadah, E. (2017). Detecting Abusive Arabic Language Twitter Accounts Using a Multidimensional Analysis Model. find
- Abozinadah, E., and Jones, J. (2017). A Statistical Learning Approach to Detect Abusive Twitter Accounts. Proceedings of the International Conference on Compute and Data Analysis, 130280, 6–13. https://doi.org/10.1145/3093241.3093281 ↗
- Alakrot, A., Murray, L., and Nikolov, N. S. (2018a). Dataset Construction for the Detection of Anti-Social Behaviour in Online Communication in Arabic. Procedia Computer Science, 142, 174–181. https://doi.org/https://doi.org/10.1016/j.procs.2018. 10.473 ↗
- Alakrot, A., Murray, L., and Nikolov, N. S. (2018b). Towards Accurate Detection of Offensive Language in Online Communication in Arabic. Procedia Computer Science, 142, 315–320. https://doi.org/https://doi.org/10.1016/j.procs.2018. 10.491 ↗
- Albadi, N., Kurdi, M., and Mishra, S. (2018). Are they Our Brothers? Analysis and Detection of Religious Hate Speech in the Arabic Twittersphere. 2018 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining (ASONAM), 69–76. https://doi.org/10.1109/ASONAM.2018.8508247 ↗
- Albadi, N., Kurdi, M., and Mishra, S. (2019b). Hateful People or Hateful Bots?: Detection and Characterization of Bots Spreading Religious Hatred in Arabic Social Media. Proceedings of the ACM on Human-Computer Interaction, 3(CSCW), 1–25. https://doi.org/10.1145/3359163 ↗ our card
- Alrefaie, M. (2016). Arabic-stop-words [Github Repository]. Retrieved on January 24, 2020 from https://github.com/mohataher/arabic-stop-words ↗
- Alshehri, A., Nagoudi, E.M., Alhuzali, H., and Abdul-Mageed, M. (2018). Think Before Your Click: Data and Models for Adult Content in Arabic Twitter. Davidson, T., Warmsley, D., Macy, M., and Weber, I. find
- (2017). Automated Hate Speech Detection and the Problem of Offensive Language. AAAI Publications, Eleventh International AAAI Conference on Web and Social Media About offensive content. arXiv.org. Retrieved from http://search.proquest.com/docview/2074118430/ ↗ our card
- Eisenstein, J. (2018) Natural Language Processing. MIT press. Retrieved from https://github.com/jacobeisenstein/gt-nlp-class/blob/master/notes/eisenstein-nlp-notes.pdf ↗
- Habash, N. (2010). Introduction to Arabic natural language processing (Vol. 3, pp. 1–185). find
- Haidar, B., Chamoun, M., and Serhrouchni, A. (2017). Multilingual cyberbullying detection system: Detecting cyberbullying in Arabic content. 2017 1st Cyber Security in Networking Conference (CSNet), 2017-, 1–8. https://doi.org/10.1109/CSNET.2017.8242005 ↗
- Haidar, B., Chamoun, M., and Serhrouchni, A. (2018). Arabic Cyberbullying Detection: Using Deep Learning. 2018 7th International Conference on Computer and Communication Engineering (ICCCE), 284–289. https://doi.org/10.1109/ICCCE.2018.8539303 ↗
- Haidar, B., Chamoun, M., and Serhrouchni, A. (2019). Arabic Cyberbullying Detection: Enhancing Performance by Using Ensemble Machine Learning. 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), 323–327. https://doi.org/10.1109/iThings/GreenCom/CPSCo m/SmartData.2019.00074 ↗
- Johnston, A., and Weiss, G. (2017). Identifying sunni extremist propaganda with deep learning. 2017 IEEE Symposium Series on Computational Intelligence (SSCI), 2018-, 1–6. https://doi.org/10.1109/SSCI.2017.8280944 ↗
- Kaati, L., Omer, E., Prucha, N., and Shrestha, A. (2015). Detecting Multipliers of Jihadism on Twitter. 2015 IEEE International Conference on Data Mining Workshop (ICDMW), 954–960. https://doi.org/10.1109/ICDMW.2015.9 ↗
- Mohaouchane, H., Mourhir, A., and Nikolov, N. S. (2019). Detecting Offensive Language on Arabic Social Media using Deep Learning, (December). https://doi.org/10.1109/SNAMS.2019.8931839 ↗
- Mubarak, H., Darwish, K., and Magdy, W. (2017). Abusive Language Detection on Arabic Social Media. Proceedings of the First Workshop on Abusive Language Online. Association for Computational Linguistics (ACL), 2017. pp. 52–56. find our card
- Nadali, S., Murad, M., Sharef, N., Mustapha, A. and Shojaee, S. (2013). A review of cyberbullying detection: An overview. 13th International Conference on Intellient Systems Design and Applications, Bangi, pp. 325-330. find
This page in Markdown → https://md.research.elamur.ai/free/en/papers/husain-2020-arabic-offensive-language-detection-using/