---
title: "Hate-Speech and Offensive Language Detection in Roman Urdu"
description: "The study builds a Roman Urdu Twitter benchmark and tests how pretrained representations and CNN-gram distinguish hate speech from…"
canonical: "https://research.elamur.ai/free/en/papers/rizwan-2020-hate-speech-offensive-language-detection/"
---
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/rizwan-2020-hate-speech-offensive-language-detection/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2020](https://md.research.elamur.ai/free/en/papers/2020/) / Hate-Speech and Offensive Language Detection in Roman Urdu

# Hate-Speech and Offensive Language Detection in Roman Urdu

Paper · 2020 · Hammad Rizwan, Muhammad Haroon Shakeel and Asim Karim

**Authors:** Hammad Rizwan, Muhammad Haroon Shakeel and [Asim Karim](https://md.research.elamur.ai/free/en/authors/asim-karim/) · **Year:** 2020 · **Venue:** Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP) · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

[**101** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W3099150152) · [Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)](https://aclanthology.org/volumes/2020.emnlp-main/) · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2020.emnlp-main.197/)
- [PDF](https://aclanthology.org/2020.emnlp-main.197.pdf)
- [DOI 10.18653/v1/2020.emnlp-main.197](https://doi.org/10.18653/v1/2020.emnlp-main.197)
- [OpenAlex](https://openalex.org/W3099150152)

Citations: OpenAlex, 2026-10-14.

## Summary

A tweet can be offensive because it insults someone, because it attacks people for their gender or religion, or because it uses obscenities in a general outburst. A system that flags all of these tweets faces a different problem from one that has to tell them apart. The distinction matters in Roman Urdu, Urdu written in Latin script, where spellings vary and writers frequently mix Urdu and English. The authors build a benchmark for both tasks and ask how far representations learned elsewhere can help with a form of writing that had few resources for this kind of [text classification](https://md.research.elamur.ai/free/en/concepts/text-classification/).

Their dataset, RUHSOLD, contains 10, 012 tweets. Its coarse task separates hate or offense from normal content. Its fine-grained task distinguishes Abusive/Offensive, Sexism, Religious Hate, Profane, and Normal. The annotators use the intended target to distinguish a general use of profanity from a personal or group-directed insult. To collect examples, the authors compile a lexicon of 621 terms and also search for ordinary Roman Urdu words, giving the collection a way to include offensive tweets that contain no obvious slur. They release the lexicon, the dataset splits, and RomUrEm, a set of Roman Urdu [word embeddings](https://md.research.elamur.ai/free/en/concepts/word-embeddings/) trained on more than 4.7 million tweets.

The experiments compare representations before and after [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/), then compare established classifiers with CNN-gram, the authors’ convolutional architecture. In the standalone coarse-grained comparison, RomUrEm leads when the representations are kept fixed, with a test macro F1 of 0.84. [BERT](https://md.research.elamur.ai/free/en/papers/devlin-2019-bert-pre-training-deep-bidirectional/) reaches 0.89 after fine-tuning. BERT paired with CNN-gram reaches 0.90 macro F1 on the coarse test, matching the strongest baseline, and 0.75 on the fine-grained test, ahead of the best baseline’s 0.72. The gains from adaptation depend on the representation and the task. The examples also show a limit that the aggregate scores leave out. Both leading classifiers can recognize that a tweet contains offensive language and still miss that the language is aimed at someone.

## Deep dive: Hate-Speech and Offensive Language Detection in Roman Urdu

The study builds a Roman Urdu Twitter benchmark and tests how pretrained representations and CNN-gram distinguish hate speech from other abuse. · about 31 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

#### What a detector has to decide

The paper starts from a practical difficulty in reviewing social media posts. People can use the same platforms to exchange ideas, criticize public figures, demean other users, or direct hatred at a community. Reporting and manual review give platforms a way to act on harmful posts, but the authors point to the time this takes and the knowledge it demands. A reviewer must keep up with changing slang, understand the languages involved, and make a judgment about what a post is doing. The authors also recognize a danger in how that judgment is applied. A broad or inconsistently applied definition of offense can be used to suppress criticism or silence the people a moderation process ought to protect.

The authors discuss online harassment in Pakistan, attacks on religious minorities, and campaigns against public figures and women who express their views. These examples motivate a detector that considers locally relevant language and categories. The task they turn into an experiment is narrower than moderation itself. The input is a tweet, and the output is a category drawn from an annotation scheme. The categories give researchers a way to compare classifiers on the same decisions, including whether a tweet expresses hostility based on religion or gender, whether it directs an insult at someone, and whether its vulgarity has an intended target.

The target matters because the presence of an offensive word is only one part of the decision. A swear word can serve as an expression of frustration. A similar word can be chosen to humiliate a person. A post can also demean someone without employing a word that would appear on a hate-speech list. These are different reasons for giving a tweet a label, and they place different demands on a classifier. A vocabulary match can provide evidence that the wording is vulgar. The relationship between that wording and the rest of the tweet helps establish whether a person or group is being attacked.

#### Why Roman Urdu changes the task

Roman Urdu falls within the paper’s concern with [low-resource languages](https://md.research.elamur.ai/free/en/topics/low-resource-languages/), where suitable training and evaluation material is scarce for a particular task. The authors describe Urdu as Pakistan’s national language and explain that people frequently write it with Latin letters in informal exchanges. In these exchanges, they may switch between Urdu and English within a conversation or within a single message. A tweet can therefore be in scope even when much of its wording is English. A short Roman Urdu expression can carry an important part of its tone or meaning.

Reliance on a single spelling is especially fragile under these conditions. The paper describes informal abbreviations, variable spelling, colloquial expressions, and departures from standard grammar. A vocabulary item learned in one form may turn up in another form at test time. An expression split differently by a tokenizer can also lead the classifier to see a different sequence of pieces. Code-switching adds a related problem. A word from one language can modify or direct an expression in the other, so recognizing individual words leaves work to do at the level of the tweet.

This is also a question for [multilingual and cross-lingual NLP](https://md.research.elamur.ai/free/en/topics/multilingual-nlp/). If a representation has learned from text in multiple languages, some of what it captures might carry over when adapted to Roman Urdu. A representation learned specifically from tweets might, in turn, have seen more of the spellings, slang, and language mixtures that matter here. The paper sets up a comparison between these possibilities. Building a dataset with an explicit labeling procedure is what makes it possible to test them on the same examples.

#### What earlier studies treated as hate or abuse

The earlier work surveyed in the paper spans several tasks. Work by Waseem and Hovy looks for racism and sexism on Twitter, while related work by Waseem considers annotation judgments for that setting. Davidson and colleagues study the distinction between hate speech and offensive language on Twitter. De Gibert and colleagues work with hateful and non-hateful messages from a white-supremacy forum. These studies give the Roman Urdu paper precedents for collecting and labeling material. Their differences also show why a general description such as hate-speech detection can refer to experiments with quite different inputs and decisions. [Waseem and Hovy’s Twitter study](https://md.research.elamur.ai/free/en/papers/waseem-2016-hateful-symbols-or-hateful-people/) · [Waseem’s study of annotator influence](https://md.research.elamur.ai/free/en/papers/waseem-2016-are-you-racist-or-am/) · [Davidson and colleagues’ study of offensive language](https://md.research.elamur.ai/free/en/papers/davidson-2017-automated-hate-speech-detection-problem/) · [De Gibert and colleagues’ forum dataset](https://md.research.elamur.ai/free/en/papers/gibert-2018-hate-speech-dataset-white-supremacy/)

The paper traces part of that variation to inconsistent terminology. Researchers had used overlapping names for categories and drawn boundaries in different places. A category centered on an attack against a demographic group makes a different demand from a category that includes any direct insult. The related work discussed by the authors includes an effort by Founta and colleagues to clarify the relationships among these terms. The authors also point to multilingual shared tasks and language-specific datasets as ways to broaden research beyond English, including the HASOC shared task for Hindi, German, and English, and dataset work on Hindi and Portuguese. To the authors’ knowledge, no comparable public Roman Urdu dataset was available when they undertook the study. [Benchmarking Aggression Identification in Social Media](https://md.research.elamur.ai/free/en/papers/kumar-2018-benchmarking-aggression-identification-social-media/) · [A Hierarchically-Labeled Portuguese Hate Speech Dataset](https://md.research.elamur.ai/free/en/papers/fortuna-2019-hierarchically-labeled-portuguese-hate-speech/)

The authors describe a change in how classifiers represented text. Earlier approaches such as Davidson and colleagues’ used [part-of-speech tags](https://md.research.elamur.ai/free/en/concepts/part-of-speech-tagging/), [TF-IDF](https://md.research.elamur.ai/free/en/concepts/tf-idf/) vectors, emotion lexicons, and [n-grams](https://md.research.elamur.ai/free/en/concepts/n-gram/), which are spans of successive items. Part-of-speech tags give a classifier information about grammatical categories. TF-IDF weights words by how frequent they are in a document and how widely they occur across documents. These representations can make characteristic wording easy for a classifier to recognize. The authors argue that dependence on local features makes it harder to handle subtle cases where an interpretation depends on wording elsewhere in the post.

The paper also describes neural approaches that learn features from examples, including recurrent networks designed to carry information along a sequence. Some earlier systems combined these with methods that were good at recognizing short patterns. Park and Fung combined character-level and word-level convolutions. Other systems combined recurrent classifiers by voting or brought convolutional and recurrent classifiers together. For the Roman Urdu authors, these systems made a case for retaining more than one kind of evidence. They also raised the question of how much of that evidence a single architecture could capture, given the cost and task-specific design of ensembles. [Park and Fung’s study of abusive-language classification](https://md.research.elamur.ai/free/en/papers/park-2017-one-step-two-step-classification/)

Pretrained multilingual representations supplied another direction. The authors note that strong HASOC entries often used an ensemble or adapted multilingual BERT. The experiment they design for Roman Urdu consequently has two levels. One asks how representations compare when left fixed or adapted. The other asks how complete detection systems compare once the representation is paired with a particular classifier. Both are forms of [evaluation and benchmarking](https://md.research.elamur.ai/free/en/topics/evaluation-benchmarks/), but each gives a different meaning to a good score.

### The method, step by step

#### Gathering tweets with and without obvious trigger words

The dataset begins with a search vocabulary. The authors look for Roman Urdu abusive expressions online and interview people to find additional terms. Their lexicon covers general insults and derogatory language as well as terms connected to religious hatred and sexism. It lets them retrieve tweets likely to contain relevant language even though the tweets have yet to be labeled.

They also build a collection of common Roman Urdu words. This second set broadens the retrieval procedure in two ways. It brings in ordinary posts for the Normal category, and it gives the researchers a chance to find offensive posts whose language would escape the abusive-term search. The paper illustrates the latter with a dismissive tweet telling someone to have female relatives take part in a march. The authors treat the tweet as offensive because of the way it brings those relatives into the exchange to demean them. Its wording gives a search based on explicit slurs little to work with. The example separates the job of finding a tweet worth examining from the job of deciding which label it deserves.

The first search yields 20, 000 tweets. The authors inspect the collection to find additional slang and insults and to identify common terms that return tweets often. They drop terms with very few retrievable examples and revise their search vocabulary. The resulting lexicon of hateful terms contains 621 entries. The revised search yields 50, 000 new tweets, from which the researchers randomly sample around 10, 000 for manual labeling. Random selection at that stage takes place within the results of the search. The ordinary and abusive terms used to obtain those results still shape what material is available for sampling.

The authors also impose a maximum of 120 tweets per user. They introduce the cap because a small set of prolific authors could otherwise exert too much influence on the collection. An individual might repeatedly use the same catchphrases, spellings, or forms of address, making author habits easy for a classifier to pick up. The cap reduces the possible contribution of an individual user while leaving room for many examples that belong to the same author.

#### Turning a collection into a labeled task

The authors use manual [linguistic annotation](https://md.research.elamur.ai/free/en/concepts/annotation/) to establish the reference labels. Three annotators work independently. When their judgments differ, the majority determines the label. A tweet is discarded if they cannot reach a majority or if it gives them too little information to assign a label. A randomly selected replacement comes from the tweet collection. This procedure gives the retained examples a definite answer for evaluation and makes the ability to decide from the available material part of the selection process.

The coarse-grained task uses Hate-Offensive for the flagged material and Normal for inoffensive material. The fine-grained task retains Normal and has separate categories for different types of harmful or vulgar expression. The same tweet can thus be classified at a level where the question is whether it belongs in a flagged category and at a level where the nature of the language matters. The distinction is central to interpreting the results, because the finer task counts a confusion between harmful categories as an error even when the tweet would go on the correct side of the coarse division.

The Abusive/Offensive label covers strongly rude or vulgar language directed at someone. A target can be a person or a group. What makes the expression fit is its use as an insult or a hurtful address. Profane applies to vulgar or obscene language used without an intended target. Knowing the meaning of a vulgar word can therefore establish a property shared by both classes. Assigning either class requires a judgment about the direction of the expression. One way to see the distinction in the paper’s examples is to compare a personal rebuke with a vulgar outburst attached to a complaint.

Sexism concerns hatred directed at a person or group on the basis of gender or sexual orientation. Religious Hate covers attacks grounded in religious belief or its absence, as well as the use of religion to spread hatred or incite violence against a target. When a tweet uses both an insult and a reference to religious identity, the role of the identity reference matters to the label. The authors retain Sexism and Religious Hate as separate categories because combining them would remove the distinction in subject matter that the fine-grained task is meant to test. Normal covers material outside the other categories.

The annotation scheme gives these categories boundaries even though an ordinary tweet can combine features that point in several directions. For example, a personal attack can use a gendered term, while an expression of religious hatred can include general obscenity. The dataset assigns a reference class for the classification task. It thereby tests whether a system can make the choice encoded by those labels, in addition to recognizing cues that the categories share.

#### Preparing text representations

An embedding gives a classifier numbers to work with in place of text. At word level, each position is represented by a vector, an ordered list of numbers. The position in the sequence allows a convolution to examine nearby vectors, and the numbers give it a description of the word from which it can learn patterns. The paper compares several sources of these representations. Some were pretrained for use beyond this dataset, while the authors train RomUrEm on tweets to create a reference specific to Roman Urdu and its social media setting.

The pretrained comparison includes [LASER](https://md.research.elamur.ai/free/en/papers/artetxe-2018-massively-multilingual-sentence-embeddings-zero/) and [ELMo](https://md.research.elamur.ai/free/en/papers/peters-2018-deep-contextualized-word-representations/), as well as base BERT. It also includes [XLM-RoBERTa](https://md.research.elamur.ai/free/en/papers/conneau-2020-unsupervised-cross-lingual-representation-learning/) and [FastText](https://md.research.elamur.ai/free/en/papers/bojanowski-2017-enriching-word-vectors-subword-information/). These names refer to the sources of the representations under comparison. The authors use tokenizers from Hugging Face in their experiments. [Tokenization](https://md.research.elamur.ai/free/en/concepts/tokenization/) is the step that divides a text into the units a representation can process. The choice matters here because the same informal expression may appear with different spellings, and an input may switch languages within the span being divided.

The comparison without fine-tuning measures how the representations work while their pretrained values are kept fixed. With fine-tuning, the labeled RUHSOLD examples can change the representation. A system may then use distinctions helpful for these particular labels even if they had little importance in its original training. This is the transfer-learning comparison in the paper. Training on a different collection supplies the starting point, and task-specific adaptation can make that starting point more useful. The comparison also includes RomUrEm in both conditions. Improving RomUrEm after fine-tuning is evidence about further adaptation of an already domain-specific representation.

To train RomUrEm, the authors gather 4, 770, 677 random and hateful tweets through the Twitter API. They use [word2vec](https://md.research.elamur.ai/free/en/papers/mikolov-2013-distributed-representations-words-phrases-their/) to learn embeddings with 200 dimensions. The window size is 5, which sets the scope of surrounding words used during embedding training. A minimum word count of 2 controls which words are frequent enough to be included. The authors set the number of pretraining iterations to 10. This training is separate from using the manually labeled examples to learn a detection task. The paper reports public availability of RomUrEm, the lexicon, and the dataset splits, and identifies a companion code repository.

#### From individual positions to wider patterns

CNN-gram begins with a sequence of vectors for a tweet. In the paper’s notation, the input is a matrix with the following shape.

```
l × d
```

The symbol `l` is the number of words in the tweet in the architecture’s description. The symbol `d` is the dimensionality of the embedding for each word. The multiplication sign `×` separates the dimensions of the matrix. Each row is a position in the tweet, and each column holds one component of that position’s embedding. The paper names the operations used to turn that input into a prediction without giving separate equations for them.

A convolution applies a learned filter across the input sequence. At each position, the filter produces an activation, a value that reflects how strongly the local input matches the pattern the filter has learned. Applying the same filter successively gives a feature map, a sequence of activation values. In the first CNN-gram layer, a kernel size of 1 limits the filter to an individual input position. The activation function, ReLU, suppresses negative values and passes positive ones through. The resulting map can give a strong response wherever a learned word-level cue occurs.

This first map goes through max pooling and average pooling, each with a pool size of 2. A pooling operation summarizes nearby values. Max pooling preserves the largest activation in the region and reduces the length of the sequence that continues through the network. Average pooling records the local average, which gives a different account of the strength of the feature in that region. A narrow spike can dominate the maximum while having a more modest effect on the mean. Conversely, fairly strong values across a window can give a high average even when none is as extreme as the largest spike elsewhere.

The next convolution receives the max-pooled output. Its kernel size of 2 lets it combine evidence across neighboring positions in that shorter sequence. Another pair of pooling operations follows. The third and fourth convolutions work in the same progression, with widths associated by the authors with trigram and quad-gram features. At each stage the max-pooled sequence is the one passed forward, while both types of pooled feature map are retained for the later combination.

This order of operations gives the architecture its name, but the authors qualify the meaning of the wider n-grams. A filter that spans neighboring positions after pooling is operating on summaries of the preceding feature map. Its inputs may reflect strong cues from different parts of their respective windows. Beyond the first layer, the widths are therefore best understood as spans over the forwarded features. The network can combine evidence over a broader region of the tweet as it goes deeper, and the exact relationship between a learned response and a contiguous phrase in the original text depends on the preceding operations.

How CNN-gram assigns a tweet label The steps in order.

#### Combining and classifying the evidence

The concatenation step joins the saved outputs of the max and average pooling branches from all convolutional stages. An early feature can reach the decision even when it has little effect on a later convolution. A later feature can contribute evidence that depends on combinations built farther along the network. Retaining outputs from different depths gives the final classifier access to both.

The combined maps feed global max pooling and global average pooling in parallel. Here the summary is across the whole extent of a feature map. The maximum records the strongest response available for a filter, and the average records the overall level of response. The two sets of summaries are concatenated and passed to two fully connected layers. Each such layer can combine the features it receives, and the authors use this part of the network to reduce the representation to smaller dimensions before predicting a class.

The paper reports dropout and batch normalization after the fully connected layers. Dropout randomly suppresses part of the representation during training, reducing the extent to which features can learn to depend on always appearing together. Batch normalization adjusts activation values using statistics from training batches. The final softmax turns output scores into a distribution over the classes for the task. Categorical cross-entropy is the loss used to train the network. It penalizes the system when it assigns little probability to the reference label. This training objective and the macro F1 used in reporting serve different jobs. The loss guides updates for labeled examples, while the reported metric summarizes class-level performance after predictions have been made.

#### Choosing settings and deciding when to stop

The authors say they choose the convolutional filter counts and dense-layer widths empirically and place those settings in the architecture figure. For the other hyper-parameters, they search over candidate settings using the validation split and frozen RomUrEm embeddings. The selected dropout rate is 0.5. They choose Adam over Adadelta and SGD as the optimizer, which is the procedure that uses the loss to update the trainable weights. They select a learning rate of 0.002, the setting that governs the size of the updates. The validation search establishes how these settings were chosen for the reported architecture. The paper does not give a score for every point in that search.

CNN-gram is implemented in Python with Keras and a TensorFlow backend, and the paper reports using an Nvidia 1080Ti. Network weights start from random values, and the authors fix the random seed across experiments to control one source of run-to-run variation. They set training to run for up to 200 epochs, where an epoch is a pass through the training material. They stop if the validation error has failed to decrease for 15 epochs. Separately, they save the weights at the epoch that gives the best validation performance. It is that saved checkpoint that goes to the test split.

These roles for the splits keep several decisions apart. Training determines the weights from labeled examples. Validation helps pick hyper-parameters, determines which checkpoint to save, and governs stopping. The final evaluation measures predictions on the test material. A reported test result is therefore tied to the weight selection and settings produced by that procedure.

### Experiments and results

#### What is in the benchmark

RUHSOLD contains 10, 012 labeled tweets. The fine-grained class counts are 2, 402 for Abusive/Offensive, 839 for Sexism, 782 for Religious Hate, 640 for Profane, and 5, 349 for Normal. Normal is the largest individual class in the dataset, and Abusive/Offensive is the most common of the harmful or vulgar categories. Profane has the fewest labeled examples. The same collection underlies the coarse task, in which the finer distinctions within Hate-Offensive are collapsed.

The paper reports using stratification by fine-grained labels when creating the splits. Stratification means that members of each class are apportioned across the splits with the aim of preserving their relative prevalence. It gives smaller classes a presence in training, validation, and test while carrying the dataset’s imbalance into each. The intended train, test, and validation ratio is given as `70,20,10`. The paper also lists 7, 209 tweets for training, 2003 for test, and 801 for validation. The reported split counts do not reconcile exactly with the stated dataset total and ratio. The task results are presented as results on the test split.

The paper reports accuracy and macro-averaged precision, recall, and F1. Accuracy counts how frequently the predicted label agrees with the reference label across all tweets. For a particular class, precision asks how many predictions of that class are correct. Recall asks how many of its reference examples the classifier successfully finds. A class’s F1 brings precision and recall together through their harmonic mean, so a class benefits from doing well on both. Macro averaging gives each class equal influence on the reported average. A classifier can consequently get much of a large class right and still have a modest macro F1 if it performs poorly on other categories. This is especially important for interpreting the fine-grained results, where the counts vary markedly across classes.

#### What the baselines test

The authors reimplement baselines using their companion code where available and their published descriptions otherwise. They choose systems with a record of performing well on related tasks. This lets the comparison cover several ways of using words, contextual representations, and multiple classifiers. The systems come from different original datasets, so their status as strong performers elsewhere is a reason to include them. Their behavior on RUHSOLD is what the paper measures.

LSTM+GBDT combines a long short-term memory network with gradient-boosted decision trees. A long short-term memory network processes a sequence with a state that can carry information across positions. The system in the original study used randomly initialized embeddings. BiLSTM with Attention is another recurrent baseline. Its bidirectional arrangement processes the text in both directions, and its attention component gives different parts of that sequence different influence on the decision. Together, these baselines let the reader see how two sequence-oriented approaches fare, one in combination with a tree method and the other with an attention mechanism.

FastText+CNN pairs FastText representations with a convolutional classifier. Domain Embeddings+CNN uses a convolutional classifier with task-relevant embeddings, taking RomUrEm as the Roman Urdu counterpart of the original system’s tweet embeddings. This baseline is particularly useful for distinguishing two uses of RomUrEm in the results. The comparison includes a conventional CNN supplied with RomUrEm and a CNN-gram variant supplied with the same source of embeddings. The standalone representation experiment provides another result for RomUrEm in its own setup.

The remaining baselines broaden the comparison. BERT+LAMB pairs pretrained BERT with the LAMB optimizer. BERT+LASER+GBDT brings together BERT and LASER representations with a gradient-boosted tree classifier. SVM+RF+AB combines a linear support vector machine, a random forest, and AdaBoost, with voting mechanisms for combining decisions. These approaches had been used for different languages or task definitions in HASOC. The authors evaluate their reimplementations against the same Roman Urdu labels as CNN-gram.

#### Coarse-grained detection

In the standalone coarse-grained experiment, fixed RomUrEm achieves a test macro F1 of 0.84, the strongest result under that condition. Fixed ELMo follows at 0.80. LASER is at 0.74 and FastText is at 0.73. BERT starts at 0.67, while XLM-RoBERTa records 0.35. The order is relevant to the paper’s question about data. A representation learned from Roman Urdu tweets, including hateful material, offers a strong starting point for separating the flagged and normal tweets. Several broader representations start well below it on this test.

Fine-tuning changes that order. BERT reaches 0.89 macro F1, the highest in the standalone coarse test. FastText and RomUrEm reach 0.88. XLM-RoBERTa reaches 0.85 after starting with the lowest frozen result. These are scores for the embedding comparison, which the authors distinguish from the experiments with a downstream architecture. They show what adaptation does in that comparison and explain why the authors bring several of those representations into CNN-gram.

Selected systems on RUHSOLD coarse-grained test macro F1 BERT with CNN-gram matches the leading voting ensemble, while the choice of embedding changes CNN-gram performance.

**The numbers**

| System or setting | macro F1 |
| --- | --- |
| SVM+RF+AB | 0.90 |
| BERT+LAMB | 0.89 |
| BERT+LASER+GBDT | 0.89 |
| LSTM+GBDT | 0.38 |
| BERT+CNN-gram (this paper) | 0.90 |
| RomUrEm+CNN-gram | 0.89 |
| XLM-RoBERTa+CNN-gram | 0.88 |
| FastText+CNN-gram | 0.80 |

Among the complete systems, BERT+CNN-gram and SVM+RF+AB both achieve 0.90 macro F1 on the coarse test. Their reported accuracies are also both 0.90. The result puts the best CNN-gram variant level with the leading voting ensemble at the reported precision. The comparisons against the BERT baselines are close. BERT+LAMB and BERT+LASER+GBDT each reach 0.89 macro F1. Domain Embeddings+CNN reaches 0.88, FastText+CNN reaches 0.87, and BiLSTM with Attention reaches 0.85.

LSTM+GBDT records 0.38 macro F1, the lowest coarse result among the baselines. Its accuracy is 0.54. The authors use that comparison to discuss whether capturing order and longer dependencies gives this particular system enough information for RUHSOLD. The result concerns the implementation as a whole, which differs from the stronger systems in multiple respects. The attention-based recurrent baseline’s 0.85 macro F1 also shows how much performance differs across the two recurrent approaches in this benchmark.

Changing the representation within CNN-gram gives coarse test macro F1 values of 0.89 with RomUrEm and 0.88 with XLM-RoBERTa. With FastText the value is 0.80. FastText had reached 0.88 after tuning in the standalone experiment. Its weaker result in CNN-gram, and its 0.87 in the FastText+CNN baseline, illustrate why an embedding comparison and an architecture comparison answer different questions. A strong score in one representation setup gives a reason to try the representation elsewhere. The result still depends on the system it is placed in.

#### Fine-grained detection

The fine-grained embedding experiment starts with lower frozen scores. ELMo and RomUrEm tie at 0.56 macro F1 on the test set. LASER reaches 0.46. BERT and FastText reach 0.37 and 0.35, respectively, while XLM-RoBERTa reaches 0.14. In this setting, the advantage of RomUrEm over all the pretrained alternatives disappears because ELMo is already level with it. The frozen results also show how poorly some of the representations initially support a decision among the finer categories.

Fine-tuning in the standalone RUHSOLD fine-grained test Fine-tuning puts XLM-RoBERTa ahead of BERT and RomUrEm, while ELMo has a higher score when kept fixed.

**The numbers**

| System or setting | macro F1 |
| --- | --- |
| XLM-RoBERTa fixed | 0.14 |
| XLM-RoBERTa fine-tuned (this paper) | 0.72 |
| BERT fixed | 0.37 |
| BERT fine-tuned | 0.67 |
| RomUrEm fixed | 0.56 |
| RomUrEm fine-tuned | 0.67 |
| ELMo fixed | 0.56 |
| ELMo fine-tuned | 0.55 |

XLM-RoBERTa reaches 0.72 macro F1 after fine-tuning, the strongest standalone fine-grained result. BERT and RomUrEm both reach 0.67. Fine-tuned FastText reaches 0.66 and LASER reaches 0.54. ELMo is the exception to the general pattern in this comparison, with 0.55 after adaptation and 0.56 before it. BERT and XLM-RoBERTa have both moved ahead of their own frozen results, but with a different order from the coarse test, where the tuned BERT representation was the strongest.

The fine-grained classifier comparison offers the clearest reported advantage for BERT+CNN-gram. It reaches 0.75 macro F1 and 0.82 accuracy on the test split. The best baseline by macro F1 is BERT+LAMB at 0.72 with 0.80 accuracy. The table reports macro precision of 0.81 for BERT+CNN-gram and 0.72 for BERT+LAMB, while their macro recall values are 0.66 and 0.73, respectively. The higher macro F1 for CNN-gram thus comes with higher reported macro precision and lower reported macro recall in this comparison. The aggregate result alone would hide that tradeoff.

Selected systems on RUHSOLD fine-grained test macro F1 BERT with CNN-gram ranks above the leading baselines on the finer labels.

**The numbers**

| System or setting | macro F1 |
| --- | --- |
| BERT+CNN-gram (this paper) | 0.75 |
| BERT+LAMB | 0.72 |
| BERT+LASER+GBDT | 0.71 |
| FastText+CNN | 0.68 |
| SVM+RF+AB | 0.67 |
| BiLSTM with Attention | 0.65 |
| Domain Embeddings+CNN | 0.55 |
| LSTM+GBDT | 0.15 |

The coarse-grained leader among the baselines, SVM+RF+AB, reaches 0.67 macro F1 in the fine-grained test. BERT+LASER+GBDT reaches 0.71 and FastText+CNN reaches 0.68. The domain-embedding CNN baseline records 0.55. LSTM+GBDT remains at the bottom of the comparison at 0.15 macro F1, although it scores 0.53 in accuracy. The difference between its accuracy and macro F1 makes the choice of metric consequential. Getting a substantial share of individual tweets right can coexist with weak class-balanced performance. The aggregate values identify that pattern without specifying which labels account for it.

For two of the fine-grained CNN-gram variants, the paper gives conflicting macro F1 values. Its results table lists 0.68 for XLM-RoBERTa+CNN-gram and 0.61 for FastText+CNN-gram. The accompanying discussion gives 0.72 and 0.42, respectively. Both presentations put XLM-RoBERTa ahead of RomUrEm+CNN-gram at 0.64 and FastText behind it, but the magnitude of their performance is uncertain. In particular, the claim in the discussion that XLM-RoBERTa+CNN-gram ties BERT+LAMB depends on which value is used. The table and discussion agree on the leading CNN-gram result of 0.75 with BERT and on the best baseline’s 0.72.

### What the ablations show

The paper has no component-removal ablation of CNN-gram, and its evidence about the system comes from fine-tuning comparisons, embedding substitutions, comparisons across the two tasks, and inspection of selected predictions.

#### What changes when the representation can adapt

The closest comparison to a controlled intervention is the fixed-versus-fine-tuned test. The source of the representation stays the same, while the permission to update it on RUHSOLD changes. That makes the paired results more informative about adaptation than a comparison between embeddings trained on different material. XLM-RoBERTa gives the clearest example. Its coarse test macro F1 rises from 0.35 to 0.85, and its fine test macro F1 rises from 0.14 to 0.72. The paper gives the fine-grained improvement as 0.58. Using only the frozen results would have made it the weakest candidate in both standalone tasks, even though it ends up in a strong position once it can adapt.

BERT provides a second example with a different pattern of rankings. It has the strongest tuned result for the standalone coarse task, while XLM-RoBERTa takes the lead on the finer labels. With CNN-gram, BERT is the leading representation for both tasks. The results therefore support a claim about the value of adaptation and a separate claim about the best tested pairing for these tasks. The data give no direct measure of which word forms or semantic features changed during adaptation. The evidence is the improvement in held-out classification.

The RomUrEm comparison supplies a useful qualification. Its strong frozen coarse result is consistent with an advantage from training on tweets that include the kind of language the authors want to detect. Its improvement after tuning shows that domain-specific pretraining and adaptation to the labeled task can both contribute to performance. ELMo’s fine-grained result supplies a further qualification. In that pairing of representation and task, tuning gives a slightly lower score. Both qualifications matter because they keep the argument tied to the actual comparisons. The experiment supports fine-tuning as a productive option for several of the tested representations, with its effect dependent on the starting point and the decision being learned.

#### What changes when CNN-gram receives different embeddings

Holding the named architecture fixed and swapping the embedding source tests CNN-gram’s dependence on its inputs. On the coarse task, the configurations span 0.90 macro F1 with BERT to 0.80 with FastText. The tested choice of embedding has a visible effect even when the same architecture name and label inventory apply. On the fine task, both the prose and the results table put BERT first and FastText last among the CNN-gram variants, although they disagree on some of the exact values. Together, these comparisons make the strongest result a property of a particular pairing.

Comparisons with baselines test the whole classifier. BERT+LAMB brings BERT into the same benchmark, and the BERT+CNN-gram advantage on the finer task gives some evidence that the way BERT is used matters. The RomUrEm baseline offers a related comparison with a representation learned from tweets. RomUrEm+CNN-gram gives 0.64 fine-grained macro F1, while Domain Embeddings+CNN gives 0.55 in the same task. These comparisons can guide an interpretation of the architecture’s contribution, but the systems differ in several choices. They leave open whether a particular convolutional width, the combination of pooling operations, or the dense classifier accounts for any part of the improvement.

The validation search serves a different purpose. It selects a combination of training settings for CNN-gram using a particular embedding condition. A reported preference for Adam or for dropout at 0.5 identifies the chosen configuration. Without the individual validation results or matched component-removal runs, it gives no estimate of how much of the final test result depends on a particular setting. This distinction keeps evidence about how the authors arrived at a working implementation separate from evidence about why the implementation performed as it did.

#### Where the two strongest systems agree and disagree

The authors illustrate classification errors with fine-grained predictions from BERT+LAMB and BERT+CNN-gram. Two examples carry an Abusive/Offensive reference label and are classified as Profane by both systems. One is a rebuke aimed at people accused of using someone during a show. The other contains vulgar language alongside a statement aimed at particular people. In both examples, the systems’ label captures the presence of profanity but misses the reference judgment about targeting. Under the coarse label scheme, such a choice between two flagged categories would cease to be a fine-grained error.

On a short dismissal telling someone to be quiet and go away, BERT+LAMB predicts Normal and BERT+CNN-gram identifies Abusive/Offensive, the reference label. Another example accuses someone, in insulting terms, of spreading myths. BERT+LAMB assigns Sexism and BERT+CNN-gram assigns Abusive/Offensive. These cases illustrate different boundaries. The first is between ordinary language and a directed offense. The second is between a general insult and an attack classified by the basis of its hostility. The selected examples show that the proposed system sometimes makes the annotation scheme’s intended distinction when the leading baseline does not.

A shared error goes in the other direction. Both systems classify a tweet involving a possessive remark and a reference to telling the other person’s mother as Abusive/Offensive, while the reference label is Normal. The example shows that signs of an interpersonal exchange can coexist with a normal reference judgment. A classifier that picks up who is being addressed still needs evidence that the message is using that address to insult or harm. For this dataset, identifying a target and identifying an abusive act are related decisions with different evidence.

The authors emphasize confusion between targeted abuse and untargeted profanity and identify it as a direction for future investigation. The examples are enough to show how the confusion can arise and why the fine-grained task detects it. They are a selected set of predictions, so they leave the benchmark-wide frequency and distribution of those confusions open. In particular, they cannot establish how much of the overall change in macro F1 is explained by this boundary.

### Limitations

#### Limits the authors identify

The clearest stated limit is the trouble both leading classifiers have with the boundary between directed abuse and profanity without an intended target. The authors treat this as a semantic problem. Recognizing a vulgar form, even under informal spelling or code-switching, can be easier than determining the role it plays in the tweet. An insult can be aimed at an individual with little explicit wording, and an obscenity can appear in a complaint without performing that role. The authors call for further study of such cases at the fine-grained level.

The authors also qualify their interpretation of RomUrEm. Its pretraining collection already includes hateful tweets, so its strong frozen performance has a different meaning from strong adaptation of a representation trained on more general material. RomUrEm supplies a domain-specific benchmark for judging the transfer results. Its fine-tuning result shows what happens when the labeled task further shapes a representation that already has that domain exposure. This qualification is important when reading the broader conclusion that adapting existing embeddings can be preferable to training them from scratch. The relative performance changes with the task, the adaptation condition, and the classifier.

The paper acknowledges a limit in its account of CNN-gram’s wider patterns. Pooling reduces the map between convolutions, retaining strong activations for the next layer. The wider layers consequently operate over forwarded features. Their widths give a way to combine evidence at different scales, but interpreting a particular higher-layer response as a literal bigram, trigram, or quad-gram in the tweet would require tracing it through the preceding pooling decisions.

#### Limits visible in the setup

Keyword retrieval shapes the population from which RUHSOLD is drawn. Searching ordinary words helps broaden it, and manual labeling can assign any of the dataset’s classes to the retrieved tweets. The method still gives an advantage in collection to language that happens to contain a search term. An abusive expression that uses a new spelling, an unfamiliar euphemism, or a conversational reference with little standalone meaning may have fewer opportunities to enter the dataset. The label counts describe the resulting benchmark. Estimating how frequently these categories occur in all Roman Urdu tweets would require a sampling design aimed at that question.

The annotation procedure similarly affects which examples remain. Majority voting gives the benchmark a reproducible decision rule for disagreements, and replacing unresolved or under-informative tweets makes the reference set easier to score. Performance on the retained set consequently describes cases on which the annotators could make a decision under the study’s rules. The procedure leaves open how the systems respond when trained reviewers reasonably disagree or when an interpretation requires a conversational turn outside the tweet. Those cases may be especially relevant when the wider application involves reporting systems or human review.

The user cap addresses the contribution of prolific authors. The reported splitting procedure stratifies on class, and the paper gives no result for a split that holds authors out as groups. It therefore leaves open how well the systems work on authors entirely unseen during training. The difference matters because similar phrases or spellings from the same author can supply recurring cues. The reported test characterizes performance within this dataset construction. Comparisons across different authors, platforms, or time periods remain unmeasured.

The classification scheme offers specific distinctions selected for the demographic and task described by the authors. It gives a single answer for evaluation even when a tweet contains several kinds of offensive evidence. For example, a tweet can direct profanity at someone and express hatred on a religious basis. The benchmark tests agreement with the selected category in such a case. It leaves multi-label detection, the identification of the precise target, and the location of the offensive span outside the reported evaluation. Macro F1 is an average over the available categories and does not on its own establish recall or precision for any particular affected group.

The evidence for the leading architecture comes from one benchmark and a fixed random seed. The reported scores establish the order and ties for the evaluated runs, subject to the discrepancies in the paper’s fine-grained score reporting. The comparison gives no range across independent seeds, sampled splits, or repeated training runs. The paper also discusses ensembles as costly, but reports no matched comparison of training or inference cost. Its robustness claim is most directly supported in the sense that the BERT variant of CNN-gram is competitive on both label resolutions. Error variation across test populations and the operational cost of deploying the system remain open.

The aggregate metrics also leave deployment choices unresolved. A classifier used for review may be asked to prioritize catching targeted attacks or to avoid sending ordinary conversations for unnecessary scrutiny. Those goals place different weight on recall and precision, and the fine-grained BERT comparison shows that the stronger result on macro F1 can come with lower macro recall. The benchmark compares assigned labels against reference judgments. It leaves questions about how a moderation process would use those predictions, how uncertain cases should be handled, and how such a process would affect people outside the scope of the measured results.

### What came after

Later citations place the Roman Urdu study in several neighboring lines of research. The clearest continuation of the detection task is the 2026 paper on prompt-driven detection of offensive Urdu language. Its title identifies the shared problem and a change of method. The Roman Urdu paper learns a classifier from labeled examples with a choice of text representations. The later work approaches offensive Urdu detection through prompting. The citation connects the two approaches at the level of the detection problem. Whether the later work trains or evaluates on RUHSOLD, uses the same labels, or compares directly with CNN-gram remains unspecified. [Prompt-driven Detection of Offensive Urdu Language](https://md.research.elamur.ai/free/en/papers/maab-2026-prompt-driven-detection-offensive-urdu/)

The 2025 survey addresses cultural awareness in text and beyond. Its citation places the paper in a broader area concerned with the cultural setting of language technology. In the Roman Urdu study, that setting enters concretely through choices about which spellings and expressions to search for, which categories to annotate, and when an expression counts as a targeted insult. Those are aspects of the original paper that make the connection intelligible to a reader of the survey. The specific findings the survey draws from RUHSOLD and the role it gives the dataset are unspecified. [Survey of Cultural Awareness](https://md.research.elamur.ai/free/en/papers/pawar-2025-survey-cultural-awareness-language-models/)

The work by Abercrombie and colleagues connects the study to resources for the automated identification of gender-related online language. The Roman Urdu benchmark is relevant to that topic because Sexism is a distinct label. It lets the study treat a gender-based attack as a category in its own right alongside personal abuse, religious hatred, and untargeted profanity. The citation establishes a connection to work on identification resources. It leaves open whether that work incorporates RUHSOLD, compares its annotation choices with other resources, or cites the Roman Urdu paper for a narrower point. [Abercrombie and colleagues’ work on automated identification resources](https://md.research.elamur.ai/free/en/papers/abercrombie-2023-resources-automated-identification-online-gender/)

## Cite

Cite as Hammad Rizwan, Muhammad Haroon Shakeel and Asim Karim. 2020. Hate-Speech and Offensive Language Detection in Roman Urdu. Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP).

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.18653/v1/2020.emnlp-main.197](https://doi.org/10.18653/v1/2020.emnlp-main.197)

```bibtex
@inproceedings{rizwan2020hate,
  title = {{Hate-Speech and Offensive Language Detection in Roman Urdu}},
  author = {Hammad Rizwan, Muhammad Haroon Shakeel and Asim Karim},
  booktitle = {Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)},
  year = {2020},
  doi = {10.18653/v1/2020.emnlp-main.197},
  url = {https://doi.org/10.18653/v1/2020.emnlp-main.197}
}
```

> 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)
