N aija H ate: Evaluating Hate Speech Detection on N igerian T witter Using Representative Data (2024)

Abstract: To address the global issue of online hate, hate speech detection (HSD) systems are typically developed on datasets from the United States, thereby failing to generalize to English dialects from the Majority World. Furthermore, HSD models are often evaluated on non-representative samples, raising concerns about overestimating model performance in real-world settings. In this work, we introduce NaijaHate, the first dataset annotated for HSD which contains a representative sample of Nigerian tweets. We demonstrate that HSD evaluated on biased datasets traditionally used in the literature consistently overestimates real-world performance by at least two-fold. We then propose NaijaXLM-T, a pretrained model tailored to the Nigerian Twitter context, and establish the key role played by domain-adaptive pretraining and finetuning in maximizing HSD performance. Finally, owing to the modest performance of HSD systems in real-world conditions, we find that content moderators would need to review about ten thousand Nigerian tweets flagged as hateful daily to moderate 60% of all hateful content, highlighting the challenges of moderating hate speech at scale as social media usage continues to grow globally. Taken together, these results pave the way towards robust HSD systems and a better protection of social media users from hateful content in low-resource settings.

## introduction social media came with the promise to connect people, increase social cohesion, and let everyone have an equal say. yet, this technology has also been associated with online harms and detrimental effects on democracy @xcite . in particular, users are regularly exposed to hate speech foot_0 @xcite , fueling fears of its impact on social unrests and hate crimes @xcite . while regulatory frameworks have compelled social media platforms to take action @xcite , hate speech detection (hsd) and moderation efforts have largely focused on the north american and european markets, prompting questions on how to efficiently tackle this issue in the majority world @xcite . our study focuses on nigerian twitter, a low-resource context which provides an opportunity to study online hate speech at the highest level @xcite . exemplifying the issue, twitter was banned by the nigerian government between june 2021 and january 2022, following the platform's deletion of a tweet by the nigerian president in which he made provocative remarks about biafran separatists @xcite . the challenges in developing hsd systems are two-fold. first, hateful content is infrequent -approximately 0.5% of posts on us twitter @xcite -creating an obstacle to generating representative annotated datasets at a reasonable cost. to alleviate this issue, models are developed on curated datasets by oversampling hateful content matching predefined keywords @xcite , or by using active learning to maximize performance for a given annotation cost @xcite . these sampling choices generate biases in evaluation datasets @xcite , raising questions on the generalizability of hsd models to real-world settings. second, while a plethora of hsd modeling options are available, it is unclear how well they adapt to a new context. although few-shot learners are appealing for requiring no or few finetuning data, the evidence on their performances relative to su-pervised hsd baselines is mixed @xcite . supervised learners are typically finetuned on us data @xcite and tend to not generalize well to english dialects spoken in the majority world @xcite . finally, while further pretraining existing architectures to adapt them to a new context is known to increase performance on downstream tasks @xcite , it is unclear whether highly specific contexts require a custom domain adaptation. overall, questions remain on the extent to which available hsd methods perform when adapted to a low-resource context @xcite . in this work, we present naijahate, a dataset of 35,976 nigerian tweets annotated for hsd, which includes a representative evaluation sample to shed light on the best approach to accurately detect hateful content in real-world settings. we also introduce naijaxlm-t, a pretrained language model adapted to the nigerian twitter domain. we demonstrate that evaluating hsd models on biased datasets traditionally used in the literature largely overestimates performance on representative data (83-90% versus 34% in average precision). we further establish that domain-adaptive pretraining and finetuning leads to large hsd performance gains on representative evaluation data over both us and nigerian-centric baselines. we also find that finetuning on linguistically diverse hateful content sampled through active learning significantly improves performance in real-world conditions relative to a stratified sampling approach. finally, we discuss the cost-recall tradeoff in moderation and show that having humans review the top 1% of tweets flagged as hateful allows to moderate up to 60% of hateful content on nigerian twitter, highlighting the limits of a human-in-the-loop approach to content moderation as social media usage continues to grow globally. therefore, our main contributions are 2 : ## experimental setup in this study, our experiments aim to determine the impact of domain adaptation -both for pretraining and finetuning -on real-world performance. for this purpose, we evaluate the performance of supervised learning with language models pretrained and finetuned in various domains that we present below. additionally, we test recent off-the-shelf generalpurpose models in a zero-shot setting, specifically gpt-3.5 foot_4 . we finally benchmark the finetuned models against perspective api @xcite , a widely-deployed toxic language detection system relying on bert-based supervised learning and for which the finetuning data is not public. ## discussion performance overestimation we demonstrate that evaluating hsd on biased datasets leads to a large overestimation of real-world performance, the latter being rather low (34% average precision). a possible reason for this gap is that hateful content is much more rare in real-world settings (0.16% in our nigerian twitter case) compared to traditional evaluation sets (31% in english hate speech datasets @xcite ), rendering its detection more challenging. this result expands on past work which pointed at the risk of overestimating hsd performance in real-world settings but did not quantify the latter @xcite @xcite . ## conclusion this work introduced naijahate, the largest hsd dataset to date in the nigerian context and the first to contain a representative evaluation set. we also introduced naijaxlm-t, the first pretrained language model tailored to nigerian twitter. leveraging these resources, we provided the first evaluation of hsd in a real-world setting, finding that hsd performance is largely overestimated by traditional evaluation approaches. we finally presented the cost-recall tradeoff at play in human-in-the-loop moderation, where augmenting the recall comes with a higher annotation cost. we find that this moderation approach is effective at moderating a large share of all hateful content but that the associated annotation cost is prohibitive for large social media communities. while the present work demonstrates the low real-world performance of hsd and the substantial cost of hate speech moderation, there are several possible directions to further improve this performance. based on the hypothesis that hate is homophilous @xcite , future work could use network features to improve hsd performance @xcite . synthetic data could be used as well to further increase the number and diversity of examples to train models on @xcite . future work could also evaluate performance at the target level to identify hate types that are harder to detect and develop resources for these. further, the moderation analysis could be enhanced by taking popularity into account and measuring recall in terms of views of hateful content. finally, future work could expand our study to other languages, countries and platforms in order to evaluate the external validity of our results and pinpoint areas where new resources are most needed.