Elamur Research

Offensive Language Detection in Nepali Social Media

Paper · 2021 · Nobal B. Niraula, Saurab Dulal and Diwa Koirala

Summary

A Nepali social media comment may be written in Devanagari, in Roman letters, or in both. Even within a single script, people can spell the same word differently. An offensive meaning may also depend on how a word is used. A word for an animal can be literal in one comment and an insult in another. These are different problems for anyone trying to flag potentially harmful posts. Niraula and colleagues study both by collecting and labeling Nepali social media text, testing ways to make its written forms more consistent, and measuring how well classifiers reproduce human judgments.

The authors assembled a pool of over 15,000 posts and comments from Facebook, Twitter, YouTube, blogs, and news sites. They sought out material likely to contain offensive language so that annotators would encounter enough of it to study. The annotators assigned labels for non-offensive content, racist content, sexist content, and other offensive content. The released dataset contains 7248 records after duplicates were removed. The paper uses this dataset for a broad question about whether a post is offensive and a more detailed question about which kind of offense it contains.

Converting Devanagari text to Roman letters was especially helpful when the classifier relied on whole words and adjacent word pairs. Features built from short character sequences were already more effective than word features alone in most of the preprocessing comparisons. The strongest tested preprocessing configuration for offensive-class F1 combined spelling normalization, Romanization, and both kinds of text features. In the separate comparison of binary classifiers, a random forest reached offensive-class F1 of 0.73 on the test set, compared with 0.58 for a dictionary rule and 0.59 for multilingual BERT. Logistic regression had the highest reported F1 for the non-offensive class, at 0.87.

The finer labels were harder to recover. The authors first flagged offensive posts with a random forest, then used a separate forest to assign the flagged posts to an offensive category. The paper reports test F1 of 0.71 for other offensive content, 0.45 for racist content, and 0.01 for sexist content. The sexist row contains an inconsistency among its reported metrics, so its F1 warrants particular caution. The authors point to limited training examples for that category and show how errors can depend on cultural or situational knowledge. The corpus and experiments establish a starting point for evaluating Nepali offensive-language detection, with human review still important when a flag could have consequences for a user.

Deep dive: Offensive Language Detection in Nepali Social Media

A study of offensive language detection in Nepali social media, with annotated comments, spelling normalization, and tests of binary and detailed labels. · about 32 minutes to read

The problem and its context

Screening a stream of posts

A moderator can read a comment for its meaning, consider the surrounding discussion, and decide whether the language crosses a threshold. Doing that for every new post becomes costly when many users contribute over a short period. The paper describes two possible roles for automation. A system might screen text before publication, or it might flag material for a moderator to inspect. Both roles depend on recognizing potentially harmful language, but the cost of an error differs. A mistaken flag creates work for a reviewer. A mistaken decision that directly prevents publication affects the person who wrote the comment.

Offensive language is the broader object of the study. The authors include cases such as personal attacks and hostile language directed at organizations alongside identity-related attacks. Hate speech, as they describe it, disparages people on the basis of a characteristic such as ethnicity, gender, or religion. This distinction affects the design of a text classification task. A post can qualify as offensive under a broad rubric even when it lacks the form of group-directed abuse that a narrower study would try to identify.

The authors' survey of Nepali social media led them to emphasize racist and sexist language as distinct categories. Their use of the racist label includes examples involving caste and ethnicity, and their discussion connects some posts with social tensions involving regional identities as well. They also encountered attacks involving religion, insults directed at individuals or organizations, swearing, and violent rhetoric. The study discusses a wider range of conduct than its final labels can describe separately. For instance, the released classification scheme has no dedicated label for religious hostility.

Cultural knowledge matters when interpreting such examples. A caste name can be part of a speaker's ordinary description of their own identity. Used as part of a disparaging expression, it can contribute to a racist attack under the study's rubric. The paper also describes an idiom involving caste whose offensive status has changed in how it is understood. These examples explain why a list of apparently suspect words offers an incomplete account of the task. The judgment concerns what the utterance does in its setting.

A shared script is only part of the problem

As the authors describe the field, English and German had received much more attention by the time they carried out the Nepali study. Researchers could already draw on supervised machine learning experiments and organized evaluations in those languages. In supervised classification, a system is trained on examples that have been assigned target labels. The classifier then receives new examples, and researchers compare its predictions with human labels that were held out of training. An annotated dataset is therefore part of the experimental infrastructure, as important to defining the task as the choice of classifier.

The authors knew of work on Hindi, which shares the Devanagari script with Nepali. They give several reasons to expect difficulty when directly applying a Hindi system to Nepali. Vocabulary and grammar differ, and the cultural and social references that give an expression its force can differ too. A system might process the same characters in both languages while still assigning the wrong interpretation to a phrase. The script is only the visible part of what it needs to handle.

Nepali also presents difficulties within a single post. People write the language in Devanagari and in pronunciation-based Roman spellings, and they can mix the scripts. The paper discusses English text and language mixing involving Nepali and English, as well as examples involving Hindi and Maithili. Script and language are separate properties. A post in Roman letters may be Nepali, and a mixed-script post can contain both Nepali and English. Recognizing that two scripts can encode the same Nepali word is a different problem from interpreting a switch between languages.

Spelling variation adds another layer. Writers may choose characters with similar pronunciations, and Roman spellings can differ over how to represent a sound. The paper illustrates this with variants of an insulting phrase written in Devanagari, Roman letters, and combinations of the two. A classifier that gives each full spelling its own feature treats variants as separate observations. With limited labeled material, that can spread evidence about a recurring expression across features that each occur infrequently.

The authors also emphasize Nepali morphology, the system by which words take different forms. They describe a verb whose forms vary with such properties as tense, number, gender, and honorific distinctions. Two forms related to the same verb may therefore look different even when both have been written consistently. The authors describe a shortage of basic resources for Nepali at the time, including a suitable standard vocabulary, practical lemmatization that would identify base forms, and a reliable part-of-speech tagger. Their treatment of Nepali as one of the low-resource languages concerns this availability of tools and data.

How earlier studies framed their labels

The research reviewed in the paper provides precedents for both broad and detailed classification. The survey by Schmidt and Wiegand is the authors' point of reference for the range of features, algorithms, and annotation schemes used in hate-speech detection. They also describe shared evaluations for Wikipedia comments, aggression in Hindi and English Facebook material, and offensive language in German tweets. Such evaluations provide labeled examples and a common task. What they distribute also reflects a decision about which distinctions participants should learn to reproduce. Benchmarking Aggression Identification in Social Media

In the English Twitter work by Davidson and colleagues, a tweet could receive a hate-speech label, an offensive-language label, or a label for neither. The study trained separate classifiers to distinguish each class from the rest, then selected the class with the highest predicted probability. Niraula and colleagues point out that strong aggregate performance coexisted with weaker performance on hate speech itself. That earlier result motivates attention to the individual classes. Good performance on the most common decisions can coexist with weak performance on a category that motivated the research. Davidson and colleagues' study of hate speech and offensive language

The paper also recounts an English experiment that distinguished racism, sexism, their co-occurrence, and non-hate speech. Gambäck and Sikdar used a convolutional neural network for that task and drew on Twitter data associated with Waseem's work on annotation. This gives a precedent for distinguishing racist and sexist material, while illustrating that different studies can design different sets of allowable answers. The Nepali dataset assigns a single label to each record. Its categories do not include a separate label for co-occurring racism and sexism. Gambäck and Sikdar's hate-speech classifier and Waseem's study of annotator influence

For German, the paper describes a shared task that asked for a broad offensive-versus-other decision and a finer distinction among profanity, insult, abuse, and other material. The resemblance to the Nepali work is in the levels of classification. The actual fine-grained labels differ. Results obtained under the German labels therefore concern a different set of distinctions, even though the structure of the evaluation suggests a useful way to ask how much detail a system can recover.

The closest Nepali work the authors identify is their earlier study of linguistic taboos and euphemisms. It examined how offensive expressions are formed and assembled a list of terms. The new study uses that list to construct a dictionary baseline and to supply features to trained classifiers. It also changes the unit of investigation. A list can describe particular words and expressions; an annotated post corpus makes it possible to test how well those clues work when the decision concerns a whole utterance.

The method, step by step

Building a pool with enough offensive examples

The starting point was a collection of posts and comments likely to give annotators a useful range of cases. The authors reasoned that taking a broad sample without any targeting would yield relatively few hate-speech examples for the amount of reading it required. They therefore sought material from sources where offensive comments were more likely to occur. They also included material from sources they regarded as neutral or noncontroversial. The resulting pool contained over 15,000 records drawn from several kinds of online discussion.

On Facebook, the authors identified potentially controversial posts shared with general audiences on public pages and in open groups. Those posts dated from 2017 to 2019. The authors collected around 7000 comments in response to them. The controversy of the original post served as a way to choose where to look. The comment's eventual label came from the annotation process.

On Twitter, they used keyword searches, drawing on the collection strategy discussed in Predicting the Type and Target of Offensive Posts. The seed list included Nepali words in both scripts that could appear in hostile contexts. An example was a caste name with ordinary identity uses as well as insulting ones. Another was the word for a bear that can acquire a sexualized meaning in a different setting. The authors report collecting about 4000 tweets, at approximately 50 tweets per search word. A keyword brought a tweet into the pool while leaving its meaning to be judged separately.

For YouTube, the authors chose videos that covered controversial, noncontroversial, and neutral subject matter. They collected approximately 3500 comments. They describe this source as helpful for including different written forms, such as fully Devanagari comments, fully transliterated comments, and text that combines the two. Blogs and news sites contributed about 500 further comments. The source counts describe the collection pool. The paper gives separate counts for the subset that received labels.

From Nepali social media posts to classification

The steps in order.

From Nepali social media posts to classificationStep 1: Collect posts and comments from selected sources1. Collect posts and comments from selected sourcesStep 2: Assign and reconcile human labels2. Assign and reconcile human labelsStep 3: Remove duplicates and divide labeled records3. Remove duplicates and divide labeled recordsStep 4: Normalize spellings and build text features4. Normalize spellings and build text featuresStep 5: Train a classifier to flag offensive posts5. Train a classifier to flag offensive postsStep 6: Classify flagged posts by offense category6. Classify flagged posts by offense category

Assigning labels and resolving disagreements

The authors randomized the records before linguistic annotation. Two people independently assigned a category to each record. Non-offensive content received the code NO. Offensive racist content received OR, offensive sexist content received OS, and other offensive content received OO. The last category accommodated cases such as personal attacks that were outside the racist and sexist categories. For the binary experiment, the authors pooled OO, OR, and OS into the offensive class. The underlying judgments could thus support both levels of evaluation.

Before resolving differences, the authors assessed agreement using Cohen's kappa. Kappa compares observed agreement with the agreement that would be expected by chance given how frequently the raters use the labels. Here the comparison concerns the annotators' initial judgments. The paper reports kappa of 0.71 for the fine-grained labels and 0.78 for the binary labels, which it interprets as substantial agreement. At the binary level, some differences between offensive categories can disappear because the categories share the same broader label. Differences about whether a comment is offensive still count as disagreements.

One example involved a question about what a doctor had received from a political party. The same wording could imply corruption, or it could refer to something legitimate such as compensation or votes. The possible accusation depends on what the participants understand about the situation. The annotators assigned different labels to that comment. A third annotator reviewed disagreements, and the annotators reached a consensus. That process produced a single reference label for evaluation, even in cases where the original judgments diverged.

The authors also treated identifying information as a concern. The paper mentions names of people and organizations and phone numbers as the sort of information that posts can contain. The described name procedure replaced original names with randomly selected real names. Where a person's gender was known, the authors tried to preserve it in the replacement. Their reason was that gender can carry linguistic information relevant to how the text is interpreted.

The annotators labeled 7462 records before the removal of duplicate examples. The authors then used a random 80-20 split. The training set contained 5798 records and the test set contained 1450, with 7248 records in the released dataset. The authors released the human-annotated data through the offensive-nepali repository. The two splits serve different purposes. The training records provide the judgments a classifier can learn from. The held-out records let the authors compare predictions with judgments that the classifier did not receive as training labels.

Making written forms more consistent

The authors report that more than 50% of the comments in their pool were Romanized or mixed in script. The preprocessing experiments ask how to represent these posts when the same word can appear in several written forms. They compare the original text with a Devanagari spelling normalization, a conversion from Devanagari to Roman letters, and a concatenation of the two processed versions.

The spelling normalization is called Dirghikaran. It uses character mappings to bring certain Devanagari variants to a shared form. One stated mapping puts distinct characters used for similar sibilant sounds into a common representation. In the paper's example with the Nepali word for a book, spellings with different Devanagari characters converge on the same normalized word. Roman-letter text passes through this procedure unchanged. A post can therefore retain a script difference even after the Devanagari portion has been normalized.

The Romanization procedure uses rules to render Devanagari Nepali in Roman letters. The rules also handle spelling variants of the kind used in the book example. The paper shows the Devanagari forms converging on kitab. The motivation is to bring converted words into the same script as words users already wrote in Roman letters. The authors chose this direction because they found a rule system for converting Devanagari into Roman letters easier to construct than one for the reverse conversion.

Romanization concerns how a word is written. The resulting Roman letters do not imply an English translation, and a post can retain a mix of languages after the script conversion. Romanization can also leave variants among spellings already entered in Roman letters. The experiment therefore tests how much more evidence the classifier can share when one important source of variation, the difference between scripts, is reduced.

The combined setting makes both processed versions available. The authors specify that the plus sign in the name of this setting means string concatenation. The classifier receives the spelling-normalized version and the Romanized version joined together, giving its feature extraction procedure access to both. This differs from running the spelling normalization and then keeping only the final Roman output. In the combined setting, features specific to the Devanagari representation can still contribute.

Turning posts into features

The conventional classifiers work with features extracted from each post. The paper compares word unigrams, word bigrams, and character trigrams. These are forms of an n-gram, a sequence of adjacent units. A word unigram represents an individual word, while a word bigram represents neighboring words together. A character trigram represents a short sequence of consecutive characters. The comparison separates a word feature family, a character feature family, and a setting that includes both.

A word pair can help distinguish usages by recording the immediate company a word keeps. A character sequence can recur in different forms of a word even when its entire spelling changes. If two word forms share a portion of their letters, some of their character features can provide common evidence. This gives the classifier a way to exploit regularities in the text without requiring a linguistic tool to identify the shared stem or establish which grammatical forms are related.

The feature families and normalization operate at different points. Romanization changes the text from which features are extracted. Character features change what counts as a shared feature in that text. Romanization can make full word forms coincide across scripts, whereas character features can make variants partially overlap within the same script. Combining their effects is an empirical question because a feature set that already handles some spelling variation may benefit less from a further change in representation.

The authors used a chi-squared statistic and a KBest procedure to reduce the feature set to 10,000. The statistic scores how strongly a feature is associated with the labels, and KBest retains the highest-scoring features up to the specified limit. The point of the reduction is to choose among the many candidate features that text can generate. Its ranking is based on association in the labeled data, so a selected feature can reflect the composition of the corpus as well as regularities in offensive usage.

For the comparison of conventional binary classifiers, the authors also made features based on a dictionary of offensive expressions. They describe scanning the preprocessed post and looking up its tokens to obtain indicators. The trained classifier can use those indicators alongside word and character features. This use of the dictionary is distinct from the standalone baseline, where the scores from the dictionary directly determine the prediction.

Making the broad decision

The dictionary baseline provides a decision rule that needs no fitting to the labeled posts. The dictionary contains 1078 terms, their transliterated forms, and scores ranging from 1 for slight offensiveness to 5 for the strongest cases. The baseline examines the tokens in a post and adds the scores of those it finds in the dictionary. The paper's rule can be expressed as follows.

∑ᵢ s(tᵢ) ≥ 5

The summation sign means to add the scores over the matching token positions. The index i identifies a position at which the post has a dictionary match. The symbol tᵢ is the token at that position, and s(tᵢ) denotes its dictionary offensiveness score. The sign ≥ means greater than or equal to. The value 5 is the threshold for predicting offensive content. A total below the threshold gives the non-offensive label. The rule can flag a post because of an entry assigned the strongest score or because the matched entries collectively reach the threshold.

Logistic regression learns a weighted combination of features for the offensive-versus-non-offensive decision. In the reported configuration it is linear, uses L2 regularization with a constant of 1, and is fitted with limited-memory BFGS. The penalty discourages large weights, while the optimization procedure finds weights that fit the labeled training examples under that penalty. The linear support vector machine configuration likewise uses L2 regularization with a constant of 1. The paper specifies logistic loss for this configuration. These settings describe what the authors ran under each classifier name.

The random forest uses 100 randomized decision trees. Each tree produces a probability prediction based on the features, and the forest averages the trees' predictions. Whereas a linear classifier combines features through a single weighted score, a tree can make a decision conditional on a sequence of earlier feature decisions. The forest combines multiple such trees so the final probability comes from the collection.

The paper also evaluates multilingual BERT, abbreviated M-BERT. The authors explain that Nepali is included in its multilingual Wikipedia pretraining and that they used the Hugging Face Transformers library for the classifier. Earlier work applying BERT to offensive-language detection motivated the comparison. The conventional feature pipeline and M-BERT represent different ways to construct a classifier from text. The paper spells out the feature and regularization settings for the conventional approaches more fully than the training settings for M-BERT. BERT, Transformers, and NULI's offensive-language transfer learning study

Assigning a more specific label

The fine-grained experiment follows Park and Fung's approach to abusive-language classification. The authors first train a random forest for the broad decision on the training split. They train another random forest exclusively on the records whose labels are offensive. The second forest learns to distinguish other offensive, racist, and sexist content. It has no non-offensive class in its training task.

At test time, a non-offensive prediction from the first forest becomes the final label. An offensive prediction sends the post to the second forest, which chooses the subtype. This makes the stages dependent. An actually offensive comment that receives a non-offensive prediction at the first stage never gets a subtype. A genuinely non-offensive post flagged by the first stage must receive an offensive subtype at the second. A subtype can also be confused with another subtype after the first classifier makes a correct broad decision.

This arrangement makes it possible to train the subtype classifier on a focused problem. It also means that a score for a subtype measures the entire route from the original post to the final label. The reported score for racist content, for example, depends on initially flagging it and then distinguishing it from the other offensive categories. A test of the second forest on human-identified offensive posts would answer a different question.

Experiments and results

The labeled collection and the held-out split

The source breakdown describes the 7462 records that were annotated. Of these, 3361 came from Facebook, 2077 from Twitter, 1846 from YouTube, and 177 from the other sources. Across sources, 4552 labels were non-offensive and 2552 were other offensive. The annotation table gives 269 records labeled racist and 88 labeled sexist. These counts describe a collection intentionally drawn from settings where offensive content was likely to occur.

The split after duplicate removal is the basis of the classification results. The counts below are the paper's label-by-label entries for the training and test sets.

LabelTraining recordsTest records
Non-offensive3562896
Other offensive1950486
Racist21849
Sexist6819
Total57981450

For the binary setup, the authors define the offensive examples as the positive class. They give 2236 positive and 3562 negative training examples. The test-set sentence in the binary preprocessing section reverses the polarity of the counts, calling 896 positive and 554 negative. The label table and stated definition instead identify 896 test records as non-offensive, so under that definition the count of 554 refers to the offensive class. The results below use the category names in the score tables, which distinguish offensive and non-offensive directly.

The uneven distribution matters at both levels. The binary classifier has more training examples of non-offensive content than of offensive content. Within the offensive training set, other offensive content has much more representation than either racist or sexist content. The fine-grained scores should be read with the amount of labeled evidence available for each category in mind. The distribution also helps explain why a single pooled score would give an incomplete picture of what the system can identify.

How to read the scores

The paper reports precision, recall, and F1 for each class. Precision asks how often a prediction of a given class is correct. For the offensive class, it measures the share of flags that correspond to posts annotated as offensive. Recall asks how frequently the system retrieves members of that class. For offensive content, it measures the share of annotated offensive posts that were flagged. The authors also report these metrics with non-offensive content as the class of interest.

Taking the harmonic mean of recall and precision gives the F1 score. It rewards a combination of the two, and a low value for either pulls the combined score down. A system can have relatively high offensive precision and still miss many offensive posts. Conversely, a system can recover more of the labeled offensive posts while producing a larger share of incorrect flags. These distinct outcomes matter for both automated screening and a queue intended for people to review.

The paper reports class-specific F1 on the held-out test data. The displayed values are on the decimal scale used in the tables. A value for the offensive class summarizes performance on the pooled offensive categories in the binary experiment. It says nothing by itself about how often an individual subtype is assigned correctly.

The preprocessing experiment

The preprocessing comparison uses logistic regression for the binary task with each of the tested feature families. With word features alone and the text left as written, offensive recall is 0.39 and offensive F1 is 0.52. With Dirghikaran alone, offensive recall is again 0.39 and offensive F1 is 0.53. Romanization brings word-feature offensive recall to 0.51 and F1 to 0.64. Concatenating the normalized and Romanized versions also gives word-feature offensive F1 of 0.64.

Preprocessing with word features on the Nepali binary test set

Romanization reaches the highest offensive-class F1 whether used alone or concatenated with the normalized text.

Preprocessing with word features on the Nepali binary test setNo preprocessing: 0.52No preprocessing0.52Dirghikaran: 0.53Dirghikaran0.53Romanization: 0.64Romanization0.64Dirghikaran plus Romanization (this paper): 0.64Dirghikaran plus Romanization (thispaper)0.64
The numbers
System or settingOffensive-class F1
No preprocessing0.52
Dirghikaran0.53
Romanization0.64
Dirghikaran plus Romanization (this paper)0.64

Character features alone give offensive F1 of 0.68 on the original text, matching the result with Dirghikaran in that feature setting. Their offensive F1 reaches 0.69 with Romanization and with the concatenated text. For binary detection in this experiment, character features are already competitive before normalization. The word-feature comparison shows a more pronounced dependence on the form of the input.

With both word and character features, the highest displayed offensive F1 is 0.70 for the concatenated text. In that setting the paper reports offensive precision of 0.83 and offensive recall of 0.61. For the non-offensive class, the same setting gives precision of 0.79, recall of 0.93, and F1 of 0.85. The latter F1 is also reported for the other preprocessing choices when both feature families are used. The benefit at the top of the offensive F1 comparison thus appears within a narrow range of results for this combined representation.

Comparing binary classifiers

The separate classifier comparison includes the rule based on dictionary scores, the conventional trained classifiers, and M-BERT. For the conventional classifiers, the authors use the combined preprocessing and both word and character features chosen following the previous experiment. They add the dictionary indicators in this comparison. The dictionary baseline uses the threshold rule described in the method, so its decisions come directly from matches and scores rather than from learned weights on the full feature set.

Classifiers on the Nepali binary test set

Random forests lead on offensive-class F1, with logistic regression close behind.

Classifiers on the Nepali binary test setDictionary baseline: 0.58Dictionary baseline0.58Logistic regression: 0.72Logistic regression0.72Support vector machine: 0.68Support vector machine0.68Random forests (this paper): 0.73Random forests (this paper)0.73Multilingual BERT: 0.59Multilingual BERT0.59
The numbers
System or settingOffensive-class F1
Dictionary baseline0.58
Logistic regression0.72
Support vector machine0.68
Random forests (this paper)0.73
Multilingual BERT0.59

On the offensive class, the dictionary baseline gives precision of 0.57 and recall of 0.58. Logistic regression gives precision of 0.86 and recall of 0.63, reaching F1 of 0.72. The support vector machine has the highest offensive precision in the table, at 0.87, but its recall is 0.56, yielding F1 of 0.68. The random forest gives offensive precision of 0.85 and recall of 0.64. Its F1 of 0.73 motivates the authors' choice of a forest for the broad decision in the fine-grained experiment.

The non-offensive results give another view of the same comparison. F1 is 0.73 for the dictionary, 0.85 for the support vector machine, 0.86 for the random forest, and 0.87 for logistic regression. M-BERT gives non-offensive F1 of 0.81. For offensive content, its precision is 0.75 and recall is 0.49, giving F1 of 0.59. Its higher offensive precision and lower offensive recall relative to the dictionary baseline show how similar F1 values can arise from different error profiles.

The two logistic regression entries, 0.70 in the preprocessing comparison and 0.72 in the classifier comparison, belong to different experimental configurations. The latter comparison includes the dictionary indicators. The paper gives the results of each configuration but does not include a separate matched test that establishes how much of the change can be assigned to the indicators alone.

Classifying the kind of offense

For the two-stage forest, the paper reports non-offensive precision of 0.81, recall of 0.93, and F1 of 0.87 on the test set. Other offensive content has precision of 0.79 and recall of 0.64, with F1 of 0.71. Racist content has precision of 0.76 and recall of 0.32, with F1 of 0.45. For racist content, the recall is substantially lower than the precision. The predictions assigned that label were frequently correct, but many human-labeled examples of racist content were missed.

The sexist row requires special care. The table prints precision of 0.9, recall of 0.05, and F1 of 0.01, and the body of the paper repeats the F1 of 0.01. The printed precision and recall are inconsistent with that F1 under the usual definition. The paper does not reconcile the entries, so the individual values should be read as the reported figures. The paper describes performance on sexist content as weak and points to the category having 68 training examples, compared with 218 for racist content and 1950 for other offensive content.

The other offensive class receives the strongest reported subtype F1. The result therefore separates recognizing offensiveness from naming the type of offense, and it differentiates the subtype results from one another. The paper's broad offensive F1 of 0.73 comes from the binary random forest in the classifier comparison. It should not be read as the F1 of the pipeline on each of the labels that name a specific offense.

What the ablations show

Script conversion matters most when words must match

The closest experiment to an ablation is the comparison of preprocessing and feature choices under logistic regression. It holds the classifier family and binary task constant while varying how the text is written and which pieces of it are available as features. The unprocessed setting supplies a point of comparison for each feature family. This design makes it possible to see whether the benefit of a preprocessing choice depends on the feature representation.

The clearest case is the word-only setting. Dirghikaran addresses spelling differences within Devanagari, where the relevant characters fall under its mappings. Romanization also addresses a division between Devanagari and Roman text. The stronger word-feature results after Romanization are consistent with the idea that equivalent words spread across scripts were a substantial problem for exact word-based evidence. The experiment compares representations on real comments, so it measures their combined effect across all the text in that test set. It does not isolate which mapping or which kind of mixed-script example accounts for the gain.

The word-only scores also show a tie between Romanization by itself and concatenation on offensive F1. The authors describe an overall ordering in which the combined method performs best, followed by Romanization and then Dirghikaran. The table supports that description as a tendency across configurations. Several entries tie, and an individual metric can move differently from another. In the character-only setting, for instance, offensive recall is 0.60 with Romanization and 0.59 with concatenation, while both yield offensive F1 of 0.69. The reported ordering should therefore be understood in relation to the feature family, class, and metric.

Character features change the value of normalization

Character features give the classifier access to overlap among forms that word features treat as wholly different. That provides a plausible explanation for why character features alone are stronger than word features alone on the original text. It also explains why the comparison changes once Romanization has brought some of the word forms together. In the table, switching from the original representation to Romanization moves offensive F1 from 0.52 to 0.64 with word features and from 0.68 to 0.69 with character features. The observed benefit of preprocessing depends on how much variation the features already tolerate.

The authors connect the value of character features to both inflection and noisy writing. The result is compatible with both explanations. A shared character sequence might capture a recurring portion of inflected words, alternate spellings, or fragments that happen to be predictive in the collected sample. The experiments do not separate those origins. In particular, there is no breakdown of the comparison by script, by kinds of spelling variation, or by whether the features occur in inflected forms.

Adding the word features to the character features produces the highest offensive F1 when the two processed texts are concatenated. The combined feature set on original text and under Dirghikaran has offensive F1 of 0.68 in each case, equal to the corresponding character-only scores. The evidence for adding both feature families is therefore tied to the best tested representation. It is possible to retain useful whole-word or neighboring-word information alongside character patterns, but the displayed results do not show a gain from adding words in every setting.

Association with training coverage and context

The classifier comparison establishes a ranking on the binary split under the reported configurations. Among the conventional classifiers, logistic regression and random forests combine relatively high precision with higher offensive recall than the support vector machine. The contrast with M-BERT shows that the tested multilingual classifier did not reach the offensive F1 of the best conventional systems. The authors suggest two reasons: differences between Wikipedia and social media text, and limited representation of Nepali in Wikipedia pretraining. The experiment does not vary those proposed causes independently.

The fine-grained experiment establishes a performance pattern across labels. It gives no direct comparison between the two-stage forest and a single classifier trained to predict all the fine-grained labels. The authors chose the staged design based on earlier work. Its results show how this choice performed in Nepali, without isolating whether the design helps relative to direct multiclass training on the same records. Likewise, the small training set for sexist content is a plausible explanation for the weak result, but the paper does not vary the amount of training data for that subtype.

The error analysis offers a different kind of evidence. The authors describe comments about bears that differ in the place they name. In the forest setting, the animal reading is ordinary. When the named place is Thamel, the comment can take on a sexualized derogatory meaning that depends on local associations. The surface change between the examples is small, yet it changes how a reader with the relevant knowledge understands the noun and the comment. In principle, a lexical classifier might learn a correlation involving a place name from labeled examples. The analysis explains why learning a fixed offensiveness value for the noun would fail to capture the contrast.

The paper attributes many errors to a lack of contextual and world knowledge. Its examples illustrate the mechanism without quantifying how often it accounts for mistakes. A change in wording can be repaired by normalization when variants express the same thing. In a case like the Thamel example, the wording is already sufficient to distinguish the sentences as strings. What matters is the association between the named place, the possible senses of a word, and the social force of the comment. The preprocessing analysis and the error analysis thus address different sources of difficulty.

Limitations

Limits and cautions the authors identify

The authors caution against relying too heavily on either keywords or automatic classifications in moderation. They emphasize context and encourage human review of flagged content, especially in cases that may be false positives. That caution follows from both annotation and evaluation. The annotators disagreed when a question could carry a corrupt motive as an implication, and the error analysis describes expressions whose meanings change with a place reference. A flag tells a reviewer what the classifier predicted, while the reviewer still has to make sense of the actual utterance.

The authors also identify scarce examples of individual offensive categories as a problem. Finding material for a broad offensive label is easier than obtaining enough examples for each category. The small number of sexist training records is the paper's explanation for the weakness it reports for that label. The annotation counts show how this difficulty can persist in an intentionally enriched collection. Even though the authors made an effort to find offensive posts, the resulting fine-grained groups differed considerably in size.

The paper leaves identifying the target of a comment for future work. Under its rubric, a post can be assigned an offense type, but the output does not indicate the person, organization, or group it concerns. Target information would contribute a different answer. A post-level label tells a moderator the category the classifier chose. Target identification could help a moderator understand who is being attacked and whether multiple comments refer to the same person or group.

The authors mention translation and transfer learning as possible ways to make use of data in other languages. They also describe the quality of available translation into Nepali as a practical obstacle at the time. The reported M-BERT experiment is a comparison involving multilingual pretraining. The study leaves open how a system trained with translated or transferred offensive-language data would handle Nepali spellings, local references, and labels.

Limits visible in the sampling and labels

The collected corpus supports comparisons on a selected sample. Its source procedures enrich it for potentially offensive language. Facebook comments came from posts the authors considered likely to provoke controversy. Twitter searches used words chosen partly for their occurrence in hostile contexts. YouTube material came from manually chosen videos. These procedures affect both the share of offensive content and the kinds of offensive and non-offensive examples available. The category counts therefore describe the collection. Estimating how often Nepali users encounter offense on a platform would require a sampling design for that question.

The search terms can leave a signature in the data. For a Twitter record, the search term is a reason the authors found the tweet. Its use in the classifier is a separate matter. Because the same kind of term can be a retrieval cue and a feature, evaluation on the random split may reward correlations that arise partly from collection. The inclusion of ordinary as well as offensive uses makes those terms imperfect shortcuts. The paper gives no comparison against a separately collected test set designed to reveal how often such shortcuts generalize.

The random split answers how well classifiers predict held-out examples from the assembled corpus after duplicate removal. The paper does not describe holding out entire threads, search terms, source platforms, or time periods. For instance, distinct comments associated with a single event may share names and expressions without being duplicates. Whether the reported classifier would transfer to comments about other events, to a site absent from training, or to a later period remains unanswered. The same split also leaves open whether the relative performance of the preprocessing settings varies by platform.

Label assignment brings another limit into view. Cohen's kappa summarizes agreement across judgments, while the adjudication gives an agreed reference label for each record. The study does not report separate agreement for each fine-grained class. A reader therefore cannot tell from the overall kappa whether the annotators applied the rare labels with the same consistency as the common labels. The higher binary agreement is informative about that broader decision. It does not settle which boundaries between the detailed labels are most difficult for people to apply.

Other offensive content covers a range of conduct. A subtype classifier can predict it successfully without distinguishing the reasons a comment was put there. The approach also assigns a single label per example, so its output does not express overlapping categories or the uncertainty seen in borderline cases. These properties are appropriate to the stated experiment, but they matter for interpreting its claims. A broad improvement in classifying other offensive posts gives limited information about specific conduct such as harassment directed at an individual or violent rhetoric directed at an organization.

Limits visible in the evaluation and reporting

The two-stage results combine missed detections and mistakes among subtypes. The paper gives class-level precision, recall, and F1, but it does not show where every missed subtype went. A racist post could have been marked non-offensive, or it could have been flagged and given another offensive label. Those errors have different implications for the choice of what to improve. Classifying only human-confirmed offensive posts with the second forest would help assess that stage separately. The experiment as reported measures the performance of the two stages together.

The evidence for small differences between configurations is limited to the test-set scores given in the paper. The authors do not report performance across repeated splits or give intervals around those scores. The random forest leads logistic regression on offensive F1 in the classifier comparison, while logistic regression leads on non-offensive F1. Those are results on the chosen split. The available measurements do not establish how reliably the ordering would recur if the samples or training runs changed.

The experimental descriptions also vary in detail. The paper identifies the conventional feature families, feature selection procedure, and several classifier settings. It gives less detail about the task-specific training and input choices for M-BERT. The M-BERT result is useful evidence about the system the authors tested. A conclusion about the effect of pretraining in Nepali, or about the relative merits of pretrained and conventional classifiers across comparable configurations, would require a comparison that varies those factors directly.

There are reporting inconsistencies that constrain precise interpretation. In the binary experiment, the label counts identify the intended meaning of positive and negative despite the reversed test-set description. In the fine-grained evaluation, the precision, recall, and F1 printed for sexist content do not agree with each other. The paper supplies no confusion counts that resolve the latter discrepancy. It supports the observation that the authors found this category difficult, while leaving the exact numerical assessment uncertain.

Finally, the test scores measure agreement with labels on selected text. The paper gives no deployment trial in which reviewers used the flags in their work. It therefore leaves unanswered how many posts would enter a moderation queue, how reviewing them would affect staff workload, and what would happen to users whose comments were flagged. A result on the held-out corpus is the foundation the paper provides. Measures of moderation outcomes would require a separate study with decisions, consequences, and reviewers observed in the setting where the system is used.

What came after

The later citations place the Nepali study alongside work on multilingual safety, target-aware detection, and Arabic offensive speech. Each topic reflects a distinct aspect of the original study. Coverage across languages relates to the authors' decision to build Nepali data. Attention to targets relates to their separation of an offensive label from the identity of the person or group attacked. Interest in how labels are acquired relates to the effort needed to find and annotate examples, especially for rare categories.

The State of Multilingual LLM Safety Research is a survey framed around measuring and mitigating the language gap in safety research. Niraula and colleagues provide a Nepali case to which that framing applies. They show how a safety-related classification task can have limited language-specific resources, require work on script variation, and give uneven results across kinds of harm. The citation connects that case with the wider multilingual question. The survey's citation does not by itself establish that it evaluated the Nepali classifiers or drew measurements from their test set.

Ahsan's work on multimodal, target-aware detection cites the Nepali study and is identified by its emphasis on multimodal and target-aware detection. The connection to the paper's future work is the target. Niraula and colleagues classify the comment and discuss identifying whom it attacks as a further task. Target-aware detection includes that relationship in the problem it sets out to address. The citation establishes a relationship between the works, with the specific modalities, experiments, and use of the Nepali dataset left undetermined.

Multi-task and Active Learning for Arabic Offensive Speech Detection carries the discussion of offensive-language detection into an Arabic setting and names multitask learning and active learning as its approach. Its substantive connection to the Nepali study is the problem of learning useful decisions from labeled material. The Nepali paper shows how much work can go into assembling a corpus and how sparse particular kinds of offense can remain after that effort. The Arabic work's title identifies a different learning approach to offensive speech, while the citation alone leaves open whether any Nepali experiment, label scheme, or preprocessing method was reused.

Cite

Cite as Nobal B. Niraula, Saurab Dulal and Diwa Koirala. 2021. Offensive Language Detection in Nepali Social Media. Proceedings of the 5th Workshop on Online Abuse and Harms (WOAH 2021).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2021.woah-1.7

@inproceedings{niraula2021offensive,
  title = {{Offensive Language Detection in Nepali Social Media}},
  author = {Nobal B. Niraula, Saurab Dulal and Diwa Koirala},
  booktitle = {Proceedings of the 5th Workshop on Online Abuse and Harms (WOAH 2021)},
  year = {2021},
  doi = {10.18653/v1/2021.woah-1.7},
  url = {https://doi.org/10.18653/v1/2021.woah-1.7}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/niraula-2021-offensive-language-detection-nepali-social/