{'fraction_non_alphanumeric': 0.03239298488519672, 'fraction_numerical': 0.01321103034498673, 'mean_word_length': 4.992826274848746, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The design, construction and evaluation of annotated Arabic cyberbullying corpus

Cyberbullying (CB) is classified as one of the severe misconducts on social media. Many CB detection systems have been developed for many natural languages to face this phenomenon. However, Arabic is one of the under-resourced languages suffering from the lack of quality datasets in many computational research areas. This paper discusses the design, construction, and evaluation of a multi-dialect, annotated Arabic Cyberbullying Corpus (ArCybC), a valuable resource for Arabic CB detection and motivation for future research directions in Arabic Natural Language Processing (NLP). The study describes the phases of ArCybC compilation. By way of illustration, it explores the corpus to discover strategies used in rendering Arabic CB tweets pulled from four Twitter groups, including gaming, sports, news, and celebrities. Based on thorough analysis, we discovered that these groups were the most susceptible to harassment and cyberbullying. The collected tweets were filtered based on a compiled harassment lexicon, which contains a list of multi-dialectical profane words in Arabic compiled from four categories: sexual, racial, physical appearance, and intelligence. To annotate ArCybC, we asked five annotators to classify 4,505 tweets into two classes manually: Offensive/non-Offensive and CB/non-CB. We conducted a rigorous comparison of different machine learning approaches applied on ArCybC to detect Arabic CB using two language models: bag-of-words (BoW) and word embedding. The experiments showed that Support Vector Machine (SVM) with word embedding achieved an accuracy rate of 86.3% and an F1-score rate of 85%. The main challenges encountered during the ArCybC construction were the scarcity of freely available Arabic CB texts and the deficiency of annotating the texts.


Introduction
Bullying, also referred to as face-to-face bullying, was defined as an aggressive behavior done by an individual or a group of individuals with the intent to harm someone who cannot defend himself (Olweus, 1993). This definition entails three characteristics of bullying: 1) Intention, where the bully intends to harm the victim. 2) Repetition, where the bullying behavior is repeated.
3) Power imbalance between the bully and the victim, where the bully is more potent than the victim.
Cyberbullying (CB) initially followed the definition of (Olweus, 1993). Later, with the rise of the internet and social media, CB was defined as an electronic form of bullying that uses an electronic medium, computers, smartphones, or something similar (Hugo, 2009;Slonje & Smith, 2008). For instance, (Slonje & Smith, 2008) defined CB as "An aggressive, intentional act carried out by an individual or a group of individuals, using electronic forms of contact, repeatedly and overtime against a victim who cannot easily defend him or herself." Hugo (2009), defined CB as "willful and repeated harm inflicted through the use of computers, cell phones, and other electronic devices." A recent review study conducted by Khairy et al. (2021) defined CB as "any aggressive intentional behavior carried out by individuals or groups of individuals via social media that repeatedly communicates hostile or offensive messages intended to cause harm or discomfort to others." Dooley, Pyzalski, and Cross (2009) suggested that power imbalance and repetition of CB could be in different forms and problem-dependent. For instance, repetition is not due to the number of times the CB occurs, but it is due to the persistence of harm and the feeling of fear for the victim (Lane, 1989). The incident could be related to a message posted online, mainly if it contains embarrassing content such as pictures or videos of the victim that keeps appearing for a long time. However, not all forms of CB have the same harmful impact. For instance, even if it appears only once, a threatening message might be considered dangerous or even more than repeated irony messages (Chia et al., 2021). Fauman (2008) argued that the anonymity feature of the online messages and the victim's inability to hide might give him a feeling of powerlessness. While other researchers argued that CB could cause more psychosocial and emotional damage than traditional bullying due to the increased volume, scale, scope, number of witnesses, and unstoppable spread (Englander et al., 2017;Van Hee et al., 2018).
Many studies, such as the work of (Rosa et al., 2019;Peled, 2019;Balakrishnan, Khan, and Arabnia, 2020), found that CB hurts victims' mental health and psychological status. They reported that victims might develop depression, low selfconfidence, loneliness, social anxiety, anger, sleeping and eating disorders, and in extreme cases, self-injury or committing suicide. Academic functioning may also be affected negatively, where victims may decline academic performance and struggles (Nixon, 2014).
After this brief introduction, it can be noticed that CB has become a severe worldwide public dilemma among school children, adolescents, and even older people. The study of (Haidar et al., 2017) reported that about 50% of America's youth suffered from cyberbullying, while in the Arab world, 20.9% of middle school teens reported bullying in the United Arab Emirates (UAE), 33.6% in Lebanon,31.9% in Morocco,39.1% in Oman,and 44.2% in Jordan. Consequently, a plethora of studies and researches have been thoroughly conducted to tackle the phenomenon of CB in many countries and communities. Among a few to mention are Indonesia (Safaria, 2016), Hindi and Marathi (Pawar & Raje, 2019), Spanish (Leon-Paredes et al., 2019), Turkey (Gul et al., 2019), and China (Lu et al., 2020).
Cyberbullying focus groups discussion plays a significant role in raising awareness about CB and supporting the national efforts to reduce the impacts of CB on the life of school students. For instance, ten focus groups of 66 low-educated Dutch adolescents discussed the Dutch CB Victims' experiences, perceptions, and attitudes (Jacobs et al., 2015). Another eight focus groups of parent/guardians from England have 41 participants who studied the awareness and thoughts of CB among primary school students. They examined the emergence of CB, characteristics of cyber bullies and cyber victims, the impact of CB, and the role of adult supervision.
In addition to raising awareness about CB, one of the main recommendations of the CB focus groups discussion is to increase the collaboration between parents/ guardians, school staff, and teachers to protect children from being cyberbullied and to learn how to deal with CB situations. This could be achieved through practical training on using the internet and other technologies to effectively monitor how their children use the internet and set rules to restrict their access to the internet. Another recommendation is to encourage children to talk to their parents, teachers, or close people and seek help when they experience cyberbullying (Monks et al., 2016).
Although CB reporting is as vital as CB detection, adolescents' perceptions are essential to know what is perceived as CB. However, most CB victims usually hide being cyberbullied from their parents and other close persons either because they do not want to bother them, feel embarrassed or worry about losing their internet privileges. Social media platforms such as Facebook and Twitter are keen to provide safe online environments for users to share thoughts and post comments. This is usually possible by following guidelines to report cyberbullying actions, such as writing inappropriate behaviors and blocking bully users. Although these steps are essential, they typically occur after the target user becomes a victim and before writing the bullying case. However, it might be too late for the platform administration to avoid spreading the bullying content. Consequently, instant and efficient automated systems to detect cyberbullying behaviors are in great demand. Most of the CB detection systems have been designed for English and other languages (Leon-Paredes et al., 2019;Pawar & Raje, 2019), and there is a lack of systems for the Arabic language.
Although the Arabic language ranks fifth in the world in terms of speakers, with more than 420 million speakers (Khairy et al., 2021), research in Arabic NLP suffers from the lack of many NLP tools and high-quality datasets in many computational research areas in general, and in Arabic CB in particular. Modern Standard Arabic (MSA) is usually used in formal writing. On the other hand, informal spoken Arabic language, referred to as colloquial Arabic or dialects, is used for daily communication and differs among Arab countries. Nowadays, this has become the language of social media and many online forums (Al-Twairesh et al., 2017).
However, the mentioned reasons posed many challenges to advancing the research in Arabic CB, and adapting solutions from other languages into Arabic is not straightforward (Pasha et al., 2014). Therefore, this study is ongoing research to remedy the above problems and fill some of the research gaps in Arabic CB. The following research questions will be addressed throughout this study: RQ1: Is there a comprehensive benchmarking dataset for Arabic that could be used for CB detection? RQ2: What are the most common CB topics spreading among the Arab virtual com munities on the Internet? RQ3: What is the best approach to represent the words and sentences that capture the semantic of Arabic CB? RQ4: What should be incorporated in a methodology to effectively detect CB on a social media platform such as Twitter?
Therefore, the main objective of this research is to complement the existing research on Arabic CB detection in general and to design and construct an annotated Arabic CB corpus, in particular, by addressing two aspects. First, to have a clear understanding of Arabic CB on social media platforms, such as Twitter, through investigating various user accounts from different domains that are most vulnerable to CB. Second, to design and construct an annotated CB dataset, named ArCybC, will be made freely available to researchers to motivate research in Arabic CB detection and other future NLP tasks. In this regard, we propose a corpus construction model that was evaluated with five annotators' help. In addition, we aim to explore the recently introduced NLP approaches that utilize the new advances in language models, such as word embedding, to build an effective CB detection system for the Arabic language. We achieve these objectives through the following contributions: C1: Clarifying and understanding the differences among CB, hate speech, offensive language, and profanity C2: Designing and constructing a free multi-dialect (Egyptian, Gulf, and Levantine) annotated Arabic CB corpus that will be useful for CB detection tasks and motivate other future Arabic NLP tasks. C3: Evaluating different state-of-the-art classification approaches using various language models applied on the designed corpus for automatic CB detection.
After this brief introduction, the rest of the paper is organized as follows: Sect. 2 gives a brief background about cyberbullying and furnishes the previous work in literature for building various harassment and CB datasets and the attempts to detect the offensive language in the Arab community. Section 3 presents the methodology adopted to construct the ArCybC corpus and extract CB from Arabic tweets. In Sect. 4, we conducted the experiments and analyzed their results. Section 5 discusses the results, and finally, the conclusion and the future work are presented in Sect. 6.

Background and literature review
Cyberbullying has many forms that vary in severity of impact on the victim and the purpose of the aggression. Kumar and Sachdeva (2019, categorized CB into eight types: flaming, direct and indirect harassment, denigration, impersonation, outing, trickery, and exclusion. Flaming and direct harassment are considered natural CB, while the others are indirect CB, as shown in Fig. 1. Flaming occurs when people fight through online forums or social media platforms. Direct harassment occurs when the victim is threatened or insulted by others, such as receiving email or SMS directly. Meanwhile, indirect harassment occurs indirectly and might include many parties. Denigration is about spreading rumors about victims to spoil their reputations. An example of this type is posting skewed content about the victim on the internet to turn down their reputation. Impersonation is about pretending to be another person, using various hacking methods, or creating fake profiles. Usually, it is followed by perpetrating anti-social activities to embarrass the cyber victim or ruin their reputation. The outing is about sharing t, such as their photos or videos, without permission to harm the victim. Trickery occurs when the bully gets sensitive information about a person by faking the victim's trust and violating this trust. An example of this type is deceiving the victim to obtain sensitive information such as a personal video then posting it online. Finally, the exclusion is about keeping out the cyber victim from online communities or groups. An example of exclusion is to exclude someone intentionally from a WhatsApp group. Bullying and CB involve many actors, and each one has a different role. Researchers identified several positions in the world of CB (Van Hee et al., 2018). The two leading parts involve victims and bullies. A third sub-role is a bystander, who either supports the victim, the bully, or ignores the bullying action (Van Hee et al., 2018).
Social, educational, and psychological studies of bullying and CB have a prolonged history Eden et al., 2016;Peled, 2019;Abaido, 2020;Cevik, Rıdvan & Cevik, 2021). They raised a severe national health issue among children and adolescents. However, the shortcoming of these studies was due to the scarcity of data and the selection of the appropriate methods for collecting the data. The principal methodology adopted in these studies was distributing a questionnaire to a limited study sample that could reach hundreds of participants in its best cases. However, this approach is time-consuming, cumbersome, and lacks inclusivity. In addition, the produced datasets might fail to estimate the actual frequency of bullying over the population and hence might not assess all the cases of CB in society.

Cyberbullying and related concepts
In the Introduction section, we discussed the definition of CB from different perspectives found in the literature. However, to better understand this complex phenomenon, we discuss the meaning of CB in the presence of other related concepts, such as hate speech (HS) (Fortuna & Nunes, 2018) offensive language (Chen et al., 2012;Fortuna & Nunes, 2018), and profanity. Table 1 shows the differences among these concepts.
The main difference between HS and CB is that the former is more general, and it targets a large group of people rather than individuals (Fortuna & Nunes, 2018). At the same time, a standard connection between the two concepts is the frequent use of offensive and profane words or phrases. However, we cannot rely on profanities features to detect HS or CB context. This is mainly because offensive language can Table 1 Cyberbullying and related concepts

Concept
What is it about?
How does it differ from CB?
Hate speech The language that attacks or diminishes others incites violence or hatred against groups based on specific characteristics such as physical appearance, religion, descent, national or ethnic origin, sexual orientation, sexual identity, etc. It might appear in different linguistic forms, even when using humor (Fortuna & Nunes, 2018) CB is more specified and intended specific person or group Offensive or abusive language Using insulting, derogatory, or hurtful language makes the recipient feel offended. It may include hate speech and profanity (Chen et al., 2012;Fortuna & Nunes, 2018) CB may be caused by offensive messages posted on social media, but not necessarily Profanity Using harmful or obscene words or phrases CB may use profanity, but not necessarily be used in other contexts, including informal communication in non-hostile scenarios (Malmasi & Zampieri, 2018;Zhang & Luo, 2019). Moreover, (Waseem et al., 2017) developed a typology of abusive language to present the similarities and differences between abusive language detection subtasks, such as hate speech, CB, and trolling. Their topology relied on two main factors; Directed\Generalized, and Explicit\Implicit. The first factor indicated whether the language is directed towards a specific individual, entity, or generalized group, such as sexual orientations or ethnic groups. At the same time, the second factor checked if the abusive context is explicit or implicit. CB instances were considered as directed abuse targeting individuals and online communities based on this topology, while examples of hate speech were directed and generalized.

Literature review
The primary purpose of this section is to provide a context and a general guide for what is already known about CB in general and CB in the Arab world in particular. The main focus here is to demonstrate our understanding of the CB problem, addressing and filling the gap of missing resources in this field of study for a low resource language, Arabic. Although we didn't adhere to particular research strategies, which are usually followed in systematic reviews such as the Preferred Reporting Items for Systematic Reviews and Meta-Analyses (PRISMA) (Wang et al., 2019), we benefited from PRISMA. We tried to limit the selection bias following a formal literature review. The inclusion and exclusion selection criteria were based on the research questions, our familiarity with the topic, a list of search keywords, and publication years. Unlike systematic reviews, which are more rigorous and specific about the explicit inclusion and exclusion of evidence, the scope of our study is general and broad. To identify the related documents, we used EzLibrary, 1 the electronic library cite of the University of Jordan, which provides access to Scopus, Springer, Taylor & Francis, SAGE journals, and the digital libraries of ACM and IEEE Xplore. Next, we applied the following methodology for the inclusion criteria.
1) The included studies must have been written in the English language.
2) The studies must have constructed or used CB, HS, or offensive language datasets.
3) The studies must be experimental, related to social media and ML models for CB, HS, or offensive language. 4) The studies must have been published in the last five years.
We organized the selected articles into two subsections to tie the literature to the study's primary purpose. The first includes studies related to Arabic harassment corpora and detection systems, while the second section contains harassment corpora and detection systems for other languages. We conclude this section by comparing the different technical solutions applied to detect Arabic CB and the need for an Arabic CB dataset.

Arabic harassment corpora and detection systems
Recently, NLP has been broadly employed for building cyber hate speech and cyber offensive datasets. Most of the previous studies in the Arabic context focused on detecting CB. Hence, there was a lack of standard benchmark datasets to evaluate and compare the performance of these efforts. This section briefly reviews the most relevant studies on constructing Arabic datasets for abusive content and hate speech. In addition, we discuss the previous studies on detecting various forms of cyber harassment and cyber offensive in the Arabic context. Abozinadah, Mbaziira & Jones (2015) presented an Arabic corpus for abusive accounts on Twitter. They used five Arabic swearing words as seeds to collect the data, and they picked 500 accounts and classified them as abusive/non-abusive based on the last 50 tweets. Naive Bayes (NB), SVM, and Decision Tree (J48) classification models were used to classify the tweets. The results showed that the NB classifier outperformed the other classifiers with an accuracy rate of 90%. Mubarak, Darwish & Magdy (2017) created a list of offensive Arabic words extracted from 1100 tweets.
The work of (Haidar et al., 2017) was among the first attempts to detect CB in the Arab virtual communities. They collected tweets from Lebanon, Syria, Egypt, and the Gulf region. The corpus has 35,273 Arabic samples. Each tweet was labeled manually with "yes" when it contained CB and with a "no" label, otherwise. The dataset contained only 2196 CB entries out of the 35,273 entries. The NB and SVM ML models were trained on the Arabic dataset, and because the dataset was highly imbalanced, the results of detecting Arabic CB were not satisfactory. In a second attempt, (Haidar et al., 2018) applied deep learning methods, specifically a Feed Forward Neural Network (FNN), on the same dataset to build an Arabic CB detection system. The best validation accuracy achieved in this study was 94.56%, and the test accuracy was 92.53%. Recently, (Haidar et al., 2019) enhanced their CB detection model by collecting data only from Twitter. The dataset contained 2999 bullying instances and 31,891 non-bullying ones, and they used word embedding to represent the words' vectors. The best-achieved results were 93.3%, 93.5%, 92% for precision, recall, and F1-score. However, the recall score for the positive class (i.e., the bully class) was 28.2%, which is considered relatively low. Alakrot et al. (2018) described a corpus of offensive content collected from the YouTube platform. They selected 150 videos about Arab celebrities from different channels and over 150,000 comments on those videos. Next, they extracted 14 attributes from the collected data. Three annotators from other Arab countries helped with labeling the comments of nine videos only, which limited the study to be generalized to the whole collection.
AlHarbi et al. (2019) proposed an automatic CB detection system using rulebased and lexicon approaches by developing a cyberbullying lexicon based on the PMI, Chi-square, and Entropy approaches. They collected their corpus from Twitter, Microsoft-Flow, and YouTube. Three people annotated the corpus into "bully"/ "non-bully." The results showed that the PMI approach achieved better results than the other approaches, with an accuracy rate of 81%. Mouheb, Albarghash, et al. (2019) collected an Arabic dataset from two different platforms, YouTube and Twitter. Their corpus consisted of 25,000 comments manually labeled as "bullying"/ "non-bullying." They applied the NB classifier to detect CB, where the obtained accuracy rate was 95.9%. Moreover, (Mouheb, Abushamleh, et al., 2019) offered a real-time CB detection system in Arabic Twitter Streams that filters tweets based on a list of offensive words commonly used in Arab communities. Their system read the tweets in real-time, applied preprocessing and cleaning to each tweet, then detected abusive posts and ranked them according to their strength by assigning weights to each bullying post. Based on the rank of the bullying post, the system suggested a set of actions such as deleting the tweet, sending a warning notification, or sending messages to the victim's parents. Mulki et al. (2019) produced a benchmark dataset named Levantine Hate Speech and Abusive (L-HSAB) Twitter dataset. The content of the dataset mainly focused on political issues. It has 5846 tweets annotated by three Levantine native speakers into three different categories: 3650 normal, 1728 abusive, and 468 hate.
Another effort to detect HS is described in (Aljarah et al., 2020). They collected data from Twitter based on different keywords, which targeted other areas such as sports, religion, racism, and journalism. The dataset has 3696 tweets, and each tweet was annotated and categorized by two annotators into hate and non-hate. Next, they applied different machine learning algorithms to detect HS, such as SVM, NB, DT, and RF.
The shared task of the fourth workshop on Open-Source Arabic Corpora and Corpora Processing Tools (OSACT) in Language Resources and Evaluation Conference (LREC-2020) introduced two competitive tasks . Subtask "A" was created to detect the offensive language in Arabic speech. At the same time, Subtask "B" was designed to detect hate speech. For testing, they provided a Twitter dataset that contained 10,000 manually labeled tweets about offensive and hate-speech language. The annotators assumed that offensive tweets had explicit or implicit abuses or attacks against the victim. At the same time, hate speech tweets contained insults or threats against a group of people based on their nationalities, religions, colors, ethnicity, genders, political or sports affiliations.
The previous efforts focused only on a single platform to collect hostile content for building their datasets. However, the work of  was the first to introduce a multi-platform offensive language dataset named MPOLD to include dialectal Arabic news comments collected from three different social media platforms: Twitter, Facebook, and YouTube. The authors followed a two-step annotation mechanism: manual human annotation and crowdsourcing using Amazon Mechanical Turk. MPOLD has 4000 instances, and it is available online with the annotation guidelines, which have been followed during the labeling task. Table 2 summarizes the attempts to tackle the Arabic CB detection and the alike problems such as harassment and offensive language detection. The datasets and the solutions provided by     Table 3 summarizes a few attempts to construct harassment datasets (i.e., CB, abusive language, and HS) for languages other than Arabic. Reynolds, Kontostathis & Edwards (2011) collected a dataset from Formspring.me, a question/answering (QA) website prone to CB. A list of 296 swears words were identified and assigned a severity level. Then the words were used as seeds to extract posts containing bullying content. The extracted data was labeled by a team from Amazon's Mechanical Turk web service into "yes" if the post comprises CB and "no" otherwise. The dataset has 2696 posts for training and 1219 posts for testing.

Harassment datasets for other languages
The Formspring dataset (Reynolds et al., 2011) became a benchmark for researchers to study CB. Ptaszynski et al. (2018) re-annotated the dataset using multiple stages of manual annotation performed by expert annotators to enhance the quality of the labeling process. Later, (Eronen et al., 2021) used the re-annotated dataset version of (Ptaszynski et al., 2018) to study the effect of Feature Density using various feature preprocessing methods to estimate dataset complexity and, in consequence, to evaluate the performance of machine learning classifiers before starting to train the models. Chia et al. (2021) conducted a study to show the practical applicability of sarcasm and irony detection in other NLP tasks, such as CB. They built an ML model trained on a dataset dedicated for sarcastic detection and tested it on the re-annotated version of the Formspring CB dataset using the same settings. They obtained results close to the models trained and tested on a purely CB-related dataset, proving the prevalence of sarcasm and irony in CB.
Sui (2015) developed a dataset collected via Twitter streaming API using seed terms to search for tweets containing bullying content. A set of 7321 tweets were randomly sampled from the collected tweets and manually labeled by five experienced annotators.
Wulczyn, Thain & Dixon (2017) provided a methodology for generating large-scale data about personal attacks using abusive language in online discussions. They applied this methodology to the English Wikipedia to build a corpus of over 100,000 comments. They used crowdsourcing to label each comment according to whether or not it was a personal attack. Lu et al. (2020) provided a new Chinese dataset dedicated to CB detection. The dataset was collected from Sina Weibo comments. They mainly picked out the weibos for celebrities who have bad reputations. The dataset has more than 19 k comments, manually labeled by three annotators. Only 5067 comments were labeled as bullying. In addition, they proposed a Char-CNNS (Character-level Convolutional Neural Network with Shortcuts) model to find whether the text contains CB. Finally, several studies contributed to providing a benchmark HS dataset. For instance, (Waseem & Hovy, 2016) constructed an HS dataset from the Twitter social media platform. Whereas ) aggregated a hate speech corpus from various available datasets collected from multiple platforms: YouTube, Reddit, Wikipedia, and Twitter. Table 4 depicts the computational methods used for detecting CB for the Arabic language. Various ML and deep learning models have been used in literature to detect CB for Arabic. For each of the reported studies, we presented the used model, its accuracy (A), precision (P), recall (R), and the F1-score (F).  Despite the intensity of recent studies on CB detection for the Arabic language, the biggest challenge is the lack of publicly available benchmark datasets to validate newly developed methods or implemented software to detect CB. Recent work shows that researchers collected and built their CB datasets from various social media platforms and manually analyzed them to extract bullying cases. Another avenue is following other tedious approaches, such as distributing a questionnaire. Victims and offenders self-reported their perceptions and then manually analyzed the results of bullying cases, like the works described in (Abaido, 2020;Peled, 2019). Although these efforts ended up with numerous Arabic datasets, most were either proprietary or experimental. Hence, most studies made their conclusions based on either small or low-quality datasets, and therefore, they were not capable of providing convincing results.

Comparisons of CB computational approaches for the Arabic language
To fill this gap, we developed a properly annotated and human-verified Arabic Cyberbullying Corpus (ArCybC) culled from twitter texts, in which posts were multi-dialectal Arabic. This is the first work covering varieties of Arabic CB sources collected from different Twitter accounts from various domains to the best of our knowledge. It can be helpful to educators, researchers, and language engineers. Most important, ArCybC is publicly available free of charge. Figure 2 depicts the flow diagram of the five-phase methodology we followed to develop and evaluate the Arabic CB corpus. They include: (1) Corpus design and construction, (2) Data preprocessing and cleansing, (3) Feature engineering, (4) Building ML models, and (5) Performance evaluation. The first two phases were dedicated to data collection, preprocessing, and cleansing. The last three phases were used for text representation, building, and evaluating the prediction models. The following subsections describe the five phases in more detail.

Corpus design and construction
Designing and constructing ArCybC from different Twitter topics is considered the first contribution of this study. Up to our knowledge, this is the first attempt to build a publicly available CB dataset for the Arabic language. The main objective of this corpus is to construct a multi-dialect repository of harassment content for the Arabic language to be used as a benchmark for researchers to study various aspects of abusive language in social media, such as offensive content, CB, and hate speech. Figure 3 shows the step-by-step model we followed to construct the ArCybC corpus. The following subsections discuss these phases in more detail.

Data collection phase
Nowadays, the best sources of CB content are social media platforms. Twitter is one of the widely used platforms in the Arab world. Accordingly, we used the Twitter streaming API to collect different Twitter accounts. We focused on four distinct domains: gaming, sports, news, and celebrities. The rationale behind this decision was based on a thorough analysis of the most frequent accounts attracting people from different slices of the Arab community. For instance, young adolescents spend many hours playing games, watching tournaments, and posting their comments. Statistics from the CB Research Center 2 show that gamers are much more likely to be both victims and perpetrators of CB. Figure 4 shows the results of a survey of 1,500 respondents, 12-17 years of age, conducted by the center and represents the CB offending of different types of games. News accounts on social media are also considered a rich environment for spreading abuse and bullying, as there are various forms of racism, sectarianism, and fanaticism. All news accounts were selected from international news agencies' social media accounts, such as Al-Arabiya, CNN-Arabic, and Gulf News.
Accounts of celebrities usually attract people who like to comment on rumors and frequently use swearwords in their comments. We have chosen the accounts of celebrities from a list of the top 100 Arab celebrities from the Forbes Middle East Magazine. 3 Table 5 shows the selected accounts for each of the four categories.
To verify that the tweets were collected from Arab countries with different dialects, we set the language of tweets to be Arabic and the user accounts to be from particular Arab regions. For example, we chose celebrities from Egypt, Gulf, and the Levant regions and Arabic news and sports accounts, such as Al-Arabiya, CNN-Arabic, and Gulf News.
The Twitter platform allows to collect up to 3000 tweets from each account. We sampled tweets from the timeline of 15 users for each domain, where tweets were written in different dialects (Egyptian, Gulf, and Levantine). In total, we collected 178,839 tweets.
Next, we extracted the top 50 hashtags most frequently used in posting comments for each domain. We utilized the list of hashtags as seed terms for collecting tweets from Twitter from September 2017-to September 2020.
Although we sampled tweets from the timeline of users from different domains, we noticed that some particular topics were more dominant than others. For example, when the data was extracted, "2020 Beirut explosion" and "COVID-19 pandemic" were among the trending topics. The tendency of being biased towards trending topics while collecting data from the Twitter stream is a known problem facing the process of data collection (Wiegand, Ruppenhofer & Kleinbauer, 2019). To avoid this biasness while constructing ArCybC, we added other hashtags from the extracted ones with varied topics that may not target abusive language or CB.

Fig. 3 Construction methodology of ArCybC
Under the condition of having at least one hashtag in a tweet, we collected a total of 511,686 tweets. Table 6 shows a sample of the selected hashtags from each domain.

Data filtering phase: Normalization and compilation of the lexicon of offensive words
It is widespread in data collection to get a lower percentage of positive instances (i.e., instances containing CB or harassment) than negative ones. Even with the help of crowd workers to perform manual annotation for a large corpus, the process is expensive, cumbersome, yet time-consuming. The main aim of our study is to detect the harassment content and increase the percentage of positive instances in the dataset. At the same time, we aimed to overcome the problem of the highly imbalanced dataset, where the ratio of the positive instances (minority) is way smaller than the negative (majority) ones. Consequently, we had to expand ArCybC to include harassment content as possible.
We compiled a lexicon of offensive words to accomplish this task and reach the target goals, which usually appear in humiliating comments. Then we used this lexicon to filter out the collected tweets. In this phase, we followed the steps of (Rezvan et al., 2018) to create ArCybC. In their work, they created a lexicon of offensive words collected from five different categories of harassment content, including: sexual, racial, physical appearance, intellectual, and political. Then they used these words as seeds to collect the tweets. However, we found out that some words can fit into more than one category for the Arabic language. Therefore, we opted to limit the number of categories of Arabic harassment lexicon to only four groups as follows: 1) Sexual group: Contains negative comments about sexual teasing and usually targets females. 2) Racial group: Contains hostile comments that attack the race characteristics, such as color, country, and religion. 3) Physical appearance group: Contains negative comments about the traits or features describing the victim's body, such as the look, the hairstyle, or obesity. 4) Intelligent group: Contains comments targeting the victim's intellectual power and mental capabilities. Gaming Accounts @saudigamer @GemansionCom @iiTinyFox @UbisoftME @toyswithwings @Xbox Saudi @Gamer Snack @GgameEfactsX @ExtravaGaming @PlayStationSA @nal3b @EA ME @PainkillerQ8 @VGA4A @m5aoi Sports Accounts @AlArabiya spt @ariyadhiah @ReNgo Sport @SkyNewsArabia S @OnSideAr @beINSPORTS @beINSPORTS news @Cityarabia @kooora @realmadridarab @fifacom ar @ManUtd @Arsenal @FCBarcelona @PSG inside News Accounts @arabnews @gulf news @khaleejtimes @TheNationalUAE @AlArabiya @cnnarabic @BBCArabic @ArabNetME @akhbar0 @TRTArabi @Arabi21News @alaraby ar @RassdNewsN @aa Arabic @News Brk24 Celebrities Accounts @Ahlam Alshamsi @mustafa agha @farisf9 @OlaAlfares @7sainaljassmi @amrdiab @NancyAjram @elissakh @najwakaram @BalqeesFathi @LojainOmrann @Neshan @sherine @AssalaOfficial @myriamfares Table 6 Samples of extracted hashtags The Arabic harassment lexicon required analyzing the content obtained from various online resources and translating a few words appropriate for the Arabic language obtained from (Rezvan et al., 2018) lexicon. Swear words were collected from Arab countries, including Egypt, Gulf, and the Levant regions.
To expand ArCybC and detect dangerous speech in social media, we selected a few words from the list compiled by (Alshehri, Nagoudi & Abdul-Mageed, 2020). The list contains verbs from Arab dialects, frequently used for threatening and physical harm. As a further step to enrich our lexicon, some orthographic forms of each word have been extracted from the MSA lexicon of (Boudelaa & Marslen-Wilson, 2010). Our final lexicon contained 320 profane words of different Arabic dialects. Table 7 depicts statistics and samples of the offensive words for each category.
For text normalization, we removed retweets to avoid repeated evaluation of posts. Then, we removed the uniform resource locator (URL) address. To preserve privacy and not disclose the users' names, we replaced the actual names with @USERNAME.
After using the compiled profane lexicon, the closure of this step was a filtration and classification of the collected tweets into four categories: sexual, racial, intellectual, and physical appearance. Out of the 511,686 tweets, we ended up with 4,505 tweets that were potentially subject to hold harassment content. However, the collected tweets in ArCybC did not guarantee that they contained offensive language. For instance, although the word " " ("slave/servant" in English) is one of the most frequent words in racist tweets, it appears in entirely harmless tweets, mainly it is used frequently in Arabs' proper names, such as " " " (servant of Allah, servant of the Merciful (Allah)). Also, the word " " ("shape"), which is used frequently in physical appearance bullying, is used in the context of describing the shapes of many objects. The richness of the Arabic language in homophones and alliteration yields to extract a considerable amount of non-offensive tweets.

Data formalization phase: Annotation, validation and splitting of ArCybC
It can be argued that sometimes tweets with offensive content might not be directly intended for harassment . However, they might be quotes or written for other purposes. Therefore, relying on filtering the tweets based on the lexicon as discussed in the previous phase might not be sufficient. Accordingly, human interference was needed to label offensive and non-offensive CB tweets accurately. This subsection discusses data annotation, validation, and splitting tasks. In the annotation task, we discuss the labeling method adopted in this study and the labeling rules. While in the validation task, we examine the correctness of the data labels.

a) Dataset annotation
Previous related studies applied different methods for labeling and compiling datasets, as shown in Tables 2 and 3. In this study, we followed the most frequently used annotation strategy described in the literature (Ibrohim & Budi, 2018;Rezvan et al., 2018). We asked a judgment group of five Arabic native speakers to label the tweets manually. The annotators were between 21-35 years old. Four annotators were undergraduate students majoring in information technology, and one was a graduate student pursuing a master's degree in business management.
Two labeling tasks were assigned to the annotators: In the first one, the annotators were asked to label each tweet as CB or non-CB. Three values were used to label this class. A "yes" value if the tweet contained CB/harassment content. A "no" value, if the tweet did not have any type of predefined CB, and an "unknown" value, if the tweet was ambiguous and the annotator could not decide on its label. In the second task, they were asked to label a tweet as Offensive or non-Offensive. Similarly, a "yes" value was given if the tweet contained offensive words explicit or implicit hostile intention. Otherwise, a "no" and an "unknown" value if the annotator was unsure about the exact label. The annotators were directed to annotate without discrimination against persons because of their gender, national origin, political orientation, or religious belief.
To facilitate the annotation process during the two labeling tasks, we identified a set of rules, partially adapted from Lu" value et al. (2020) and Chowdhury et al. (2020). For example, we asked the annotators to label a tweet as CB if it implicitly or explicitly meets one or more of the following rules: 1) It contains racial swear attacking an individual or specific entity and criticizing their political orientation, religious beliefs, or race. 2) It contains sexist slurs or profane words that attack an individual or a specific entity.
3) It invokes someone or a family member using an undesired or insulting nickname, such as animal analogy or name-calling 4) It contains negative or insulting comments on someone's physical appearance, intelligence, or attacking their disabilities. 5) It calls violence towards or incitement to minorities. In the second labeling task, we directed the annotators to follow the annotation guideline and the examples described in , publicly available on GitHub. 4

b) Dataset validation
To validate the accuracy of the annotation process, we followed the method described in the introductory tutorial of (Goncalves et al., 2020). The technique is a responsive web platform used to evaluate potential annotators and ensure they correctly understand how to assign the labels. We developed a software testing tool using the Java programming language for this task. Each annotator was asked to watch a tutorial about the scope and aims of this research. Next, each annotator has been asked to read a few examples of previously annotated tweets, as shown in Fig. 5.
The annotators were provided with a set of 10 tweets, presented one after another, and they were asked to assign the correct label for each presented tweet from a group of five labels, as shown in Fig. 6. The labeling process was to give labels as follows: Fig. 5 The software annotation tool: step-1, the preparation guideline Fig. 6 The annotation tool: step-2, the evaluation test 1) OFF\CB if the tweet has both offensive and CB content 2) Non-OFF\CB, if the tweet contained CB without using offensive words 3) OFF\non-CB if the tweet has offensive but not CB content 4) Non-OFF\non-CB if the tweet has neither offensive nor CB content 5) Unknown if the annotator was unsure about the exact label.
After the annotators completed the evaluation test, the scores were collected. A score of 8 (out of 10) and above was required to consider the annotator as a trustworthy annotator. As a result, two annotators successfully labeled all the tweets correctly and scored a full mark. At the same time, the third and fourth candidates could correctly label eight tweets. Unfortunately, one of the annotators scored less than 8, and he was excluded from the annotation task.
We utilized consensus voting for labeling each tweet. In this case, more than half of the annotators must agree on each tweet. Tweets annotated as "unknown" by the majority votes were excluded from the test. To measure the agreement rate among the annotators and evaluate the accuracy of the entire annotation process, we applied Cohen's kappa coefficient given by Eq. 1 (McHugh, 2012).
Pr(a) represents the observed agreement, and Pr(e) represents the chance agreement. Table 8 shows the inter-annotator agreements (IAA) calculated between each pair of annotators using the kappa score.
It was not possible to have all the four annotators' agreement on a label for a particular tweet in many cases. Therefore, we opted to exclude the annotator who had the lowest inter-annotator agreement with the other annotators. In this essence, we excluded the fourth annotator, A4. Finally, the average agreement among the three annotators was 64%. This explains how difficult it was to precisely define the offensive terms in a multi-dialectal Arabic context compared to other languages such as English.

iii) Dataset splitting
We split the ArCybC corpus into two datasets; 80% for training and 20% for testing. Out of the (3604) tweets in the training dataset, 1519 tweets (42.1%) were labeled as offensive, whereas 1391 (38.6%) were labeled as CB. While for the testing dataset, out of the 901 tweets, 368 tweets (40.8%) were labeled as  Figure 7 shows the distribution of the classes in the ArCybC corpus. Table 9 shows the distribution of the minor classes (i.e., offensive and CB). A comparison between ArCybC and the other CB datasets showed the superiority of ArCybC in terms of the distribution of its classes. This ensures the diversity of offensive contents of the ArCybC dataset. The previous studies applied various approaches to handle the problem of an imbalanced dataset. The two main methods include data-driven and algorithmic driven (Thabtah et al., 2020). Data-driven approaches apply sampling techniques to balance the classes' ratio. They include oversampling the minority (abnormal) class, undersampling the majority (normal) class, or combining both. On the other hand, algorithmic-driven approaches apply no changes to the input data distribution. Instead, the classification algorithm is modified to adjust the learning task, in which each class is assigned a weight, which will be adjusted once the classifier misclassifies a test sample. For instance, Al-Garadi et al. (2016) used both approaches to overcome the imbalanced dataset problem. The OSACT2020 dataset, which is highly imbalanced, applied the data oversampling method to handle this problem (Haddad, Orabe, Al-Abood & Ghneim, 2020;Husain, 2020).

A sample from the ArCybC corpus
We have noticed an overlapping in labeling two classes; the Offensive class and the CB class. In most cases, a tweet that has been classified as CB was also considered offensive. Figure 8 shows that more than one-third of the tweets labeled as CB was also labeled as Offensive. Meanwhile, only 1.8% of the tweets labeled as CB were not offensive. A sample from the corpus is provided in the Appendix Table 14. Table 9 Datasets of cyberbullying/other related concepts and the ratio of their minor class (i.e., positive class)

Statistical and exploratory data analysis
We have to make sure that the corpus is well represented before experimenting with ArCybC and putting it into practice under ML algorithms and NLP applications. The best tool for data representation is through graphs or charts. Exploratory Data Analysis (EDA) gives more profound insight into data before making assumptions. It can help analyze data, expose hidden structures, spot anomalies, and test hypotheses using statistics and graphical representations (Indrakumari et al., 2020).
We have used two of Python's most potent visualization libraries; Seaborn and Matplotlib. The Seaborn library was built on top of Matplotlib. These two libraries provide an attractive statistical graph to perform both Univariate and Multivariate analysis. Figure 9 shows the distribution of text-based on the domain of each category. We noticed that the most offensive tweets were in the "Racial" category and specifically in the News domain.
Moreover, Figs. 10 and 11 represent the distribution of text length to the type of category and domain, respectively. Although the distribution of text length is  Distribution of text length per each domain of tweets different per category, the difference is not too significant; hence we won't experience problems in the features selection phase. Figures 12 and 13 show the word cloud for ArCybC.

Data preprocessing and cleansing
We applied the following two basic text preprocessing and cleansing steps to ensure that the ArCybC corpus was ready for feature selection and building ML models.
1) Remove digits, punctuation marks, stop words, non-Arabic words, repeated characters, and diacritics (i.e., short vowels and characters above and beneath letters, such as fatha, damma, kasra, etc.) 2) The normalization of Arabic characters such as changing the letter to , to , and [ ] to .
Furthermore, few normalizations and preprocessing steps, mentioned in the pre-trained word embedding model (AraVec3.0), were also borrowed into our experiments (Soliman et al., 2017).

Feature engineering and text representation
Text representation is an essential step for any text classification task. In this process, the text is transformed into a vector feature representation. ML algorithms use these vectors to build their classification models. Accordingly, the performance of an ML classifier is undoubtedly affected by the text representation scheme (Sabbah et al., 2017).
The most common features used in literature for building cyberbullying detection classifiers included (1) Profile-based features (PBF), such as the user's writing style and past conversation history, to predict the user who publishes offensive content, such as age, gender, and race. (2) Text-based features (TBF), which incorporates lexical features to represent the offensive content, such as keywords, profanity, pronouns, n-grams, BoW, TF-IDF, document length, and spelling. And (3) Social-graph features (SGF), such as the number of friends, followers, likes, and uploads. Since our proposed dataset does not consider social and user features, we only focus on features extracted from the textual context and semantics.
VSM is the most commonly used text representation model. It is a matrix representing a document as a vector of weighted features. To illustrate how it works, let N be a unique set of features and M a set of documents in the collection. Then the VSM is represented as a matrix of NM dimension, where the weight of each feature reflects its importance in the document collection. Many weighting schemes calculate the terms' weights and build the feature vectors. These schemes are categorized into count-based approaches and predictive approaches. Count-based methods calculate co-occurrence statistics between words. Then they map these statistics into a dense vector for each word. On the other hand, predictive techniques attempt to predict a word from its neighbors (Soliman et al., 2017).
TF-IDF is the most commonly used count-based approach. It was adapted from the domain of Information Retrieval (IR). TF-IDF is a statistical unsupervised term weighting method used to evaluate the importance of a word for a document in a collection or the whole corpus. The main assumption of TF-IDF is that the significance of a word increases proportionally with the number of times it appears in the document (Sabbah et al., 2017).
Word embedding is an example of a predictive approach for representing texts. It converts words in a numeric form understandable for machines or deep learning algorithms. Word embedding predicts a word from its neighbors by training a neural language model. It allows words with similar meanings to have an equal representation. Word embedding techniques are considered improvements to BoW and TF-IDF models that produce large and sparse vectors (mostly 0 values). They usually represent the documents but not the meaning of the words (Mikolov, Chen, Corrado & Dean, 2013).
Word2Vec is one of the popular techniques used for efficiently learning a standalone word embedding from a text corpus. Its main objective function causes the words that occur in a similar context to have similar embedding. Word2Vec has two approaches for generating vectors from the words, as depicted in Fig. 14. The first approach is based on continuous BoW, which predicts the target word from the context. The second approach applied a skip-gram model, which predicts the context words (surrounding words) from the target word (center word) (Mikolov et al., 2013).
Our experiments applied two main feature extraction and text representation techniques, TF-IDF and word embedding. We used the AraVec 3.0 model for word embedding, adapted for Arabic text, and introduced by Soliman et al. (2017). The Arabic model has three versions, which provide various word embedding models built on two different Arabic content domains, Twitter and Wikipedia Arabic articles. The last version of AraVec 3.0 consists of 16 different models divided into unigram and n-gram models.
We experimented with the AraVec 3.0 n-gram model, the TwitterSkipGram, and Gensim combined with the Python NLP libraries, spaCy, and NLTK. The model was trained on 66,900,000 Arabic tweets. It has 1,476,715 vocabularies and 300 dimensions.  (Mikolov et al., 2013)

The ML models
To position our work, we show the viability and appropriateness of the compiled ArCybC for building ML models that can help detect CB instances efficiently and accurately. Five different ML techniques have been used with the text representation methods discussed in the previous subsection to build systems that can predict CB text. The implemented algorithms were: SVM, RF, XGBoost, DT, and LR algorithms. Following is a brief description of each algorithm.
The SVM algorithm is a supervised machine learning algorithm. It transforms the data into higher-dimensional spaces to better recognize the classes. It integrates a kernel function to map the dataset into the higher spaces (Boser, Guyon & Vapnik, 1992).
The RF algorithm collects decision trees, which rely on classification rules to classify the data. Each decision tree in the RF corresponds to a different subset of features selected from the training samples by replacement. A significant advantage of the novel structure of the RF algorithm is the avoidance of overfitting (Safavian & Landgrebe, 1991).
XGBoost is a scalable decision-tree-based ensemble ML algorithm that uses a gradient boosting framework. It provides satisfactory results in many ML competitions. In addition to being scalable, XGBoost has other advantages that distinguish it from different classifiers. A few to mention include its ability to deal with missing values, handling sparse data, and utilizing parallel and distributed processing, making it faster than many other algorithms because it uses multiple CPU cores to execute the model (Chen & Guestrin, 2016).
The DT algorithm breaks down a dataset into smaller subsets to build classification or regression models in a tree structure. This structure consists of decision nodes and leaf nodes. A decision node has two or more branches, while a leaf node represents a classification or decision.
Finally, the RF algorithm, also called the sigmoid function, was initially developed by statisticians. It is an ML classification algorithm used to predict the probability of a target variable. It assigns observations to a discrete set of classes based on the concept of probability (Hilbe, 2009).

Evaluation of the ML models
To evaluate how well the selected classifiers perform with ArCybC, we utilized different evaluation metrics such as accuracy, precision, recall, F1-score, and Area Under Curve (AUC). These metrics are derived from a "Confusion Matrix," a specific table layout that allows visualization of the performance of ML algorithms. The confusion matrix includes the following terminologies.
• True positive (TP) represents the number of instances correctly labeled as CB. • True negative (TN) represents the negative instances correctly classified as non-CB. • False positive (FP) represents the number of instances incorrectly labeled as belonging to the CB class. And, • False negative (FN) represents the number of cases not labeled as belonging to the CB class while they should be in this class.
Based on those terminologies, the evaluation metrics can be derived as follows: Accuracy is the ratio of correctly classified instances over all the correct and the incorrect number of classified instances and is given by Eq. 2.
Precision is the ratio of the texts correctly identified from the positive class over the number of all non-positively classified texts and is given by Eq. 3.
On the other hand, the recall evaluation metric indicates how much the learning algorithm can identify the positively classified texts and is given by Eq. 4.
The F1-score, or simply the F-score, is the weighted mean of precision and recall. It denotes the classifier's ability to balance between precision and recall. It is mainly used with highly imbalanced data at the class-leveled. It is calculated as given by Eq. 5.
Finally, AUC refers to the area under Receiver-Operating Curve (ROC). It is used to check the performance of the classification model. The closer the ROC curve to the upper left corner, the higher the overall accuracy of the test.

Model deployment: Requirements and design issues
The proposed Arabic CB detection model can be deployed similar to a software as a service (SaaS), which delivers applications over the Internet as a service. Machine learning as a service (MLaaS) is a set of cloud computing services that provide machine learning technology through service providers in a subscription model (Hadullo & Getuno, 2021). MLaaS offers many tools such as predictive analytics, deep learning, APIs, data visualization, and natural language processing. Nowadays, providers like Amazon, Microsoft, Google, and IBM offer many tools for their clients to run ML algorithms via a cloud environment. MLaaS includes, among other services, data pre-processing, transformation, visualization, model training, and model evaluation. Figure 15 depicts a suggested architecture for deploying our CB solution on the cloud. We believe delivering our model as a cloud service allows for IT cost reduction, uses state-of-the-art AI prediction capabilities operations availability, and makes interaction with clients more efficient.
(2) Accuracy = TP + TN TP + TN + FP + FN The suggested cloud-based ML model consists of three phases: 1) The data collection and preprocessing phase: Extracts raw data from Twitter and saves it in JSON format. After data cleansing and preprocessing, the data can be stored as a database using a proper DBMS such as MySQL.
2) The ML as a service phase: Creates an ML model and deploys it as a service using cloud platform resources. The service will be provided through a publicly accessible Application Programming Interface (API), which responses to a client's request.
3) The service delivery phase: Service can be delivered to clients on different devices and applications.

Experiments and results
In this section, we present the testing and analysis of the performance of the trained models on the ArCybC corpus. First, we display the experimental setup. Next, we discuss building the ML models and discussing the two main experiments we conducted on the corpus. Then we present the evaluation performance of the five selected ML classifiers using different text representation schemes. Finally, we discuss the obtained results.

Experimental setup and hyperparameter tuning
As mentioned earlier, the dataset was split into training and testing datasets. We used the training dataset to train the models and tune their hyperparameters. Table 10 lists and explains the selected classifiers' hyperparameters and how   they were adjusted using the grid search optimization approach. It also shows all the possible values for each parameter, the default values, and the best hyperparameters obtained after running the classification algorithms with grid search optimization using two different text representation schemes, TF-IDF and word embedding.

Building the ML Models
Algorithm 1 shows the steps towards building the ML models using the two main feature extraction and text representation techniques, the bag-of-words TF-IDF and the word embedding AraVec techniques. Algorithm 1 Building the ML models

Input: Training and Testing datasets
For each of the five ML algorithms Begin Classification process: Step 1: Preprocessing of tweets.
Step 2a: Feature extraction using TF-IDF to generate D[X*:Y*] for each data partition.
Step 2b: Feature extraction using AraVec to generate D[X*:Y*] for each data partition.
Step 3: Find the best hyperparameters of a classifier using the Grid Search algorithm.
Step 4: Implement model training for the training dataset.
Step 5: Implement the model classification for the testing dataset.
Step 6: Evaluate the model.
Output: Find the performance of the model End X* = array of input with number of features, Y* = array of class labels.

Experiment I: ML classification algorithms using the TF-IDF model
In this experiment, we tested and evaluated the performance of the five ML algorithms using the TF-IDF text representation model. The evaluation results of this experiment are shown in Table 11, while the details of this experiment are given in the Discussion section.

Experiment II: ML classification algorithms using the word embedding model
In this experiment, we report on the performance of the classifiers using the Ara-Vec3.0 word embedding model. As shown in Table 12, all ML models show better performance using the word embedding scheme. The details of this experiment are given in the Discussion section.

Discussion
This section discusses the results of the conducted experiments and compares our findings with the other studies discussed in the literature review subsection. Starting with the first experiment, all classifiers show high accuracy rates for the TF_ IDF model. Concerning Table 11, the accuracy rates varied from 72.4% to 82.7%. The SVM and the RF models show slightly better performance in predicting CB with an equal accuracy rate of 82.7%. The RF model has a higher F1-score rate of 81.4%, while SVM has a lower F1-score rate of 81.2%. Figure 16 shows the ROC curve and the precision-recall curve for the five classifiers.
In the second experiment, the behavior of the classification models was expected because word embedding models such as AraVec capture the meaning and the context of the words. The AraVec model used this information to learn the relationship between words and arrange words of similar meanings to have similar representation. One can notice from Table 12 that SVM was the best model to predict CB with an accuracy rate of 86.3% and an F1-score rate of 85.3%. Moreover, Fig. 17 shows the ROC curve and the precision-recall curve to demonstrate the performance of the AraVec model. Table 13 shows a comparison between ArCybC and the other related works based on the accuracy measure. As one can notice, the results of Haidar et al. (2017) and (2018) achieved high accuracy rates of 94% and 93%, respectively. However, their dataset was imbalanced, and the positive class's recall rate was as low as 27%. Therefore, the accuracy measure does not reflect their actual model performance. On the other hand, ArCybC is a balanced CB dataset. Therefore, the high accuracy rate achieved by the SVM-AraVec model, 86.3%, reflects its effectiveness in detecting CB for the Arabic language. In addition, the recall rate for the positive class (CB) was 80.7%. Therefore, it is also evident that ArCybC under the best classification model outperformed all the compared studies. To conclude our discussion, we answer the research questions discussed previously. For the first research question, "RQ1: Is there a comprehensive benchmarking dataset for Arabic that could be used for CB detection?" We conducted a comprehensive review of the literature; we found that the lack of a commonly used benchmarked and trustworthy CB dataset for the Arabic language resulted in difficult fair comparisons and limitation of results' presentation in the literature. Freely available benchmark datasets are essential for advancing many NLP research areas, especially for under-resourced languages such as the Arabic language.
We presented an approach to design and construct a comprehensive, multi-dialect, and annotated Arabic corpus extracted from Twitter to tackle the problem of CB detection. We targeted four categories of harassment content: sexual, racial, physical appearance, and intelligence. Moreover, we have created a lexicon of offensive words based on the mentioned harassment categories. The final result was the construction of a CB dataset for the Arabic language named ArCybC. For the second research question, "RQ2: What are the most common CB topics spreading among the Arab virtual communities on the Internet?" We thoroughly analyzed the most vulnerable topics about harassment and CB from the literature. We discovered that the domains related to celebrities, gaming, sports, and news were the most susceptible to CB and having offensive content. We have collected.
For the third research question, "RQ3: What is the best approach to represent the words and sentences that capture the semantic of Arabic CB? We used two   Tables 11 and 12. For the fourth and last research question, "RQ4: What should be incorporated in a methodology to effectively detect CB on a social media platform such as Twitter?" We put the ArCybC corpus in practice using the state-of-the-art ML and language models to detect Arabic CB cases. Table 13 shows that ArCybC under SVM and the AraVec model outperformed all previous related works.
However, regarding using CB datasets to build real systems, Salminen et al. (2020) argued that annotating comments for model training is usually decontextualized, which means that it ignores society's ways of using language and their standards in defining offensive. As a result, many of the comments could be considered offensive in context but not when standing alone. Therefore, it is recommended not to rely totally on the ML models to delete or block a post automatically. Alternatively, they can be used as decision support systems to report comments to humans or moderators, who in turn can judge the situation taking into account the regulations and the ethical considerations, then take the appropriate decision.

Conclusion and future work
To the best of our knowledge, this work represents the first Arabic CB corpus with various content types targeting the offensive language used in CB in the Arab virtual communities. We trained and tested the compiled corpus on five ML models and used two different text representation models. The experiments showed that the SVM model using the word embedding scheme outperformed the other models with an accuracy rate of 86.3% and an F1-score rate of 85%. To promote research in related fields, we made the ArCybC corpus available to the public to study various patterns of abuse in social media, such as CB, offensive contents, and hate speech, and to encourage comparative analysis of different harassment detection algorithms.
As for the practical implications on the future directions of Arabic CB detection, the findings highlight the phenomenon of CB among adolescents in the Arab virtual communities and the consequences of CB on their life. Also, the study explores the importance of developing quality benchmark Arabic datasets for various NLP applications in general and Arabic CB in particular. In addition, transparent methodologies for constructing CB datasets and annotating them properly are in demand. Arabic language resources and ML models based on deep learning techniques, such as the Arabic version of BERT (AraBERT) (Antoun, Baly & Hajj, 2020), need to be implemented and evaluated on Arabic CB detection tasks.
Furthermore, ArCybC can be re-annotated as a supportive corpus for HS detection and the other publicly available HS datasets.