# Detecting Hateful and Offensive Speech in Arabic Social Media Using Transfer Learning
## 2 Related Works  
Having a proper definition of hateful and offensive speech has always caused controversy since these definitions tend to have religious, cultural, or ethnical backgrounds. The United Nations [5] defined hate speech as any expression that attacks a person on a group based on any of their identity factors, would it be ethnic, religious, racial, etc. As stated earlier, hateful and offensive speech has grown significantly on social media in the last couple of years, especially in the aftermath of the COVID-19 lockdown. With the rise of Artificial Intelligence (AI) methods and their great performance in many fields [6; 7; 8; 9; 10], several researchers from around the globe have also presented several AI-based solutions to automate the detection of hateful and offensive speech in their online communities. Whereas English is backed by most of the mature solutions, other top languages such as French and Spanish have also presented interesting approaches. [PERSON] and [PERSON] [11] have built and annotated a dataset of 2856 French tweets where 927 were labeled as \"racist\" whereas the rest was \"not racist\". They applied TF-IDF, N-gram, and BERT sentence embedding for text representation, then went on to compare different binary classification models such as \"Random Forest\" (RF), \"Logistic Regression\" (LR), and \"Extreme Gradient Boosting\" (XGBoost). The best performance for that dataset was provided by LR when it was backed by BERT word embedding, with 79% accuracy. Following similar steps, [PERSON] et al. [12] have built a dataset of 10855 Spanish tweets where 2773 were labeled as \"hateful\" and the rest as \"non-hateful\". They used this dataset to train machine learning and deep learning models able to detect gender and sex orientation based hateful online statements. They used \"Bag of Words\" (BoW) as a text representation for the machine learning algorithms, and word embedding for the RNN deep learning model. The latter combination provided the best performance with 84% accuracy, exceeding by far the second best, which was BoW with LR (76%). Another attempt to detect hate speech in Spanish social media was presented by [PERSON] et al. [13] who selected tweets from two different datasets. From the first dataset, they selected 6000 tweets and labeled 1567 of them as \"hateful\", and the remaining 4433 as \"not hateful\". From the second dataset, they collected 6600 tweets and labeled 2739 of them as \"hateful\", and the remaining 3861 as \"not hateful\". When comparing the performances of different pre-trained models, BETO, a monolingual transformer model based focused on the Spanish language, outperformed BERT and XLM. The literature also presents tentative hate speech detection models in other languages such as Urdu [14], Turkish [15], or Chinese [16]. Another interesting approach that several researchers suggested is to propose multilingual hate speech detection models. [PERSON] et al. [17] combined two datasets. The first one, in English, contains tweets with hateful content against women and immigrants, whereas the second one, in both English and French, contains sexist tweets. The combined dataset contains a total of 16,156 tweets, of which, 6171 were labeled as \"hate\", and the remaining 9985 were labeled as \"non-hate\". They used FastText [18] and GloVe [19] for multilingual embedding as backing for the Bidirectional Long-Short Term Memory (BiLSTM) algorithm. The best performance was provided by the combination FastText-BiLSTM with a 79% accuracy. [PERSON] et al. [20] combined three datasets of tweets. The first one, in English, contains 16,000 tweets, from which, 5006 were labeled as \"positive\" for racism and sexism, whereas the remaining 10,884 tweets were labeled as \"negative\". The second dataset, in Italian, contains 4000 tweets, from which, 1296 were labeled as \"hateful\", whereas the remaining 2704 were labeled as \"not hateful\".