Table of Contents
Fetching ...

Digital Guardians: Can GPT-4, Perspective API, and Moderation API reliably detect hate speech in reader comments of German online newspapers?

Manuel Weber, Moritz Huber, Maximilian Auch, Alexander Döschl, Max-Emanuel Keller, Peter Mandl

TL;DR

The paper addresses automated hate speech detection in German online newspaper comments by comparing GPT-4o, Perspective API, and Moderation API against a German-HOCON34k baseline. It employs Zero-/One-/Few-Shot prompting for GPT-4o and thresholding across APIs, evaluated on a 1,592-sample test set with a composite $S$ score derived from $MCC$ and $F_2$. GPT-4o consistently outperforms API baselines and the HOCON34k baseline, with One-Shot prompting delivering the strongest recall and $S$, and the study highlights substantial gains following targeted reannotation of the test data. The findings underscore the importance of data quality and prompting strategy for real-world hate speech detection, and point to contextual modeling and dataset expansion as key directions for future work to improve robustness in diverse German-language settings.

Abstract

In recent years, toxic content and hate speech have become widespread phenomena on the internet. Moderators of online newspapers and forums are now required, partly due to legal regulations, to carefully review and, if necessary, delete reader comments. This is a labor-intensive process. Some providers of large language models already offer solutions for automated hate speech detection or the identification of toxic content. These include GPT-4o from OpenAI, Jigsaw's (Google) Perspective API, and OpenAI's Moderation API. Based on the selected German test dataset HOCON34k, which was specifically created for developing tools to detect hate speech in reader comments of online newspapers, these solutions are compared with each other and against the HOCON34k baseline. The test dataset contains 1,592 annotated text samples. For GPT-4o, three different promptings are used, employing a Zero-Shot, One-Shot, and Few-Shot approach. The results of the experiments demonstrate that GPT-4o outperforms both the Perspective API and the Moderation API, and exceeds the HOCON34k baseline by approximately 5 percentage points, as measured by a combined metric of MCC and F2-score.

Digital Guardians: Can GPT-4, Perspective API, and Moderation API reliably detect hate speech in reader comments of German online newspapers?

TL;DR

The paper addresses automated hate speech detection in German online newspaper comments by comparing GPT-4o, Perspective API, and Moderation API against a German-HOCON34k baseline. It employs Zero-/One-/Few-Shot prompting for GPT-4o and thresholding across APIs, evaluated on a 1,592-sample test set with a composite score derived from and . GPT-4o consistently outperforms API baselines and the HOCON34k baseline, with One-Shot prompting delivering the strongest recall and , and the study highlights substantial gains following targeted reannotation of the test data. The findings underscore the importance of data quality and prompting strategy for real-world hate speech detection, and point to contextual modeling and dataset expansion as key directions for future work to improve robustness in diverse German-language settings.

Abstract

In recent years, toxic content and hate speech have become widespread phenomena on the internet. Moderators of online newspapers and forums are now required, partly due to legal regulations, to carefully review and, if necessary, delete reader comments. This is a labor-intensive process. Some providers of large language models already offer solutions for automated hate speech detection or the identification of toxic content. These include GPT-4o from OpenAI, Jigsaw's (Google) Perspective API, and OpenAI's Moderation API. Based on the selected German test dataset HOCON34k, which was specifically created for developing tools to detect hate speech in reader comments of online newspapers, these solutions are compared with each other and against the HOCON34k baseline. The test dataset contains 1,592 annotated text samples. For GPT-4o, three different promptings are used, employing a Zero-Shot, One-Shot, and Few-Shot approach. The results of the experiments demonstrate that GPT-4o outperforms both the Perspective API and the Moderation API, and exceeds the HOCON34k baseline by approximately 5 percentage points, as measured by a combined metric of MCC and F2-score.
Paper Structure (17 sections, 4 equations, 1 figure, 5 tables, 1 algorithm)

This paper contains 17 sections, 4 equations, 1 figure, 5 tables, 1 algorithm.

Figures (1)

  • Figure 1: S-, F1-, and F2-scores of all models on HOCON34k test compared to the reannotated data.