---
title: "BERT-based Approach to Arabic Hate Speech and Offensive"
description: "How AraBERT uses tweet text, emoji descriptions, and sentiment to detect Arabic offensive language, hate speech, and its targets."
canonical: "https://research.elamur.ai/free/en/papers/althobaiti-2022-bert-based-approach-arabic-hate/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/althobaiti-2022-bert-based-approach-arabic-hate/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2022](https://md.research.elamur.ai/free/en/papers/2022/) / BERT-based Approach to Arabic Hate Speech and Offensive Language Detection in Twitter: Exploiting Emojis and Sentiment Analysis

# BERT-based Approach to Arabic Hate Speech and Offensive Language Detection in Twitter: Exploiting Emojis and Sentiment Analysis

Paper · 2022 · Maha Jarallah Althobaiti

**Authors:** Maha Jarallah Althobaiti · **Year:** 2022 · **Venue:** International Journal of Advanced Computer Science and Applications · **Licence:** [CC BY (OpenAlex best open-access location)](https://creativecommons.org/licenses/by/4.0/)

[**46** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W4285272262) · [International Journal of Advanced Computer Science and Applications](https://openalex.org/S23629721) · [licence](https://creativecommons.org/licenses/by/4.0/)

- [PDF](http://thesai.org/Downloads/Volume13No5/Paper_109-BERT_based_Approach_to_Arabic_Hate_Speech_and_Offensive_Language.pdf)
- [DOI 10.14569/ijacsa.2022.01305109](https://doi.org/10.14569/ijacsa.2022.01305109)
- [OpenAlex](https://openalex.org/W4285272262)

Citations: OpenAlex, 2026-10-14.

## Summary

An Arabic tweet can insult someone without attacking them because of their religion, gender, or another characteristic. That distinction matters when researchers use Twitter posts to study abuse. A system that notices an insult may still miss what makes it hateful, and a system that detects hate speech may struggle to identify its target. This paper tests all of those decisions on a corpus of 12,698 Arabic tweets. It asks whether a classifier can use clues that ordinary text preprocessing might discard, especially emojis, and whether giving it an explicit estimate of a tweet’s tone helps.

The study compares AraBERT, an Arabic text encoder adapted to the task, with a support vector machine and logistic regression. It trains each kind of classifier on several versions of the tweets. These range from the original posts to cleaned versions in which emojis are replaced by Arabic descriptions and a sentiment classifier supplies a word meaning positive, negative, or neutral. The same feature changes can make one task easier and another harder. An emoji description may put an insult into words, for example, while a negative sentiment label gives little indication of whether an attack concerns ethnicity, religion, or social class. The distinction is central to how the paper uses [sentiment analysis](https://md.research.elamur.ai/free/en/topics/sentiment-emotion/).

On the development set, AraBERT outperformed both conventional approaches. On the held-out test set, the selected AraBERT systems earned a macro F1 of 84.3% for offensive language detection and 81.8% for hate speech detection, ahead of the published benchmarks on the same tweets. Macro F1 gives the classes equal weight, so success on the most common label has limited influence on the score. The finer task, which distinguishes categories of hate speech as well as tweets without hate speech, reached 45.1%. The dataset creators had published benchmarks for the binary tasks, leaving the finer task without a previous score for direct comparison.

The development results show where the extra text helped. Cleaning, spelling out the emojis, and appending sentiment together gave the strongest offensive language result for each classifier family. For binary hate speech, cleaning and sentiment gave the highest macro F1, with emojis left unconverted. For the fine-grained task, cleaning alone gave the strongest result in each family. The benefit of an extra feature depended on the label the classifier had to predict. In particular, a cue that helps identify an offensive tweet can be shared across several hate speech categories and offer little help in distinguishing them.

## Deep dive: BERT-based Approach to Arabic Hate Speech and Offensive Language Detection in Twitter: Exploiting Emojis and Sentiment Analysis

How AraBERT uses tweet text, emoji descriptions, and sentiment to detect Arabic offensive language, hate speech, and its targets. · about 35 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### Three questions an offensive tweet can raise

The paper starts from the consequences of abuse for the people who encounter it online. It describes concerns about mental health and the well-being of online communities, and places automatic detection alongside efforts to study how hostile language is used. A classifier acts on a narrower question than those motivations might suggest. Its immediate job is to assign a label to a tweet according to a specified definition. The quality of that assignment depends in part on which behavior the definition brings together and which behavior it separates.

In the dataset used here, offensive language includes insults, slurs, threats, and encouragement of violence. The hate speech definition adds a condition about the basis of the attack. The language has to target a person or group on a characteristic covered by the annotation scheme. A hostile personal remark can therefore be offensive under the first definition while receiving the negative label under the second. The finer task asks which characteristic is involved. These distinctions are decisions made in the dataset’s [linguistic annotation](https://md.research.elamur.ai/free/en/concepts/annotation/).

The tasks are related without being interchangeable. A general insult is a positive example for offensive language detection and a negative example for hate speech detection. A tweet that attacks people on the basis of their religion belongs on the positive side of both binary tasks and has a more specific label in the fine-grained task. A classifier can therefore get the broad judgment right while missing the narrower one. The authors train and evaluate the tasks separately, which makes it possible to see where performance falls as the requested judgment becomes more specific.

The research surveyed in the paper used several ways to divide hostile language. One study distinguished hate speech, other offensive content, and content outside both categories. Another used a scheme with abusive, hateful, ordinary, and spam content. A study concerned with racism and sexism gave those categories separate labels. The paper also cites a typology that asks whether abuse is directed at an identifiable target and how explicitly it is expressed. Each choice changes what counts as a difficult example. A dataset concerned with explicit insults gives a classifier a different problem from one designed to identify the target of an indirect attack.

That variety is part of the benchmarking problem. A score summarizes how well a method reproduces a particular set of judgments. It travels poorly between studies whose positive classes, collection procedures, or test examples differ. The paper treats shared datasets as a way to make comparisons more informative. Its experiments examine how preprocessing and classification change the results when the examples and label definitions are held in common. This is the role of [evaluation and benchmarks](https://md.research.elamur.ai/free/en/topics/evaluation-benchmarks/) in the study.

#### Why the form of an Arabic tweet matters

The paper describes Arabic social media writing as rich in dialectal variation. The same intended expression can appear in different word forms or spellings. Differences in vocabulary, sentence structure, and word structure all contribute to the variety a classifier encounters. A training collection can contain several instances of a broadly similar expression while giving the system little repeated evidence about any particular written form. The paper calls this a problem of data sparsity and points to earlier work on written dialects. [Automatic Arabic Dialect Identification Systems for Written Texts](https://md.research.elamur.ai/free/en/papers/althobaiti-2020-automatic-arabic-dialect-identification-systems/)

Features of informal writing add further variation. A person may lengthen a word by repeating a letter, insert symbols around the text, or use Latin letters and numerals to write Arabic, a practice the paper calls Arabizi. A tweet can also contain a link, a mention, or a hashtag. From a classification perspective, some of this material may be incidental to the label, while some may matter. Repeated letters, for instance, can change the spelling without changing the underlying word. A hashtag can contain meaningful words even when the hash sign and underscores are chiefly formatting.

Emojis raise a different question. Their written form differs from that of Arabic words, but a pictograph can participate directly in an insult. The earlier work cited in the paper describes animal names as recurring personal attacks on Arabic Twitter and identifies angry or disgusted faces and objects such as shoes as cues found in offensive communication. The point is about how these signs are used in context. A picture of an animal can contribute an insult in one tweet and serve an ordinary descriptive purpose in another. The paper investigates whether a textual description makes that contextual evidence easier for a classifier to use.

Sentiment supplies a clue of a different kind. An emoji description gives words to something a person put into a tweet. A sentiment label is an inference about the tweet as a whole. The paper’s premise is that offensive posts frequently express negativity, making polarity a possible aid to detection. The tasks themselves show why polarity and abuse need separate treatment. A strongly negative remark about a situation may lack a personal target. An insult may express a negative attitude while leaving open whether any characteristic named in the hate speech definition is involved.

#### The approaches that preceded this study

The Arabic research reviewed in the paper includes early approaches that looked for known obscene expressions. One study started with seed words taken from tweets and used statistical comparisons to expand them into lists of potentially obscene terms and phrases. The lists included single words and adjacent pairs. This line of work treats recurring surface expressions as a practical starting point. A classifier trained on examples can carry that idea further by learning how several signals combine and which ones recur in the positive and negative classes.

Among the conventional techniques surveyed are support vector machines, logistic regression, and Naive Bayes. The paper also reviews approaches based on learned representations. One study compared FastText with a support vector machine using character sequences. Another used AraVec word representations in several neural architectures, including recurrent and convolutional approaches. Such comparisons reflect a recurring choice in the paper’s account of earlier work. A classifier can receive features explicitly constructed from the text, or it can adapt a representation learned before the current task.

Shared tasks brought some of these choices onto common evaluation data. The Arabic offensive language and hate speech tasks at OSACT4 provided a manually annotated Twitter collection of 10,000 examples. One system combined a support vector machine with neural approaches for offensive language detection. Another used a support vector machine for hate speech and credited extensive preprocessing. Its preparation included converting emojis and emoticons into text, normalizing letters, segmenting hashtags, and mapping dialectal expressions toward Modern Standard Arabic. Because those operations were combined, the example gave Althobaiti a reason to test emoji conversion in a more focused set of comparisons.

A closer precedent is the work that supplied the corpus for this study. It offered annotations for broad offensiveness and finer hate speech categories and published binary detection benchmarks. Its comparisons included Arabic-specific and multilingual encoders. That earlier use of the same dataset gave Althobaiti a way to ask whether a new AraBERT configuration and input preparation could improve on existing results under the same evaluation split. It also placed emoji research on both sides of the study’s design. Emojis were part of the earlier dataset work and became a representation choice for the classifiers in the new experiments. [Emojis as Anchors to Detect Arabic Offensive Language and Hate Speech](https://md.research.elamur.ai/free/en/papers/mubarak-2022-emojis-anchors-detect-arabic-offensive/)

### The method, step by step

#### Start with a tweet and choose the question

Imagine a tweet written in dialectal Arabic. It contains a few words, a link, and an animal emoji. For the offensive language task, the system predicts whether the tweet meets the corpus definition of an offense. For the binary hate speech task, it predicts whether the tweet attacks on one of the characteristics specified in the corpus. For the fine-grained task, it chooses the relevant category of hate speech or the label for a tweet without hate speech. The input can be the same in every case. The set of decisions changes with the task. Predicting a label from a piece of text in this way is [text classification](https://md.research.elamur.ai/free/en/concepts/text-classification/).

The first label set is OFF and NOT OFF. The second is HS and NOT HS. The fine-grained task uses 7 labels. HS1 covers race, ethnicity, or nationality. HS2 covers religion or belief. HS3 covers ideology, and HS4 covers disability or disease. HS5 denotes social class and HS6 denotes gender. The remaining label is NOT HS. Including that last label means the fine-grained classifier is evaluated on whether to assign a hate speech category as well as on which category to choose.

The labels are inherited from the corpus builders. Althobaiti’s intervention is to prepare different versions of the same examples and train classifiers on those versions. An emoji becomes a phrase in some versions. A predicted sentiment is attached in others. The human judgment used as the training target stays with the tweet through those changes. This matters when interpreting the experiments. A change in score follows a change to the text presented to the classifier while the evaluation continues to ask for the same annotation.

From Arabic tweets to classification scores The steps in order.

#### Clean the text while keeping the task unchanged

The paper retains an original-tweet condition, called Orgi, to give the cleaned variants a point of comparison. The basic cleaning condition is CLN. It removes markup and items such as line-break placeholders, URL material, and the RT marker for retweets. The cleaning procedure also addresses hashtag and mention markers. Underscores in hashtags are replaced with spaces, which lets the parts of an underscore-delimited expression appear as separate words.

The procedure removes diacritics, punctuation, mathematical signs, and assorted symbols. It reduces repeated letters and applies several Arabic spelling normalizations. Different forms of alif become bare alif, without hamzah. The procedure maps taa’ marbutah to haa’ and maps alif maqsurah, described as dotless yaa’, to yaa’. The paper uses AraNLP for repeated-letter handling and normalization. These operations make different written forms more likely to be represented alike in the data presented to a classifier.

Consider what happens to a word sequence when a decorative separator or a line-break marker disappears. A feature extractor can encounter the surrounding words in a simpler form. With spelling normalization, evidence associated with an expression may also carry across variants that otherwise would have separate entries in a feature vector. The same operations can remove distinctions that a writer intended to convey. Letter repetition may express emphasis, for instance. The paper assesses the combined cleaning procedure by its effect on classification, so the score measures the package of changes.

The corpus example used to illustrate preprocessing contains a remark about dwelling on yesterday and hoping for a better tomorrow. The original tweet has decorative material and a link placeholder. The cleaned version in the illustration leaves a short sentence, and the version with sentiment appends a word for neutral. In the version that spells out pictographs, the rendered text has descriptions for symbols including flowers, hand gestures, and a growing heart. The sentiment word in that version is positive. The example shows how the added material can alter the input even when the underlying sentence remains recognizable.

Cleaning is also the common starting point for the feature experiments. This lets the authors compare a cleaned setting with a cleaned setting plus sentiment, or a cleaned setting with translated emoji descriptions against one without that conversion. The original condition has a different purpose. It shows the overall behavior on the starting representation and makes it possible to assess cleaning as a whole before examining the additions.

#### Give an emoji an Arabic description

For the emoji conversion, the authors use Python’s demoji package. It identifies emoji characters using information from the Unicode Consortium’s emoji repository and returns descriptions in English. The authors then use the Google Translate API to render those descriptions in Arabic. In the conversion conditions, the Arabic description takes the place of the pictograph in the tweet. The surrounding words and the description enter the same classification input.

This matters for both conventional classifiers. If an emoji becomes an Arabic animal name, for example, it becomes available to the feature extractor through words and sequences of letters. A description consisting of several words can also yield a feature for a short phrase. The classifier can then encounter some of the same features in a tweet where the writer typed the corresponding words. How much overlap there is depends on the wording chosen for the description and on the training examples.

AraBERT takes a different kind of input representation. The chosen Twitter variant supports emojis as well as dialectal words, so the comparison includes a system whose underlying encoder can already accept the original symbols. Replacement changes the form in which information arrives. An emoji supplies a pictograph, while an Arabic description supplies words the encoder can interpret in their textual surroundings. The experiment compares those forms as used by this pipeline, including the effect of the translated wording.

A description typically identifies the sign without resolving its role in the conversation. The name of a hand gesture can be informative when paired with the words around it, and it can be ambiguous in isolation. The same is true of an animal name. Whether it is a literal reference or a way of insulting someone depends on how the sign is used. The paper’s approach leaves the downstream classifier to learn which descriptions are associated with which labels in the training data.

#### Append a predicted sentiment word

The sentiment step uses CAMeLBERT-DA, a dialectal Arabic encoder that had already been adapted for sentiment classification. Its sentiment training drew on ASTD, ArSAS, and SemEval data collected from Twitter. The authors considered those data relevant because of their use of dialectal Arabic in social media. The classifier returns a polarity category for the supplied text. Its adaptation from an existing encoder is an example of [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/).

The paper turns the polarity into a word in Arabic and appends it to the tweet. In the paper’s transliteration, the words are AyjAby for positive, slby for negative, and muHAyd for neutral. The downstream classifier receives the category as ordinary text. The approach uses the selected category alone, so a tweet judged narrowly negative and a tweet judged clearly negative receive the same added word. The sentiment label is predicted automatically and is separate from the annotation used to grade offense or hate speech.

The authors also examine the sentiment classifier on two forms of the same tweets. It can read the text with the original emoji, or it can read the version containing the emoji’s Arabic description. This creates a dependency between the two feature operations. When the authors combine conversion and sentiment, the converted text may itself affect which sentiment word gets appended. A result for the combined condition can therefore reflect changes in both the description and the polarity assigned to the tweet.

A comparison in the paper illustrates this dependence with a message asking where someone has been since the previous day. The sentiment system predicts neutral with the original emoji. The converted version includes a word for a dog, and its prediction is negative. This shows a change in what the sentiment classifier returned. The paper does not establish a gold polarity for that example. It uses cases like this to illustrate how the input representation can affect the step that supplies the extra word.

#### Train on each of the input conditions

The original tweets, Orgi, are the starting condition. CLN runs the cleaning procedure. CLN+SA adds a predicted sentiment word to the cleaned input. CLN+EmoTxt converts emojis after cleaning. CLN+EmoTxt+SA uses the descriptive wording and appends a sentiment word. The labels are useful because they specify what changes between neighboring conditions. Comparing CLN with CLN+SA, for instance, asks what happens when the sentiment word is added to the cleaned representation.

The cleaned conditions provide a compact set of comparisons. A reader can examine the effect of sentiment with emojis unconverted by comparing CLN and CLN+SA. Comparing CLN+EmoTxt with CLN+EmoTxt+SA examines the sentiment addition when descriptions are already present. A comparison from CLN+SA to CLN+EmoTxt+SA incorporates the change in emoji representation and any resulting change in the sentiment prediction. This last comparison is consequently less direct as a test of the downstream effect of the emoji words alone.

Each classifier is trained on the version of the tweets assigned to its condition. The paper reports five configurations for each of the three tasks for each classifier family, giving 15 trained classifiers within a family. Separate training matters here. The results compare how the classifier learns with a representation available during training and evaluation. They answer a different question from taking a trained system and changing the representation of its inputs only at test time.

#### Represent the text for the conventional classifiers

The support vector machine and logistic regression receive the same kinds of text features. One set comes from word n-grams, meaning runs of consecutive words. The paper uses n in the range [1, 3], where n is the number of words in the sequence. This gives the classifiers evidence from individual words and short phrases. A phrase can receive its own feature even if its component words occur in many unrelated contexts. This is the purpose of an [n-gram](https://md.research.elamur.ai/free/en/concepts/n-gram/).

The word sequences are weighted using term frequency–inverse document frequency. The idea is to give a sequence weight according to its occurrence in a document and how widely it occurs in the collection. A word sequence found throughout the tweets generally carries less information about any particular tweet than one with a more concentrated distribution. This weighting gives the classifiers a representation of which word sequences appear and how much they contribute as features. [TF-IDF](https://md.research.elamur.ai/free/en/concepts/tf-idf/)

The other set of features consists of character n-grams. Here n is the number of characters, and the paper uses the range [2, 5]. The sequences are taken within word boundaries and represented by counts. This gives different written words a way to share evidence through overlapping strings of letters. The character features and word features make different aspects of the tweet available. Short letter sequences can recur despite variation in whole words, while a multiword sequence can retain something of the expression in which a word is used.

Both conventional classifiers take the word-weight vector and the character-count vector. A vector here is a list of numerical feature values for a tweet. The support vector machine learns a boundary in this space using the labeled examples, while logistic regression learns how feature values contribute to the assignment of labels. Giving them the same kinds of features makes their development results useful as a comparison of learning approaches under a common representation. The paper describes these systems through the features and training setup, without stating a mathematical objective or giving a TF-IDF formula.

The logistic regression implementation uses Python’s sklearn package. The paper reports increasing the maximum iteration setting from its default of 100 to 800 to obtain a trained classifier. This is a limit on the fitting procedure. It is separate from the number of tweets, the sizes of the character sequences, and the number of data conditions. For both conventional approaches, a translated emoji description or an appended sentiment word contributes through the same word and character extraction procedure as the rest of the tweet.

#### Adapt AraBERT to the annotations

The BERT system starts from AraBERTv0.2-Twitter-base. The paper chose this variant because it supports dialectal Arabic words and emojis. BERT encodes the input so that its representation of a word can depend on words to its left and right. For an insult classifier, that means a word used as an attack can receive a different contextual representation from the same word used in an ordinary description. AraBERT supplies the starting encoder, and the annotated tweets supply the training signal for each classification task. This is the study’s use of the [Transformer](https://md.research.elamur.ai/free/en/concepts/transformer/).

The authors also use Farasa to segment text for AraBERT. Segmentation changes how the written material is divided before it goes into the encoder. It serves a different purpose from the earlier removal of markup or normalization of letters. Cleaning brings forms into closer alignment and removes selected material. Segmentation determines what pieces of the resulting text are passed onward. Along with the choice of AraBERT variant, it is part of the configuration compared against the count- and weight-based classifiers. [Tokenization](https://md.research.elamur.ai/free/en/concepts/tokenization/)

AraBERT and the conventional approaches are thus exposed to the same kinds of additions under the feature conditions, but they can use them differently. A conventional classifier receives explicit measurements for an appended word and the sequences that can be formed from it. AraBERT can also interpret that word in relation to the rest of the tweet. The experiment tests the overall effect of adapting each classifier to the prepared inputs. It does not specify that a classifier must rely on a description or sentiment in a particular way.

### Experiments and results

#### How the data are divided

The study preserves the corpus creators’ splits. The 8,888 training tweets account for 70% of the corpus. The development split contains 1,269 tweets, reported as 10%, and the test split contains 2,541 tweets, reported as 20%. The training portion supplies the labeled examples for fitting. The development portion is used to compare the classifier families and preprocessing conditions. The final comparison with published systems uses the held-out test portion.

The class distributions help explain why the same evaluation metric is important across the tasks. The paper reports 4,463 OFF tweets and 8,235 NOT OFF tweets across the corpus. For binary hate speech it reports 1,339 HS tweets and 11,359 NOT HS tweets. The finer task retains the large NOT HS category while spreading the hateful tweets across the target labels. Its discussion gives 260 race, ethnicity, or nationality examples and 27 religion or belief examples to illustrate the differences in available data for individual classes.

The creators of the dataset had made the training and development labels public. For the test split, the tweets were available while the reference labels were held by the creators. They helped score the selected classifiers against those labels and returned the results. This set-up gives the paper two levels of evidence. The development scores describe the full comparison among the new conditions. The test scores describe the selected AraBERT configuration for each task and support a comparison with systems previously evaluated on the same split.

#### What each score measures

Accuracy is the share of tweets assigned their reference label. In a collection with a large NOT HS category, accuracy gives each tweet the same weight. A classifier can therefore obtain many correct assignments by handling that category well, even when it struggles with the rarer labels. This becomes particularly relevant when the fine-grained classifier’s errors can involve either selecting the wrong hate speech category or missing hate speech altogether.

Precision for a class measures how frequently assignments to that class agree with the reference labels. Recall measures how much of that class in the reference data the classifier recovers. The same system can do differently on these measures. For instance, a classifier that uses a rare label only when the words strongly suggest it may have good precision among those few predictions and weak recall across the examples that actually belong to the class.

F1 summarizes precision and recall for a class, with a low value on either measure limiting the result. Macro averaging gives equal weight to the class-level scores. Accordingly, macro F1 is sensitive to performance on the smaller categories even when their tweets contribute relatively little to accuracy. The paper reports accuracy, macro precision, macro recall, and macro F1. It uses macro F1 to rank the development configurations. This explains why the configuration chosen for testing can differ from the one with the highest development accuracy.

#### Development results across classifier families

For offensive language detection, the best development macro F1 reported for the support vector machine is 76.28. The strongest logistic regression condition obtains 76.50. Both use cleaning with emoji descriptions and a sentiment word. With the same preparation, AraBERT achieves 85.93, its highest offensive language macro F1 on development. The advantage for AraBERT is also visible in the cleaned-only condition, where it reaches 85.74 before either of the added features is used.

For binary hate speech, the strongest support vector machine configuration reaches a development macro F1 of 65.37. Logistic regression reaches 67.77. In these cases, the leading condition uses cleaned text with sentiment. AraBERT reaches 81.89 under that preparation. The simpler AraBERT condition using cleaned text alone is close, at 81.76. The classifier family and the choice of preprocessing can both matter, though the scores in this setting show a much closer contest between the leading AraBERT inputs than between the classifier families.

The same family ordering holds at their respective best settings for fine-grained hate speech. The strongest support vector machine scores 21.79 macro F1 on development. The strongest logistic regression scores 25.25, and the strongest AraBERT scores 48.72. Each of these results comes from cleaned text alone. This comparison is useful in interpreting the paper’s main contribution. The leading fine-grained result comes from the contextual classifier and the basic cleaning procedure even though the study also investigates richer inputs.

The fine-grained accuracy figures put this comparison in perspective. With cleaned input, AraBERT has a development accuracy of 93.54 and macro F1 of 48.72. The cleaned logistic regression has an accuracy of 92.76 and macro F1 of 25.25. Seeing both metrics makes clear how differently the same predictions can look when every tweet contributes equally and when every category contributes equally. The accuracy figures alone give little indication of the extent to which AraBERT improves the class-balanced score.

#### Held-out comparisons with the published systems

The original dataset benchmarks include two Arabic-specific systems, AraBERT and QARiB, and two multilingual systems, mBERT and XLM-RoBERTa. They provide an external comparison in the sense that their results come from the dataset creators’ earlier experiments. The tweets and splits are shared, so the comparison can be made directly on test performance. The paper’s own support vector machine and logistic regression results are development comparisons. Their role is to show how the new preprocessing variants behave with those learning methods.

The paper’s prose identifies the offensive language test result as 84.30 macro F1 in its results table, also reported as 84.3% in the conclusion. QARiB is the strongest published baseline for that task at 82.31, followed by the benchmark AraBERT at 80.02. The selected classifier uses the development setting with both emoji descriptions and sentiment. Its reported test accuracy for offensive language is 85.90, with macro precision of 84.60 and macro recall of 84.10.

Offensive language systems on the Arabic Twitter test set, macro F1 The selected AraBERT configuration leads the published benchmarks.

**The numbers**

| System or setting | Macro F1 |
| --- | --- |
| XLM-RoBERTa | 72.48 |
| mBERT | 73.66 |
| Benchmark AraBERT | 80.02 |
| QARiB | 82.31 |
| AraBERT with emoji descriptions and sentiment (this paper) | 84.30 |

For binary hate speech, the published AraBERT benchmark leads the earlier systems at 80.14 test macro F1, with QARiB at 80.04. The study’s selected AraBERT, trained on cleaned tweets with a sentiment word, reaches 81.80. The corresponding test accuracy is 93.30, with macro precision of 83.00 and macro recall of 80.70. Althobaiti reports this macro F1 as 81.8% in the conclusion.

Binary hate speech systems on the Arabic Twitter test set, macro F1 The selected AraBERT configuration scores above the strongest published result on the same split.

**The numbers**

| System or setting | Macro F1 |
| --- | --- |
| mBERT | 75.20 |
| XLM-RoBERTa | 79.36 |
| QARiB | 80.04 |
| Benchmark AraBERT | 80.14 |
| AraBERT with sentiment (this paper) | 81.80 |

The binary task headings in the test table appear to be transposed relative to the paper’s narrative. The pairing used here follows the results identified in the abstract and conclusion, together with the task assignments in the discussion of the prior benchmarks. Those passages consistently associate QARiB’s 82.31 and the paper’s 84.30 result with offensive language, and the earlier AraBERT’s 80.14 and the paper’s 81.80 result with binary hate speech. The matching accuracy, precision, and recall figures come from the same sets of rows.

The fine-grained test result has a different status. The dataset creators supplied no benchmark for that task, so the paper reports the performance of its selected AraBERT classifier by itself. With the cleaned-only configuration, it obtains 45.10% macro F1, 48.20% macro precision, 46.10% macro recall, and 92.10% accuracy. The score establishes a result for that corpus and split. Claims of outperforming earlier systems are supported by the two binary comparisons.

The fine-grained test score also helps explain why the binary hate speech result is an incomplete guide to the ability to recognize targets. A binary classifier gets credit for assigning HS when the tweet is hateful, even if the evidence it uses would apply to several categories. The fine-grained classifier has to identify the particular label. Its lower macro F1 gives a direct measure of the additional difficulty in this experimental setup, while the reported aggregate scores leave open how that difficulty is distributed across the target classes.

### What the ablations show

#### Cleaning helps across the tested tasks

The paper’s closest equivalent to ablation is the development comparison among input preparations. The authors train new classifiers for each condition and compare the scores on the same development split. That design shows how the performance of a classifier family changes when it learns from a differently prepared version of the data. It also shows whether a change that looks favorable for AraBERT is favorable for the conventional approaches.

Cleaning is the most consistent change. With AraBERT, the development macro F1 for offensive language moves from 84.98 on the original tweets to 85.74 after cleaning. For hate speech, the corresponding scores are 80.91 and 81.76. For fine-grained hate speech, they are 45.79 and 48.72. The authors observe the same broad benefit across their conventional approaches. The particular cleaning combination used in this study therefore has evidence of value even before the emoji and sentiment additions are considered.

Several operations change together in this comparison. Removing markup, normalizing selected letters, and reducing repetitions may each change how many useful patterns recur across examples. The observed gain belongs to their combined effect. The comparison leaves the contribution of individual operations unmeasured. In particular, it gives no basis for ranking spelling normalization against hashtag handling or for assuming that an operation which helps one classifier independently helps the others.

#### The broad offense task benefits most from the combined input

For offensive language detection, AraBERT’s cleaned baseline earns 85.74 macro F1 on development. Adding sentiment to that baseline yields 85.79. Replacing emojis with descriptions yields 85.87, and combining the descriptions and sentiment yields 85.93. The conventional systems also obtain their best offensive language macro F1 under the combined preparation. Thus the development ranking favors the richest input for this task across the classifier families studied.

The metric used for selection qualifies that result. In the AraBERT offense comparison, the setting with descriptions alone has a development accuracy of 87.95, while the combined setting has 87.80. Their macro F1 values favor the combined one. The two measures answer different questions about the distribution of correct predictions. Because the paper chose macro F1 in advance as the ranking measure, the combined setting is the one that represents the study’s approach in the held-out comparison.

The authors’ explanation is that the broad offense label captures a range of impolite language with some common signals. Angry or disgusted pictographs can convey an attitude relevant to that broad boundary. Descriptions supply words for those cues, and a negative sentiment word can reinforce evidence already present in the original language. The development ranking is consistent with that explanation. The paper does not trace individual final decisions back to specific emoji words or report how the polarity categories are distributed across all offense labels.

The small spacing among AraBERT’s cleaned offense conditions is also informative. Its best result still relies heavily on the base text and encoder, as shown by the strong cleaned-only score. The additional words offer a way to improve the observed ranking under macro F1. The development comparison provides limited evidence about how stable that ranking would be if the same systems were fitted again or evaluated on another sample.

#### Binary hate speech favors sentiment with emojis unconverted

For binary hate speech, the ordering changes. AraBERT scores 81.76 development macro F1 with cleaning, and 81.89 with cleaning plus sentiment. With cleaning and emoji descriptions it scores 81.41. With descriptions and sentiment it scores 81.71. The two sentiment additions therefore have different starting points. Sentiment is associated with the highest score when added to the cleaned baseline, and it also improves the condition that already uses descriptions. The jointly enriched condition remains below the cleaned input with sentiment alone.

The support vector machine and logistic regression reach their highest binary hate speech macro F1 with cleaning and sentiment as well. Across the tested families, this is evidence for the usefulness of the sentiment word in that input setting. The use of descriptions in addition to sentiment introduces a change that fails to improve the leading result. The finding is specific to this conversion procedure, which replaces the original sign with translated wording.

The authors connect the result to the relation between the two binary tasks. A negative expression, a disgusted face, or an animal insult can occur in a tweet that is offensive yet falls under NOT HS. A feature that helps separate ordinary tweets from broadly offensive ones can therefore occur on both sides of the hate speech boundary. A translated emoji name may give the classifier more words associated with hostility while supplying little evidence about whether the attack is based on a characteristic in the annotation scheme.

Class imbalance gives a further possible explanation. The authors suggest that more varied wording from converted emojis may make some features sparser, particularly when there are few hateful examples. For a conventional classifier, different descriptions can create several word and character features whose relationship to the target label has to be learned from a limited sample. AraBERT can interpret the descriptions in context, but its scores show that even that ability does not guarantee an improvement from conversion. The evidence concerns the comparative scores. The proposed role of sparse features is the authors’ interpretation of them.

#### Fine-grained detection gains most from the cleaned text

The finer task gives the clearest example of a different best setting. The AraBERT development macro F1 of 48.72 with cleaning alone is higher than the scores with sentiment, emoji descriptions, or both. The support vector machine and logistic regression also attain their highest fine-grained development macro F1 after cleaning alone. The pattern holds across classifier families even though the absolute scores differ substantially.

AraBERT preprocessing on the Arabic Twitter development set, fine-grained hate speech macro F1 Cleaning alone gives the highest score, and the combined feature setting gives the lowest.

**The numbers**

| System or setting | Macro F1 |
| --- | --- |
| Original tweets | 45.79 |
| Cleaned tweets (this paper) | 48.72 |
| Cleaned tweets with sentiment | 48.55 |
| Cleaned tweets with emoji descriptions | 47.91 |
| Cleaned tweets with emoji descriptions and sentiment | 41.16 |

The closest AraBERT alternative is the cleaned condition with sentiment, at 48.55. Its development accuracy is 93.62, above the cleaned-only accuracy of 93.54. Again the model selection rule matters. A preference for correct decisions over all tweets and a preference for performance averaged equally over classes can select different inputs. For this investigation, the paper uses the latter criterion, which keeps the less frequent labels influential in the selection.

A polarity word can be shared by hateful tweets about religion, gender, ideology, and other categories. Its value for deciding between those categories may be limited even if it is associated with hateful language overall. Emoji descriptions face a similar problem when they express contempt or anger without identifying the basis of the attack. The available examples compound the difficulty. The paper’s discussion emphasizes how much the supply of tweets can differ between target classes.

Those observations make sparsity and overlapping signals plausible explanations. The study varies the representation while holding the available labeled examples fixed. It does not deliberately vary the supply of examples for a category or estimate which descriptions are good predictors of that category. The results therefore demonstrate which tested preparation performed better on this split. The link to the number of examples and the distinctiveness of particular emojis remains an explanation to assess in other comparisons.

#### The sentiment check measures agreement under a change of input

The paper conducts a separate check before relying on sentiment as an added feature. It takes a random sample of 1,000 tweets and runs the sentiment classifier on each tweet in its preprocessed form with the original emojis and in the version with descriptions. The predicted sentiment agrees for 97.40% of the paired tweets. Using the same tweets for both conditions makes this a check of how frequently the representation change affects the sentiment prediction in that sample.

The calculation concerns agreement between predictions. The paper compares the assigned polarities regardless of their correctness. Two versions can receive the same prediction even if a person would judge them both differently. Conversely, a changed prediction shows that the representation mattered to the sentiment classifier, but the comparison supplies no standard for deciding which version gave the better polarity assignment.

The paper includes examples in which the prediction moves from negative to neutral after an emoji is described, as well as examples in which it moves from neutral to negative. The example involving the dog description illustrates the latter. These cases give a concrete reason to view sentiment and emoji conversion as partly dependent. For the tweets in which polarity changes, the downstream classifier receives both the new wording and a different sentiment token. For the tweets in which polarity agrees, the token remains the same while the representation around it changes. The reported agreement does not tell us whether the cases that change are those most consequential for the hate speech or offense scores.

### Limitations

#### Limits identified by the authors

The authors emphasize the small and uneven supply of labeled tweets for some classes. The point applies especially to fine-grained hate speech, where the positive evidence is spread across several possible targets. A classifier has fewer chances to learn how a rare kind of attack can be phrased, and a new representation can introduce wording with few repetitions. This is why the authors treat the benefit of emoji descriptions as conditional on the examples available and on whether the descriptions help distinguish the labels at hand.

The authors also identify a limit to sentiment as a feature. Polarity is useful when a broad separation follows some of the same distinctions as positive, neutral, and negative language. Its usefulness becomes less apparent when several categories share the same tone. The fine-grained setting supplies the clearest observed case. This confines the paper’s strongest claim about sentiment to the binary tasks in its own data and evaluation procedure.

Access to the reference test labels imposed a practical limit on the comparison. The full set of system and preprocessing comparisons was conducted on development. The data providers evaluated the selected AraBERT configuration for each task on test. The authors also explicitly acknowledge in the results discussion that the original dataset work offered no fine-grained benchmark. The reported test performance for that task can serve as a point of comparison for other work using the same setup, while the benchmark wins in this paper concern the binary results.

#### What the experimental design leaves open

The held-out evaluation tells us how each selected AraBERT system performs against the official test annotations. The paper offers less evidence about whether the exact development ranking of preprocessing options persists on test. In particular, the two binary charts compare selected systems with published benchmarks. They do not compare the selected AraBERT with a cleaned-only version of the same checkpoint on the test tweets. Improvements over the published baselines therefore belong to the complete selected configurations, which combine choices about the encoder, training, segmentation, and tweet preparation.

The closest development scores also call for care. The paper reports point estimates for the configurations. It gives no repeated-training results or uncertainty estimates for the small separations among some of the leading AraBERT conditions. The rankings are the observed rankings and provide the stated basis for selection. Their stability across runs and samples remains open. This is particularly relevant when the leading condition differs from the next one only in whether an automatically predicted word was appended.

The experiments use one corpus and its fixed splits. Dialectal variation motivates the preprocessing and the choice of Twitter-oriented Arabic encoders, but the reported results are pooled across the corpus. Separate measurements by dialect would be needed to say where the gains are concentrated. Similarly, the study gives no comparative performance on a different platform or a separately collected Arabic corpus. Its strongest evidence is about the tweets and annotation scheme used in the experiment.

The listed target classes define the scope of the fine-grained result. The classifier predicts a category from that inventory for a tweet labeled as hateful. The score says little about how a system would handle a different taxonomy, represent several targets jointly, or use surrounding conversation to resolve a remark whose target is unclear from the tweet. The experiment evaluates labels on the tweet inputs supplied in the corpus. It does not evaluate recovery of the circumstances of the attack.

Aggregate metrics also leave the distribution of errors open. Macro F1 gives rare classes equal weight in the average, which makes it a better indicator of broad class coverage than accuracy in this setup. Still, the fine-grained totals do not identify which target categories are regularly confused, which are recovered reliably, or how many mistakes involve assigning NOT HS. Such details would matter for a reader interested in one particular category. The paper’s figures support overall comparisons among input settings.

The emoji experiment evaluates a particular pipeline. A Unicode description is first obtained in English and then translated into Arabic. Its effect can depend on the accuracy and wording of the translation as well as on the usefulness of describing the emoji in the first place. The comparison also replaces the pictograph, so it leaves open what would happen if a classifier received both the symbol and the description. More generally, a short name for a symbol gives limited access to the social meaning it takes on in a particular tweet.

The sentiment check similarly leaves a gap between agreement and validity. The polarity comes from a separate Twitter-trained classifier and enters the detection classifier as a category word. The paired experiment measures the stability of that category under one representation change. It does not validate the categories against human sentiment judgments on the corpus or establish that the sentiment classifier interprets hostile, ironic, or ambiguous language as a reader would. The reported offense and hate results establish the usefulness of the generated feature under some settings, which is a narrower claim.

The descriptions of the experimental systems are most complete about the feature ranges, classifier families, named resources, and split selection. The paper provides fewer details about the training choices for the support vector machine and AraBERT. This limits how precisely a reader can attribute the differences between classifier families to a specific choice. The study supports their comparison as configured. Estimating the independent effects of Arabic pretraining, Twitter orientation, Farasa segmentation, and the other training choices would require additional controlled runs.

### What came after

#### Corpora that define the target more precisely

The later citing work on Arabic hate speech includes studies that make the corpus itself the subject of investigation. Ahmad’s work concerns how to design, construct, and evaluate a corpus for Arabic hate speech detection. This follows a concern central to Althobaiti’s evaluation. The examples and their labels determine what a score can establish about detection. A corpus-design study addresses those choices at the point where the data are created, while Althobaiti’s comparison holds the corpus fixed and changes the representation presented to the classifier. The connection is in the emphasis on how data design shapes the detection problem. [Hate speech detection in the Arabic language](https://md.research.elamur.ai/free/en/papers/ahmad-2024-hate-speech-detection-arabic-language/)

AraTar makes the target of hate speech the organizing purpose of a corpus. Althobaiti’s fine-grained evaluation asks a classifier to assign a target-related category and finds that the task remains difficult even when the same approach performs well at binary detection. AraTar’s stated aim puts that specific distinction at the center of its data resource. It represents a continuation of the move from asking whether hate speech occurs to asking what kind of target it concerns. The particular mapping between AraTar’s categories and the earlier corpus’s labels is beyond what their stated scopes establish. [AraTar](https://md.research.elamur.ai/free/en/papers/alghamdi-2024-aratar-corpus-support-fine-grained/)

#### Preprocessing and affect in related tasks

AyahVerse takes the combination of preprocessing and fine-tuning into the MAHED shared task for hope and hate detection. The work uses ArabicBERT, and the task framing includes hopeful language. This changes the question being asked of the text. In Althobaiti’s paper, sentiment is an automatic input feature that supports a separate judgment about offense or hate speech. In the later work’s stated scope, hope is part of the detection problem. The methodological connection is the adaptation of an Arabic BERT classifier after preparing its text inputs. The shared theme leaves the specific preprocessing choices and their effects to the later study. [AyahVerse at MAHED](https://md.research.elamur.ai/free/en/papers/rashid-2025-ayahverse-mahed-shared-task-fine/)

Aleryani’s work examines emoji exclusion in Arabic sarcasm detection. This carries the question of emoji handling into a different kind of language judgment. In Althobaiti’s experiments, the main emoji operation under study is replacement with a textual description. The sarcasm study asks about exclusion. These choices test different properties of the input. Conversion changes how a cue is expressed to the classifier. Exclusion examines performance when that cue is taken away. Their connection is the decision to evaluate emoji handling explicitly, since the usefulness of the pictographs depends on the task. [Impact of emoji exclusion on Arabic sarcasm detection](https://md.research.elamur.ai/free/en/papers/aleryani-2024-impact-emoji-exclusion-performance-arabic/)

Vanetik’s work brings taxonomy, sentiment, and emotions together in fine-grained Arabic offensive language classification. It shares Althobaiti’s interest in the relation between affect and offensive content while giving emotions and the category scheme explicit roles in the stated research problem. Althobaiti’s polarity feature reduces affect to a positive, negative, or neutral word. The later work’s focus on emotions raises a more differentiated question about how affect relates to fine-grained labels. Its scope also concerns offensive language specifically, so the connection is broader than a repeat of the earlier experiment on hate speech targets. [Fine-Grained Arabic Offensive Language Classification with Taxonomy, Sentiment, and Emotions](https://md.research.elamur.ai/free/en/papers/vanetik-2025-fine-grained-arabic-offensive-language/)

## Cite

Cite as Maha Jarallah Althobaiti. 2022. BERT-based Approach to Arabic Hate Speech and Offensive Language Detection in Twitter: Exploiting Emojis and Sentiment Analysis. International Journal of Advanced Computer Science and Applications.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.14569/ijacsa.2022.01305109](https://doi.org/10.14569/ijacsa.2022.01305109)

```bibtex
@article{althobaiti2022bert,
  title = {{BERT-based Approach to Arabic Hate Speech and Offensive Language Detection in Twitter: Exploiting Emojis and Sentiment Analysis}},
  author = {Maha Jarallah Althobaiti},
  journal = {International Journal of Advanced Computer Science and Applications},
  year = {2022},
  doi = {10.14569/ijacsa.2022.01305109},
  url = {https://doi.org/10.14569/ijacsa.2022.01305109}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
