TL;DR
This paper introduces MUDES, a novel multilingual framework for identifying specific "offensive spans" within text, moving beyond classifying entire posts. MUDES offers pre-trained models, a Python API, and a user-friendly web interface, demonstrating state-of-the-art performance and efficient real-time application.
What Problem Does This Paper Address?
The internet, particularly social media, is rife with offensive content. While previous research has focused on classifying entire posts or comments as offensive or not, this approach lacks nuance. Identifying the specific spans of text that are offensive is crucial for several reasons: it aids human moderators in content moderation, makes offensive language detection systems more interpretable, and allows for more detailed linguistic analysis of what makes text offensive. This paper addresses the gap in existing tools by developing a system capable of pinpointing these offensive segments within text across multiple languages.
Methods
MUDES employs a two-part architecture based on transformer models.
- Language Modeling (LM): A pre-trained transformer model (like BERT, XLNET, ALBERT, RoBERTa, or XLM-R) is fine-tuned on the offensive span detection dataset using Masked Language Modeling (MLM). This part learns general language understanding relevant to the task.
- Token Classification (TC): A token-level classifier is added on top of the fine-tuned transformer. This classifier assigns a label (offensive or not offensive) to each individual token in the input text, effectively highlighting the offensive spans.
The authors experimented with both "base" and "large" versions of transformer models. For multilingual capabilities, they leveraged XLM-R, a cross-lingual transformer, to train models on English data and then apply them to other languages without requiring extensive target-language training data.
Datasets
- TSDTrain & TSDTrial: The primary dataset used for training and evaluation is from the SemEval-2021 Task 5: Toxic Spans Detection. This dataset consists of posts from the Civil Comments dataset, with offensive spans annotated by crowd-raters.
- Offensive Language Identification Dataset (OLID): Used as an off-domain English dataset for evaluation.
- Danish and Greek Datasets: Used for multilingual evaluation, these datasets were annotated using OLID's guidelines and were part of OffensEval 2020.
Key Insights and Ideas
- Span-level detection is crucial: Moving beyond post-level classification provides much richer information for moderation and analysis.
- Cross-lingual transfer learning is effective: Training on English data with models like XLM-R allows for surprisingly good performance on other languages, even low-resource ones, without needing direct training data for those languages. This is a significant step towards truly multilingual offensive content detection.
- Model size vs. efficiency trade-off: Larger models (e.g.,
en-large) offer higher accuracy but come with increased computational cost and slower inference times compared to "base" models. - MUDES is practical: The system is designed for real-world use, offering a Python API for developers and a user-friendly web interface for general users, with efficient performance even on CPUs.
Key Results
- Outperforms Baselines: MUDES models consistently outperformed strong baselines, including a spaCy NER pipeline and a lexicon-based approach, on the Toxic Spans Detection trial set.
- Multilingual Success: MUDES demonstrated its ability to detect offensive spans in Danish and Greek datasets, comparing favorably to top systems in OffensEval 2020, despite being primarily trained on English data.
- Efficiency: Large models take approximately 1 second per sentence on GPU and 3 seconds on CPU, while base models are about three times faster. This makes MUDES suitable for real-time applications.
Limitations and Future Work
- Dataset Bias: The authors acknowledge that all models are subject to intrinsic biases present in the training data.
- Future Work: The authors plan to evaluate MUDES on more diverse datasets and aim to develop a flexible multitask architecture capable of detecting offense at both span and post levels. They also highlight the potential for their approach to benefit many more languages due to XLM-R's support for over 100 languages.
Summary updated