Source-linked AI summary

Toxic Language Detection in Social Media for Brazilian Portuguese: New Dataset and Multilingual Analysis

João A. Leite, Diego F. Silva, Kalina Bontcheva, Carolina Scarton

arXiv:2010.04543v1cs.CLcs.LGcs.SI

TL;DR

Toxicity detection in social media is difficult because comments are massive in volume, can be harmful, and include diverse forms of toxicity. This paper introduces a large Brazilian Portuguese Twitter dataset and evaluates BERT approaches; monolingual data achieved the strongest reported binary result, while less frequent categories and multi-label classification remained difficult.

  • Problem

    Automatic toxicity detection matters for social media moderation but must handle implicit language, diverse toxicity types, and highly imbalanced comments.

    Source: §1 · p. 1
  • Method

    The authors created ToLD-Br, a 21K-tweet Brazilian Portuguese dataset with seven labels, and fine-tuned monolingual and multilingual BERT models.

    Source: §1 · p. 2, §4 · p. 6
  • Results

    76% macro-F1 was achieved by monolingual BERT, improving 3 points over a baseline; multilingual zero-shot learning scored 56% macro-F1 and transfer learning did not improve over monolingual models.

    Source: §1 · p. 2
  • Takeaways & Limitations

    The authors conclude that large-scale monolingual data is still needed for reliable models, while class imbalance and less frequent toxicity categories remain challenging.

    Source: §1 · p. 2, §6 · p. 9

    Despite efforts to balance annotator selection, the volunteer pool was biased toward people identified as white and heterosexual.

    Source: §3.2 · p. 4

Abstract

from arXiv · show

Hate speech and toxic comments are a common concern of social media platform users. Although these comments are, fortunately, the minority in these platforms, they are still capable of causing harm. Therefore, identifying these comments is an important task for studying and preventing the proliferation of toxicity in social media. Previous work in automatically detecting toxic comments focus mainly in English, with very few work in languages like Brazilian Portuguese. In this paper, we propose a new large-scale dataset for Brazilian Portuguese with tweets annotated as either toxic or non-toxic or in different types of toxicity. We present our dataset collection and annotation process, where we aimed to select candidates covering multiple demographic groups. State-of-the-art BERT models were able to achieve 76% macro-F1 score using monolingual data in the binary case. We also show that large-scale monolingual data is still needed to create more accurate models, despite recent advances in multilingual approaches. An error analysis and experiments with multi-label classification show the difficulty of classifying certain types of toxic comments that appear less frequently in our data and highlights the need to develop models that are aware of different categories of toxicity.

1 Introduction

Automatic toxicity detection matters for social media, but the available Portuguese datasets were small. This paper introduces ToLD-Br and evaluates monolingual and multilingual models, finding that language-specific data and larger training sets matter.

1 Introduction

  • Toxicity detection faces implicit language, a wide range of categories, and class imbalance because toxic comments are a minority.These challenges complicate automatic detection from the large volume of social-media posts.Source: §1 · p. 1
  • Earlier Portuguese datasets were considerably smaller than English resources, leaving limited data for studying toxic-comment detection in Brazilian Portuguese.The paper notes two previous Portuguese works and highlights the scale difference.Source: §1 · p. 1
  • ToLD-Br contains 21K manually annotated tweets across seven categories and is the largest Portuguese social-media toxicity dataset, as well as the first with annotator demographic information.Each tweet received three volunteer annotations; annotators were selected with demographic balance in mind.Source: §1 · p. 2
  • Monolingual BERT reached 76% macro-F1, improving 3 points over a baseline, while transfer learning did not improve over monolingual models and zero-shot learning scored 56% macro-F1.The experiments use Brazilian Portuguese and multilingual BERT for binary toxic-comment classification.Source: §1 · p. 2
  • Racism and xenophobia, the less frequent categories, were more likely to be mislabeled than insult and obscene, the majority classes.With few training examples, models predicted the majority non-toxic class; more instances improved toxic-class performance.Source: §1 · p. 2
  • BERT-based models did not outperform the baseline on multi-label classification of toxicity types, a harder task than binary classification.The multi-label task classifies each type of toxicity separately.Source: §1 · p. 2

2 Related Work

The review covers Twitter-based toxicity datasets and work on Brazilian Portuguese, while noting that most available resources and studies focus on English. It positions ToLD-Br as a large-scale, demographically considered dataset with multilingual, data-volume, and multi-label analyses.

2 Related Work

  • The review focuses on Twitter-based datasets and Brazilian Portuguese studies because of space constraints, while noting that most resources and studies are English-focused.The authors frame their review around toxic-comment detection rather than hate speech generally.Source: §2 · p. 2
  • English resources include Davidson et al. (2017)'s approximately 25K tweets and Founta et al. (2018)'s 80K tweets; OLID reports 82.9 macro-F1 for its relevant task A.Davidson et al. use logistic regression with engineered features, while the best OLID task-A model uses BERT.Source: §2 · p. 2
  • The reviewed German, Arabic, Spanish, and Hindi studies use datasets ranging from approximately 1.1K to 11K posts and include feature-based and neural approaches.Examples include Wiegand et al. (2018), Mubarak et al. (2017), Carmona et al. (2018), and Mathur et al. (2018).Source: §2 · pp. 2–3
  • Earlier Portuguese datasets included 1,250 website comments and 5,668 tweets, with binary classification results reported using SVM, Naive Bayes, and LSTM approaches.de Pelle and Moreira (2017) report weighted F1 between 77 and 82; Fortuna et al. (2019) report F1 of 78.Source: §2 · p. 3
  • Multilingual HASOC covered English, German, and Hindi, and reviewed systems across languages most often achieved their best results with BERT variants.HASOC included manually annotated tweets and Facebook posts.Source: §2 · p. 3
  • ToLD-Br differs from prior work by targeting a large-scale non-English dataset designed to reduce demographic bias and by examining transfer, zero-shot, data-volume, and multi-label settings.The authors describe their multi-label experiments as first insights into that challenge task.Source: §2 · p. 3

3 Dataset

ToLD-Br was assembled from tweets collected through keyword and influential-user searches, then annotated by demographically selected volunteers. The corpus preserves multiple annotations and supports alternative label aggregation strategies.

3.1 Data collection

  • Over 10 million tweets were collected, and 21,000 were sampled for annotation from keyword searches and threads involving monitored influential users.The keyword strategy supplied 60% of the sampled posts; the data was pseudoanonymised by replacing mentions with @user.Source: §3.1 · pp. 3–4

3.2 Corpus annotation

  • Of 129 volunteer applicants, 42 were selected using demographic information; each labelled 1,500 tweets, and each tweet received three annotations.Annotators could assign one or more of six toxicity categories or leave an example blank.Source: §3.2 · p. 4
  • The volunteer pool remained biased toward white and heterosexual annotators, although sex was more balanced; annotators were 18–37 years old, mostly 19–23.The authors aimed to balance demographic groups when selecting annotators.Source: §3.2 · p. 4, Table 1 · p. 4, Figure 1 · p. 4
  • LGBTQ+phobia had the highest inter-annotator agreement, while obscene and racism had the lowest; obscene and insult also showed signs of conceptual overlap.The authors note that obscene and insult labels were sometimes applied to examples intended to express the same concept.Source: §3.2 · pp. 4–5, Table 2 · p. 4, Table 3 · p. 5
  • Obscene and insult shared six of their ten most frequent words and had a Jaccard distance of 0.57, lower than other class pairs.The word and distance analyses both point to overlap between these categories.Source: §3.2 · p. 5, Table 4 · p. 5, Table 5 · p. 5

3.3 Dataset characteristics

  • ToLD-Br retains all annotations and offers stratified training, development, and test splits; the paper treats a tweet as toxic if any annotator marked an offence.The authors also describe unanimous, majority, and any-positive aggregation options, with the any-positive rule used in this paper.Source: §3.3 · pp. 5–6, Table 6 · p. 6

4 Materials and Methods

The experiments compare Brazilian Portuguese and multilingual BERT models, English-data transfer and zero-shot settings, and training-set sizes. They evaluate binary classification and an initial multilabel setup.

Models and baseline

  • Brazilian Portuguese BERT and multilingual BERT were fine-tuned on ToLD-Br, with a Bag-of-Words plus AutoML system as the baseline.The authors refer to both BERT variants as monolingual models because their fine-tuning data was Brazilian Portuguese alone.Source: §4 · p. 6

Cross-lingual experiments

  • The multilingual model was also tested with English OLID data merged with ToLD-Br for transfer learning and with OLID alone for zero-shot learning.The zero-shot model received no Brazilian Portuguese training data.Source: §4 · p. 6

Training-data size

  • Training-set sizes ranged from 10% to 100% in 10-point increments, with three repetitions per size using M-BERT-BR.The experiment assessed how training-data volume affected classification.Source: §4 · p. 7

Binary evaluation

  • Binary classification was evaluated using per-class precision, recall, and F1-score, macro-F1, and confusion matrices, with attention to false negatives.The broader experiments considered whether monolingual models or data from another language could benefit classification.Source: §4 · p. 7

Multilabel classification

  • The initial multilabel setup used six independent output neurons and was evaluated with Hamming loss and average precision against a BoW+AutoML baseline.Each activated output neuron marked its corresponding label positive.Source: §4 · p. 7

5 Results and Discussion

The results compare monolingual and multilingual approaches for binary toxicity detection, examine how training-set size affects reliability, and assess multi-label classification. Monolingual models lead overall, while sparse positive examples make several toxicity labels difficult to detect.

5.1 Binary Classification

  • M-BERT-BR is the best model by false-negative analysis; transfer does not improve overall performance over monolingual models, and zero-shot achieves 43% F1-score for the positive class.M-BERT-BR also has fewer false negatives than BR-BERT; the confusion matrices cover the models compared.Source: §5.1 · pp. 7–8, Table 10 · p. 7, Table 11 · p. 7
  • Insult and obscene have the lowest false-negative rates, while the less frequent racism and xenophobia classes have the highest.The error analysis reports that false-negative rates are inversely proportional to the number of examples in each class.Source: §5.1 · p. 8, Table 12 · p. 8

5.2 Importance of Large Datasets

  • Across three random samples at training sizes from 10% to 100%, at least 6K examples seemed necessary for reliable results; positive recall rose as negative recall fell, while precision rose for both classes.The authors note that an earlier Portuguese dataset contained 5,668 examples.Source: §5.2 · pp. 8–9

5.3 Multi-Label Classification

  • M-BERT-BR records 0.07 Hamming loss and 0.19 average precision versus baseline values of 0.08 and 0.20, yet labels with few positive examples were almost entirely classified as negative.The authors characterize multi-label classification as considerably harder than binary classification; Figure 4 shows confusion matrices by label.Source: §5.3 · p. 9, Figure 4 · p. 9

6 Concluding Remarks

The conclusion presents ToLD-Br as a Brazilian Portuguese Twitter dataset and reports that monolingual approaches and large-scale data remain important for reliable toxicity classification. It also identifies multi-label class imbalance as an unresolved challenge and points to further evaluation of class aggregation and unlabeled data.

6 Concluding Remarks

  • ToLD-Br is a dataset for classifying toxic comments on Brazilian Portuguese Twitter; the paper concludes that monolingual approaches outperform multilingual experiments and large-scale datasets are needed for reliable models.The authors also identify significant class imbalance as a challenge in multi-label classification.Source: §6 · p. 9
  • Future work will address class imbalance, evaluate whether aggregating classes with high annotator disagreement yields more reliable models, and assess adding unlabeled data for semi-supervised techniques.Source: §6 · p. 9
Loading 2010.04543v1…