Elamur Research

Analyzing Zero-Shot transfer Scenarios across Spanish variants for Hate Speech Detection

Paper · 2023 · Galo Castillo-lópez, Arij Riabi and Djamé Seddah

Summary

A hate speech detector trained on Spanish tweets can lose accuracy when it encounters Spanish written in a different region. The words may be familiar while their implications change, and insults common in one place may be absent from the examples collected in another. Castillo-López and colleagues study this problem for misogyny and xenophobia. They ask how well a classifier trained on labeled tweets from one Spanish variety works on another, without seeing labeled examples from the target variety during task training. This is zero-shot transfer between varieties of the same language. The researchers also ask whether a Spanish-only starting point gives better results than a multilingual one.

The authors use existing misogyny datasets and compile HaSCoSVa-2022 for hate speech directed at immigrants. The new corpus contains 4000 tweets from areas in Spain and Latin America, drawn around different immigration situations and labeled for both region and xenophobia. Its positive class accounts for 13.9% of the corpus. For the transfer experiments, the authors match the number of tweets available from each region within each task. They then test whether the source of the training examples makes a difference when the test tweets stay the same.

In the pooled Spanish data, BETO, the Spanish-only BERT system, reaches a mean test macro-F1 of 84.9 for misogyny and 73.1 for xenophobia. Multilingual BERT reaches 74.4 and 69.6 on the respective tasks. BETO also varies less across runs. In the regional experiments, BETO trained on European Spanish scores 89.6 on European misogyny tweets and 70.5 on Latin American misogyny tweets. Looking at the same Latin American test set from the other direction, training on Latin American data raises the score to 81.8. A local training source gives the higher mean for every target region in both tasks.

The error analyses suggest several reasons to investigate. Training sets contain more of the nouns and adjectives that appear in test tweets from the same region. A close reading of one misclassified tweet shows that the two BETO classifiers give very different weight to the same gendered insult. The regional corpora also differ in collection history, class distribution, and, for xenophobia, the immigration situations discussed. The study establishes that transfer is weaker across these particular regional datasets. Its evidence for the role of regional wording comes from vocabulary comparisons and individual errors, alongside those broader differences.

Deep dive: Analyzing Zero-Shot transfer Scenarios across Spanish variants for Hate Speech Detection

A study of how well hate speech detection transfers between European and Latin American Spanish, with results for misogyny and xenophobia. · about 34 minutes to read

The problem and its context

When the same language is a different test

A system for hate speech detection has to decide whether a text attacks a person or a group on the basis of a characteristic such as gender or nationality. The paper takes up two cases. In the misogyny experiments, the question concerns hate directed at women. In the xenophobia experiments, it concerns hate directed at immigrants. Each experiment gives the classifier a narrow output choice. The tweet either receives the positive label for the task at hand or it receives the negative label. The challenge lies in deciding which reading is warranted by the words, their target, and the context in which they are used. This is an instance of text classification.

A regional difference can matter even if everyone understands the individual words. The authors illustrate this with fregar. In the usage they describe for Spain, it means scrubbing, so telling a woman to go home and do it can carry a gendered implication. In Ecuadorian usage, the same verb can carry senses associated with bothering people or having fun. A reader who reaches one of those interpretations may understand the instruction quite differently. The example identifies a potential source of disagreement before any classifier enters the picture. A person interpreting the tweet has to decide what action is being referred to before judging what the instruction implies.

The reverse problem is also possible. A phrase can be insulting in both places while its intensity or usual target differs. If the relevance of a word comes from how speakers use it to belittle a group, a general translation can preserve the rough meaning and lose the evidence that matters to the task. A classifier trained on examples from a particular region can learn useful distinctions for that source and still misread familiar-looking language elsewhere. The paper uses the term geolect for a variety associated with a geographical area. Its experiments ask what happens when the geographical grouping changes between training and testing. This is a transfer problem within multilingual and cross-lingual NLP.

That problem also changes how a collection of labeled tweets can be used. If the only language information attached to every post is “Spanish,” an evaluator can test on a mixture of tweets and report a score for Spanish as a whole. The score answers a question about that mixture. It offers little direct evidence about a deployment case in which labeled data come primarily from Spain and the posts to be judged come from Latin America, or vice versa. To recreate such a transfer case, the evaluator needs regional information at the level of individual tweets. Knowing that a corpus includes both regions is insufficient if the examples cannot be separated into source and target sets.

The article’s two research questions follow from this distinction. The first asks whether Spanish-specific BETO and multilingual mBERT differ on Spanish tweets about the same kinds of hate. The second asks whether labeled examples from one regional variety are enough to build a detector for another. A strong result on the first question is compatible with a weak result on the second. A system can learn to classify a mixed collection effectively and still depend on which region supplied its labeled examples. Keeping the questions separate also prevents the origin of pretraining material from being confused with the origin of the data used to teach the hate speech task.

What earlier studies had established

The authors describe a field with considerable work on online hate speech and a narrower body of work centered on Spanish. Detection had been studied across targets and forms of discrimination, including misogyny, xenophobia, and homophobia. Work in English was prominent, including systems for detecting hate against women on Twitter. Spanish research drew in part on shared tasks, in which participants worked with common examples and evaluation conditions. The paper cites the Automatic Misogyny Identification task and HatEval as examples of that route into Spanish-language experimentation. Detecting Hate Speech Against Women in English Tweets and HatEval.

For the present study, a limitation of widely used collections was what their metadata allowed researchers to ask. In the paper’s account, HaterNet did not specify the hate speech domain or give the location of the tweets. HatEval distinguished the targets of hateful posts, including women and immigrants, but the information described by the authors did not let them divide the tweets by Spanish variety. Target labels make it possible to ask whether a detector is better at finding misogyny than xenophobia. Regional labels permit a different comparison between the same kind of hate expressed in different places. The two pieces of information serve different experimental purposes.

Earlier work by Plaza-del Arco and colleagues had compared several approaches to Spanish hate speech detection using HaterNet and HatEval. The comparison included conventional classifiers, neural architectures, and pretrained systems. As the paper recounts it, Spanish-specific BETO performed better than multilingual alternatives including mBERT and XLM in that study. The authors mention other results in a similar direction. This made BETO a plausible choice for a controlled regional comparison. It also gave the authors a question to revisit with their own collections, including the new material on immigration.

The paper takes a second point of departure from Nozza’s work on zero-shot hate speech detection across Spanish, English, and Italian. In the authors’ account, Nozza found that cross-language transfer with mBERT was ineffective for misogyny and argued for closer attention to the different settings covered by such evaluations. That earlier comparison moved between languages. Castillo-López and colleagues ask whether the difficulty persists when the source and target belong to Spanish. The shared language removes one obvious distinction between the populations of tweets, while leaving regional usage and social context free to differ.

The authors also raise a concern about pretraining coverage. They describe mBERT as drawing on Wikipedia and point out that 39.2% of Spanish Wikipedia edits came from Spain in the snapshot they cite. They juxtapose that observation with the paper’s account of where Spanish native speakers live. The argument is about the possibility that the text available for pretraining gives different places unequal representation. The share of edits gives an indication of contributor geography. It leaves open which varieties appear in the articles, how their usage is represented, and how much of that usage is relevant to hate speech on Twitter. These are questions about language models and pretraining.

That distinction helps frame the experimental design. Regional differences in pretraining could matter, and the paper points to them as motivation. Its direct intervention in the transfer experiment is to change the regional source of the labeled tweets used for the task. That intervention can reveal dependence on the labeled source even if the regional balance of pretraining remains unknown. It can also uncover a problem that would be difficult to diagnose from a leaderboard where the data are combined under a single language name.

The method, step by step

Two experiments with different moving parts

The simplest way to follow the design is to picture a fixed pile of tweets from one region that will be used only for testing. The authors prepare one BETO classifier using labeled training tweets from that region and another using labeled training tweets from the other region. Both classifiers judge the same test tweets. The test labels tell the researchers which predictions are correct. The classifier transferred from the other region has had no task training on labeled examples from the test variety in that setting. The authors also perform the corresponding comparison with the other region as the target.

This exercise comes after a broader comparison. First, the researchers use the available Spanish data for each hate speech domain to compare mBERT and BETO. Second, they restrict the data to tweets with a known regional grouping and use BETO throughout. The first comparison changes the pretrained starting point. The second changes the source of the labeled examples while holding that starting point fixed. Within the second comparison, the researchers keep both the same-region and cross-region results. Same-region performance gives each target a reference that uses locally sourced task labels and the same test examples.

Pretraining here is the work already embodied in BERT before the authors teach it the specific task of recognizing hate speech. mBERT learned from Wikipedia material in 104 languages. BETO learned from Spanish Wikipedia and Spanish texts assembled through the OPUS Project. The paper describes Spanish material from sources such as subtitles and scientific documents among the material associated with BETO. It also says that BETO’s pretraining did not explicitly divide Spanish into regional varieties. The authors chose it over more recent Spanish systems because they considered its pretraining data a more comparable starting point alongside mBERT.

Both starting points are then adapted with task labels. In practical terms, the classifier sees tweets paired with the answers assigned by the dataset and is trained to predict those labels for other tweets. In the broad experiment the authors compare this adaptation for mBERT and BETO. In the transfer experiment, labels from the source region teach the task. The zero-shot condition applies to exposure to labeled task examples from the target variety. It does not require that the pretrained system has never encountered Spanish from that area. The adaptation stage is fine-tuning.

From regional tweets to a zero-shot transfer score

The steps in order.

From regional tweets to a zero-shot transfer scoreStep 1: Assemble labeled tweets for each hate speech task1. Assemble labeled tweets for each hate speech taskStep 2: Assign regional groups where the information is available2. Assign regional groups where the information is availableStep 3: Normalize links, mentions, and hashtags3. Normalize links, mentions, and hashtagsStep 4: Match regional sample sizes within each task4. Match regional sample sizes within each taskStep 5: Fine-tune BETO on the source training split5. Fine-tune BETO on the source training splitStep 6: Select the checkpoint on source development tweets6. Select the checkpoint on source development tweetsStep 7: Score each source on both regional test sets7. Score each source on both regional test sets

Assembling the misogyny data

The misogyny experiments draw on existing tweet collections. MisoCorpus-2020 has groupings that serve different purposes. One portion concerns attacks directed at prominent women. Another explicitly compares tweets in Spanish from Spain with tweets in Latin American Spanish. A further portion organizes posts by types of misogynistic attack, including sexual harassment and gender violence. These distinctions matter because the authors can use the available corpus for the pooled comparison, while only entries with the requisite regional information qualify for the transfer comparison.

MisoCorpus-2020 originally supplied 10,244 tweet identifiers. The researchers could retrieve 7,575 tweets, which the paper reports as 74% of the original dataset. Among the recovered entries, 49.2% carry a misogyny label. Retaining the distinction between identifiers and recovered tweets is important when interpreting the experiment. The training and test examples come from posts that the researchers could still obtain. The published list of identifiers describes a larger collection than the accessible experimental material.

Detección Misoginia, abbreviated DetMis, supplies examples from Mexico. Its creators started with 35K geolocated tweets and used search terms related to sexism, stereotypes, and discrimination against women. They looked for tweets associated with each of Mexico’s 32 states. The paper reports a cap of 5 tweets for a keyword and label during selection and a final yield of 1K tweets for each label. This produces a useful body of regionally identifiable examples with an even class mix. It also reflects the collection choices of that dataset, including the use of a single annotator.

The Spanish portion of IberEval 2018 supplies more examples for the pooled experiment. Its creators first had two annotators label some of the material to establish a standard. They then used majority voting on a crowdsourcing platform for the remaining labeling. The Spanish part contains material from European and Latin American usage, but the collection does not identify the variety of each individual tweet. The authors can use the posts to teach or evaluate the broad task of identifying misogyny in Spanish. They leave them out when the experiment requires a regional source or target assignment.

The practical effect is that the misogyny data have more than one provenance. The criteria for finding tweets, the availability of regional information, and the annotation process vary by corpus. The pipeline brings their records together for a binary classification task. For the regional experiment, it also uses the geographic information that those records make available. The paper reports the remaining tweet counts by region, which lets the reader see how much information is lost when individual regional assignments become a requirement.

Collecting the immigration tweets

For xenophobia, the authors wanted labeled tweets with regional information at the post level. They report finding no public collection that met that need, so they compiled HaSCoSVa-2022, the Hate Speech Corpus with Spanish Variations. They centered the collection on migration to Spain from Latin America and certain African countries, and on migration from Venezuela to surrounding Spanish-speaking countries. The regional groups thus represent particular conversations about immigration. Each brings its own nationalities, locations, and terms into the text before any annotation or training occurs.

The search used geographical boundaries. For Spain, the authors adopted the search area used in earlier work, with a radius of 520 Km around latitude 40.416705 and longitude −3.703583. For the Latin American collection, they used a radius of 1,200 Km around latitude −3.976015 and longitude −79.225102. They describe adapting the earlier geographical selection to leave out tweets produced in Venezuela. Their interest was in attitudes toward Venezuelan migrants in the countries around it. This decision determines whose posts were eligible and which migration situation those posts were likely to address.

The authors defined different keyword lists for the search. The European list has 72 terms, the Latin American list has 18, and the generic immigration list has 26. The terms include country names, words for people from particular places, and nicknames, including some that can be offensive. Search terms help find tweets potentially relevant to the annotation task. They do not determine the label. A country name can introduce news, personal experience, or hostility, and the fact that a keyword found the tweet gives the annotator little basis by itself for choosing among those readings.

Collection ran from June 6th to June 28th and from July 21st to August 4th. The authors obtained 75,834 tweets through the search. For the first sampling stage they randomly drew up to 50 European tweets per keyword and up to 200 Latin American tweets per keyword. The larger cap for Latin America reflects the smaller regional keyword list. The caps also helped the researchers keep less common terms represented among the candidates. This first stage left 11,298 tweets to sample from.

The authors then drew 2,500 European tweets and 1,500 Latin American tweets for annotation. The appendix describes reviewing the regional material before settling on the annotation allocation and aiming to obtain enough hateful examples for analysis. This sampling sequence matters when interpreting the positive-label share. The final annotations describe a keyword-retrieved, geographically bounded selection whose composition was shaped by per-keyword caps and different regional sample sizes. Its positive share is a property of that collection.

Deciding which tweets count as xenophobic

The annotation procedure distinguishes the target of the speech from what the speech does to that target. Under the paper’s rule, the tweet must primarily address immigrants as a group, or address an individual on account of membership in that group. A message that is hostile to a particular person for an unrelated reason falls outside that condition. The second condition concerns the nature of the attack. The tweet must promote, justify, or encourage hatred or violence, or aim to harm, dehumanize, or intimidate its target. The authors adapt their criteria from the shared-task guidelines for HatEval. HatEval.

Both conditions matter for searching and reading the corpus. A post containing a nationality or an offensive-sounding nickname may be a relevant candidate for review. The final judgment depends on how the term is used, whom the author is addressing, and whether the tweet does the kind of harm specified by the guidelines. Conversely, the judgment can depend on the force of an expression in a regional context even when its literal reading sounds mild. That places some of the same interpretive burden on the people preparing the labels that the authors later study in the classifications.

Two native Spanish speakers from Latin America initially labeled the tweets. They could choose xenophobic, non-xenophobic, or ambiguous. The ambiguity option gave them a way to record difficult judgments at the initial stage. A third annotator supplied the final label for disagreements and for cases where both initial annotators indicated ambiguity. This adjudicator worked without seeing the previous labels. The resulting corpus has binary labels for the detection experiments.

The paper reports 554 tweets labeled xenophobic and 3,446 labeled non-hateful toward immigrants. The xenophobic class makes up 13.9% of HaSCoSVa-2022. For the initial annotators, the authors report 88% raw agreement and a Cohen’s kappa of 0.443, which they describe as moderate. Raw agreement counts how often the annotators made the same choice. Kappa adjusts agreement for the amount expected from the annotators’ overall use of the labels. In a collection dominated by one label, many judgments can match even while disagreement remains important for the rarer cases. The paper reports both measurements for the linguistic annotation.

Each record includes the tweet identifier, post text, final label, and regional variety. The authors release HaSCoSVa-2022 together with the search keywords and annotation guidelines. Those supporting materials give the corpus a visible basis for inspection. A reader can distinguish the decisions that brought a tweet into the candidate pool from the decisions that assigned it a label. A tweet needed to pass through both stages before it could become an example in the experiments.

Preparing the text and constructing the splits

For all experiments, the authors replace URLs with url and account mentions with @user. The classifier can still observe that a post contains a link or addresses an account, while the specific link and username are removed from its input. The authors also use the Python package wordsegment to split hashtags into words. The motivation is that a string written as a single hashtag can carry ordinary wording relevant to the tweet. They cite evidence from earlier tasks in support of this preprocessing choice and apply it across the comparisons. This step is a form of tokenization and segmentation.

The general splitting procedure assigns 70% of the data to training and 30% to testing, with 20% of the initial training portion then reserved as a development set. The authors describe random splitting with the aim of preserving the distribution of hate and non-hate labels across partitions. In the immigration material, a representative allocation therefore retains a minority positive class. The authors’ separate decision to match regional sample sizes addresses a different kind of balance. It equalizes how many tweets are available from each region, while regional positive shares can still differ.

For the misogyny transfer experiment, the authors retain 6,082 tweets with known regional groupings. Of these, 3,596 are Latin American and 2,486 are European. They randomly reduce the larger Latin American pool to match the European one. Of the 2,486 tweets in each matched set, 1,392 go to training, 348 to development, and 746 to testing. This makes the locally trained and transferred conditions comparable in how much task data they receive. The same test set within a region is available for comparisons of the two training sources.

In the immigration corpus, all tweets have a region field. The size comparison is reversed because more European tweets were annotated. The larger European set is randomly reduced to match the Latin American one. Once the sets are matched, each region provides 840 training records, 210 development records, and 450 test records. Thus the two regional comparisons use the same design even though the original datasets differ in size and the larger starting pool comes from a different region in each task.

The development set is used to choose a checkpoint during training. A checkpoint preserves the classifier’s state at a particular point in the adaptation process. The authors train for 5 epochs, meaning passes through the training data, and choose the checkpoint with the highest development macro-F1. They repeat each fine-tuning setup with 5 random seeds and average the reported scores across those runs. The test score is the evaluation of the selected checkpoint on the held-out examples. The standard deviation describes how much the scores vary across the repeated runs.

Reading the evaluation measure

The paper evaluates the classifiers with macro-F1. To understand it, take the positive class first. Precision asks how many tweets called hateful by the classifier actually carry that label in the dataset. Recall asks how many tweets with the hateful label the classifier correctly finds. F1 combines these quantities in a way that gives a low result when either is low. The same calculation treats the negative class as the label of interest in turn. Macro-F1 then gives the two class-level results equal weight.

This is pertinent to the immigration corpus. A classifier that usually says a tweet is non-hateful can make many correct decisions because that label is abundant. Macro-F1 still gives the ability to identify xenophobia its own share of the score. At the same time, a single macro-F1 value leaves open whether the more common mistake is falsely flagging a tweet or missing a hateful tweet. The authors’ later error breakdown answers a more specific question about those directions. Their training and scoring procedure is described in terms of the splits, checkpoint selection, and metrics, without a formal equation for the task.

Experiments and results

Which starting point works better on the pooled data?

The pooled experiment takes the recovered MisoCorpus-2020 tweets, DetMis, and the Spanish IberEval data for the misogyny task. The paper’s dataset table reports 7575 tweets with 49.2% positive for MisoCorpus-2020, 2000 with 50% positive for DetMis, and 3307 with 49.9% positive for IberEval 2018. The immigration task uses the 4000 tweets from HaSCoSVa-2022 with a 13.9% positive share. The positive label changes meaning with the task. Accordingly, each macro-F1 score should be read against the corresponding set of examples and its annotation process.

mBERT is the multilingual baseline. BETO is the Spanish-specific alternative. The experiment asks how these pretrained starting points perform after both receive Spanish task data. This comparison does not depend on being able to assign a region to every tweet, so the IberEval material still contributes to the misogyny task. The authors report average test macro-F1 with standard deviations across 5 runs. Each run contributes the checkpoint selected by its development score.

On the pooled misogyny test split, mBERT reports 74.4 (± 7.0) and BETO reports 84.9 (± 0.3). The advantage for BETO appears alongside a substantial difference in run-to-run spread. For the xenophobia test split, mBERT reaches 69.6 (± 2.8) and BETO reaches 73.1 (± 0.8). BETO again has the higher mean and the lower standard deviation. The paper describes the performance advantage as larger for misogyny than for xenophobia.

mBERT and BETO on pooled Spanish misogyny test data

Spanish-specific BETO reaches the higher mean test score.

mBERT and BETO on pooled Spanish misogyny test datamBERT: 74.4mBERT74.4BETO (this paper): 84.9BETO (this paper)84.9
The numbers
System or settingMacro-F1
mBERT74.4
BETO (this paper)84.9

The repeated runs matter when the experiment is read as a comparison of training approaches. In the pooled misogyny setting, the mBERT result is accompanied by visibly more variation than BETO’s. The average compares typical performance across the runs the authors report. The standard deviations supply a second observation about how sensitive the evaluated results are to repetitions with different seeds. They are calculated across those runs, and the paper gives no per-run breakdown.

These results are broadly in line with the earlier Spanish comparisons the authors discuss. They are measured on the authors’ particular datasets and splits, with the new xenophobia corpus contributing a setting where the same ordering is observed. The larger advantage for misogyny means that the gain from the Spanish-specific starting point is not uniform across the two tasks. The pooled comparison leaves open how either starting point would behave if all the task examples from one region were withheld. The next experiment asks that question for BETO.

Does the training region matter for the same test tweets?

In the regional experiment, every target has two results. For the European test set, one classifier learned from European training tweets and the other learned from Latin American training tweets. For the Latin American test set, the two sources are compared again. The key comparison for a given target holds the test examples fixed. This matters because Europe and Latin America can differ in test difficulty, topic mix, and class proportions. Merely changing the test set would change all of those things at once.

For misogyny, European training gives a mean macro-F1 of 89.6 (± 0.6) on the European test split. Latin American training gives 71.4 (± 5.0) on that European split. On the Latin American test tweets, the local source reaches 81.8 (± 0.5) and the European source reaches 70.5 (± 0.5). In both cases, training data that match the target region produce the higher mean. The values also illustrate why the direction of comparison needs to be named. A score for European training tells a different story depending on whether the test tweets are European or Latin American.

BETO training sources on regional misogyny test splits

The training source that matches each test region gives the higher mean score.

BETO training sources on regional misogyny test splitsEurope test with Latin American training: 71.4Europe test with Latin American training71.4Europe test with European training (this paper): 89.6Europe test with European training (thispaper)89.6Latin America test with European training: 70.5Latin America test with Europeantraining70.5Latin America test with Latin American training: 81.8Latin America test with Latin Americantraining81.8
The numbers
System or settingMacro-F1
Europe test with Latin American training71.4
Europe test with European training (this paper)89.6
Latin America test with European training70.5
Latin America test with Latin American training81.8

The pattern recurs for hate speech against immigrants. On the European HaSCoSVa-2022 test split, the system trained on European tweets scores 69.6 (± 0.9). The system trained on Latin American tweets scores 62.8 (± 5.6) on the same split. On the Latin American test tweets, European training produces 64.9 (± 1.7) and Latin American training produces 73.3 (± 2.7). Each target again has a higher-scoring source in its own region. Both transfers still produce test scores well above zero, and neither achieves the mean of the corresponding local condition.

BETO training sources on regional HaSCoSVa-2022 test splits

Training on tweets from the target region gives the higher mean for each immigration test split.

BETO training sources on regional HaSCoSVa-2022 test splitsEurope test with Latin American training: 62.8Europe test with Latin American training62.8Europe test with European training (this paper): 69.6Europe test with European training (thispaper)69.6Latin America test with European training: 64.9Latin America test with Europeantraining64.9Latin America test with Latin American training: 73.3Latin America test with Latin Americantraining73.3
The numbers
System or settingMacro-F1
Europe test with Latin American training62.8
Europe test with European training (this paper)69.6
Latin America test with European training64.9
Latin America test with Latin American training73.3

The standard deviations qualify the comparisons. With the European test set as target, the transfer from Latin American training has a greater spread than the locally trained condition in both tasks. On the Latin American xenophobia target, the locally trained classifier has a greater spread than the one trained on Europe. On the Latin American misogyny target, both reported standard deviations are ± 0.5. The table thus shows an especially large spread for Latin American training evaluated on European tweets, along with a tie in variability for the Latin American misogyny test. The consistent result concerns the ordering of the means within each target.

Looking across tasks, the regional mismatch is not associated with a single expected score. The misogyny conditions that transfer between regions cluster around the low seventies on the paper’s macro-F1 scale. The xenophobia conditions that transfer between regions are lower on that scale. Each task also has different local reference scores. A comparison across domains therefore mixes the effect of regional transfer with the different datasets, label distributions, and kinds of language used to target women or immigrants. The within-target comparisons supply the cleaner evidence about whether the geographic source of training data matters.

The paper also discusses the comparison in which the source stays fixed and its evaluation moves to the other region. This answers a practical question about reusing a trained detector. For example, European-trained BETO has a high score on European misogyny tweets and a lower one on Latin American misogyny tweets. The fixed-target comparison complements that result by showing that the Latin American test set can be handled better by a classifier trained on local examples. Together, the comparisons establish that the low transferred score is associated with the source-target pairing. They do not require either regional test set to be treated as the harder one in general.

What the ablations show

What the regional comparison controls

The paper does not report a component-removal ablation. It offers a controlled comparison of training sources, a breakdown of shared classification errors, an analysis of vocabulary coverage, and a close look at the attribution of a prediction. These analyses operate at different levels. The source comparison identifies a performance change across full test sets. The error breakdown shows how often particular types of mistake occur among the examples both classifiers get wrong. The vocabulary and attribution analyses examine plausible links between the training data and individual decisions.

The training-source comparison keeps BETO fixed and matches the number of regional tweets supplied for training and development within each domain. The same target split is then scored in both conditions. This gives the authors grounds to conclude that the higher local scores are not simply a result of giving the local condition more examples. Matching the number of tweets does not set their content, labels, or original collection procedures equal. The intervention is to change the complete source dataset, with its regional wording and other characteristics together.

The pooled comparison serves a different role. Switching from mBERT to BETO changes the pretraining data and the language coverage as a package. The paper motivates BETO’s advantage by the concentration of its pretraining material in Spanish. The comparison supports choosing BETO for this experiment, while leaving the effects of individual differences between the starting points unresolved. The evaluation does not independently vary the subject matter of the pretraining material, the amount of Spanish, or representation of the regions in that material.

What both regional classifiers get wrong

A false positive is a tweet that receives the hateful prediction when its annotated label is non-hateful. A false negative is a tweet labeled hateful by the annotators that the classifier misses. For each target region and hate speech domain, the authors tabulate both kinds of mistake. They distinguish mistakes by each source-trained classifier and those that the two classifiers have in common. Shared errors are informative because changing the source of training data within this experiment did not fix those examples.

In the Latin American misogyny test set, the common errors include 44 false positives, or 59.5% of the shared mistakes, and 30 false negatives, or 40.5%. The larger share therefore consists of posts that both classifiers flag despite their non-misogynous annotation. The denominator is the set of shared mistakes on that target. These figures are not false-positive rates over all non-misogynous Latin American tweets. That distinction matters because a small subset of troublesome examples can have a different error mix from the full test set.

For xenophobia, missed hateful tweets dominate the common errors. On the European test split, there are 22 false negatives, representing 81.5% of shared mistakes, and 5 false positives, representing 18.5%. On the Latin American split, the common mistakes include 23 false negatives, or 65.7%, and 12 false positives, or 34.3%. These are errors made by both BETO classifiers on the same target region. The results show that the training source can change overall performance while leaving substantial overlap in what the classifiers fail to identify.

The authors suggest class imbalance as one explanation for the immigration pattern. The positive class accounts for 13.9% of the full corpus, so xenophobic tweets provide a relatively small part of the material from which the classifier learns. Frequently predicting the larger class can be consistent with missing examples from the smaller one. The study does not vary the prevalence of positive examples experimentally. The shared-error figures therefore describe the observed pattern and support examining imbalance as a possible cause. They do not specify how much a different class distribution would change the scores.

The common-error comparison also puts the same-region advantage in perspective. A higher mean with local training does not imply that the locally trained classifier has solved all region-specific examples or eliminated the dominant error type. The two predictions can agree on the wrong answer even when the classifiers have learned from different regions. For the immigrant test sets, the joint misses identify cases where both training sources leave an important part of the task difficult. The misogyny result on the Latin American target identifies a different tendency among its shared errors.

How much test vocabulary appears in training?

The authors test whether the training sources cover different portions of the test vocabulary. They use a Spanish tagger to identify nouns and adjectives and then report the share of test terms included in each training set. The restriction gives the analysis a consistent vocabulary subset to compare. The resulting figure is about terms that occur in labeled task data. It differs from asking whether a term can be represented by BETO’s tokenizer or whether it appeared during pretraining. The method uses part-of-speech tagging to define what counts in the comparison.

In the European misogyny test set, 50.3% of the selected terms appear in European training data and 39.6% appear in Latin American training data. In the Latin American misogyny test set, the pattern reverses with the target. Latin American training contains 47.7% of its terms, and European training contains 38.5%. For the Latin American xenophobia test split, the corresponding coverage is 48.1% for Latin American training and 40.3% for European training. The authors also report that 1,095 terms occur in the Latin American xenophobia test data and are absent from the European training set.

The paper reports that training sets from the same regional variety cover 9.2% more test terms on average than the alternatives across the two domains. The direction of that comparison follows the score ordering, with a local source providing better test vocabulary coverage and higher macro-F1. The fractions are far from complete coverage under either source. Thus a detector can work on many tweets whose nouns or adjectives were not present in its task examples, and the occurrence of an individual word in training does not ensure that it will be read correctly. The analysis shows that the conditions give the fine-tuning process different amounts of direct experience with the words it will later encounter.

The examples make the difference easier to interpret. The authors find cerda in the European misogyny data and say it is more commonly used as an insult in Spain than in Latin America. They find vieja in the Latin American tweets and discuss its potentially derogatory use for women in Mexico. The vocabulary method can identify this kind of absence across training sources. It does not measure how often an encountered word is derogatory or what its presence does to a specific prediction. It also counts terms that have no special connection to hate speech. Topic words and ordinary geographical references can contribute to the same coverage statistic.

There are at least two distinct questions behind the vocabulary explanation. One is whether the classifier has encountered a term in a labeled context during adaptation. The other is whether the contexts in which it encountered the term teach a reading that transfers. A coverage count bears on the first question. The paper’s motivating examples, where a word travels but its force changes, bear on the second. The authors turn to an individual prediction to examine that second question more closely.

What one prediction reveals about a familiar word

The paper uses SHAP to inspect individual classifications. SHAP assigns contributions to features of the input for a particular output. In this case the features correspond to terms in a tweet, and the authors examine which terms push the output toward or away from the misogyny label. The figure presents the same input to both BETO classifiers and shows their term contributions separately. This is an analysis of a trained classifier’s behavior on an example, a use of interpretability.

The tweet chosen for the analysis has a misogynous reference label and includes tonta, a feminine insult that the paper translates roughly as idiot. The tweet also contains other belittling language. The authors describe tonta as carrying stronger aggression in Spain than it may carry in Latin American use. Because the same tweet is fed to both classifiers, a difference in the attribution cannot be due to a change in the wording presented at test time. The difference appears after the classifiers have been adapted to distinct regional sources.

The European-trained classifier gives the positive label an output of 0.999471 and correctly classifies the tweet as misogynous. SHAP assigns tonta a strong contribution towards that decision. The Latin American-trained classifier gives the positive label an output of 0.017539 and assigns the tweet to the non-misogynous class. For this classifier the term contributes very little. The authors describe its slight influence as pointing towards the negative decision. These values are outputs for the positive label on the individual example.

The vocabulary counts and the example illuminate different possibilities. A regional term absent from one training source can deprive the classifier of labeled examples showing how the word is used. A shared term can still acquire a different role in prediction depending on the examples surrounding it. The tonta analysis illustrates the latter through two markedly different contributions on identical test text. It does not estimate how common that effect is or show what would happen if the term were changed in the tweet. The authors’ broader conclusion rests on the test-set comparisons, with the attribution supplying a concrete instance of how the difference can appear.

Limitations

Limits the authors identify

The authors explicitly simplify the geography. They treat European Spanish and Latin American Spanish as regional groups that can be used consistently in the experiment. They acknowledge the dialect variation within those groups. Their European evidence is drawn from Spain, and their Latin American data include several countries, with different coverage depending on the task and the contributing corpus. A score for the Latin American group cannot tell a reader whether transfer works equally well for tweets from Mexico, Colombia, or Ecuador. The regional split is informative at its chosen scale.

The authors also identify a possible source of annotation bias in HaSCoSVa-2022. All three annotators are from Latin America. A speech community can share some regional meanings and differ in its understanding of expressions from Spain, particularly when the relevant detail is whether a term carries an unusual insult or discriminatory implication. This concern is directly related to the research question. If judgments about hateful language vary with familiarity, an annotation process can be affected by some of the same regional differences the classifiers are being tested on.

The paper describes specific attempts to address that limitation. The guidelines included observations about expressions from Spain that might be confusing. Having spent a considerable period living in Spain, the adjudicator also had academic training in political science and in the study of discrimination against minorities. In ambiguous or disputed cases, that annotator supplied an independent decision. The authors regard these measures as mitigating the issue and invite additional annotation and reports of problems with the released material. The agreement figures describe the results of the initial annotation process as a whole. They do not compare ratings from separate panels of Spanish and Latin American annotators.

The choice of BETO also bounds the authors’ intended scope. They say that Spanish-specific alternatives appeared after BETO and leave a broader evaluation of Spanish pretrained systems for future work. BETO provides a defensible point of comparison with mBERT and the common starting point for the regional experiment. The reported ordering applies to these systems under the paper’s evaluation. The authors also note earlier evidence that mBERT can be valuable in low-resource language settings. The comparison here involves Spanish and the task data assembled for this study. Low-resource languages.

Limits visible in the design

The xenophobia transfer experiment changes the migration situation along with the regional source. The European corpus concerns immigration to Spain, including arrivals from Latin America and certain African countries. The Latin American corpus focuses on immigration from Venezuela to neighboring countries. A classifier may therefore encounter a different set of nationalities, locations, references, and stereotypes when evaluated across regions. A noun that fails to carry over might signal a different conversation about migration, a different dialect, or both. Equal sample sizes do not disentangle those possibilities.

The keyword selection reinforces this point. The authors intentionally define different regional lists to find the speech relevant to each immigration situation, as well as a generic list used across the search. This is a reasonable way to collect relevant tweets. It also makes the vocabulary of the final collections depend in part on how candidate tweets were retrieved. A measured difference in vocabulary coverage is consequently evidence about the training and test sets as built. Its size cannot be taken as a direct estimate of vocabulary differences between the regional varieties at large.

The misogyny experiment presents a related issue through corpus provenance. Some regional examples come from MisoCorpus-2020, and DetMis supplies specifically Mexican material. The underlying collections differ in how they found and labeled examples. Training on a regional pool can therefore introduce collection-specific regularities along with regional ones. A classifier given locally sourced tweets may benefit from exposure to comparable vocabulary, similar subject matter, annotation conventions, or a combination of these. The design shows that the source pool matters with the test examples held fixed. It offers no independent intervention that assigns a separate share of the gain to each property of that pool.

The regional labels also describe an operational grouping of tweets. In the new corpus, location supplies evidence for assignment. It gives the researchers a practical way to define data from particular areas. A tweet’s collection location, on its own, gives limited information about the author’s history, audience, or mixture of language varieties. The broad groupings are suitable for asking whether classifiers transfer across the selected pools. Finer claims about regional identity or dialect would require finer evidence about the tweets and their authors.

The positive share of HaSCoSVa-2022 needs similar care. The corpus is built around geographically eligible tweets that match search terms, followed by caps on keyword sampling and a separate choice of regional annotation totals. The 13.9% positive share describes the resulting annotated sample. Estimating the prevalence of xenophobia across Twitter in either region would call for a sampling design aimed at that population. The present corpus was created to supply examples for classification and to make a regional transfer comparison possible.

The numerical results are means and standard deviations over repeated fine-tuning runs on the defined splits. They establish a consistent ordering of the reported means for the regional comparisons in the paper. They do not give variability across anew draws of regions, time periods, or data collection protocols. The paper also does not report a formal significance test alongside the regional results. The clearest interpretation is that the matching source has the higher measured macro-F1 across the reported targets, with variability across runs that differs by setting.

Finally, the authors suggest training on examples from more varieties when those varieties must be handled together. The direction follows from the observed advantage for locally matched examples. The regional experiment evaluates local and transferred sources separately, so it leaves open how much tagged data a jointly trained classifier would need from each region or whether a jointly trained classifier would match the strongest local results. The pooled BETO comparison answers a different question because it uses the wider available corpora and different test splits. A direct comparison between mixed training and each matched training source would be needed to evaluate that proposal.

What came after

A Parallel Corpus for Vietnamese Central-Northern Dialect Text Transfer connects the problem of variation inside a language to a different task. It focuses on a parallel corpus for Central and Northern Vietnamese and on transferring text between the dialects. In the Spanish study, separate regional collections supply texts to be classified under a common task definition. A parallel corpus is organized around corresponding texts in the varieties it represents. The connection is the decision to make the varieties explicit in the data. The work on Vietnamese uses that distinction to organize a text-transfer resource, while the Spanish experiments use it to test the portability of a classifier.

MAGNET addresses multilingual fairness using adaptive gradient-based tokenization. Its subject is the way text is split into units for processing. The Spanish paper’s regional experiment uses a fixed pretrained starting point and changes which labeled source supplies the training tweets. MAGNET places the intervention at the level of tokenization. The relationship between the questions is that coverage can depend on how a system represents language before any task-specific judgment is made. The Spanish paper measures unequal overlap in labeled vocabulary and examines different readings of a shared term. MAGNET takes the representation of text as the part to adapt.

Evaluating Pixel Language Models on Non-Standardized Languages takes up evaluation for non-standardized languages using pixel-based processing. It brings another representation of text into the wider question of how systems handle forms that have less standardized written usage. Castillo-López and colleagues examine regional variation within Spanish through hate speech labels, including cases where the same written word can carry different force. The later work concerns non-standardized languages and the evaluation of a particular approach to representing them. Its connection to the Spanish study lies in making performance on varieties of interest an explicit evaluation question.

The links establish that these works cite the Spanish study. Their stated topics show different ways of taking language variation seriously, through paired dialect data, adaptive tokenization, or evaluation with pixel-based input. They leave open whether any of the later work reused HaSCoSVa-2022 or tested the same source-target combinations. The specific contribution of the Spanish experiments is their matched comparison of local and transferred training examples. That comparison makes it possible to see a regional shortfall that a pooled score, even a strong one, can conceal.

Cite

Cite as Galo Castillo-lópez, Arij Riabi and Djamé Seddah. 2023. Analyzing Zero-Shot transfer Scenarios across Spanish variants for Hate Speech Detection. Tenth Workshop on NLP for Similar Languages, Varieties and Dialects (VarDial 2023).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2023.vardial-1.1

@inproceedings{castillolopez2023analyzing,
  title = {{Analyzing Zero-Shot transfer Scenarios across Spanish variants for Hate Speech Detection}},
  author = {Galo Castillo-lópez, Arij Riabi and Djamé Seddah},
  booktitle = {Tenth Workshop on NLP for Similar Languages, Varieties and Dialects (VarDial 2023)},
  year = {2023},
  doi = {10.18653/v1/2023.vardial-1.1},
  url = {https://doi.org/10.18653/v1/2023.vardial-1.1}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/lopez-2023-analyzing-zero-shot-transfer-scenarios/