x-topic-eval
Multilingual Topic Classification in X: Dataset and Analysis — Antypas et al. (2024) (arXiv:2410.03075, 2024)
What this evaluates
This benchmark evaluates multilingual topic classification on social media tweets across four languages (English, Spanish, Japanese, Greek). It probes models' ability to generalize across languages and training regimes, including zero-shot, few-shot, monolingual, cross-lingual, and multilingual fine-tuning settings.
Datasets
- X-Topic — total 5000; splits: train (3600), val (400), test (1000)
Metrics
macro-F1 (primary) — range: [0, 1]
- Computes the unweighted mean of the F1 score for each topic label, assigning equal importance to every class regardless of its frequency in the dataset.
micro-F1 — range: [0, 1]
- Aggregates the total true positives, false positives, and false negatives across all topic labels before computing precision and recall, thereby weighting frequent topics more heavily.
Input / output format
Input: A single tweet text in one of four languages (English, Spanish, Japanese, or Greek).
Output: A single topic label from the dataset's fine-grained social media topic taxonomy.
Scoring recipe
def compute_f1(y_true, y_pred, average='macro'):
# y_true, y_pred: lists of ground-truth and predicted topic labels
# macro-F1: calculate F1 per class, then take the unweighted mean
# micro-F1: sum TP, FP, FN globally across all classes, then F1 = 2*P*R/(P+R)
from sklearn.metrics import f1_score
return f1_score(y_true, y_pred, average=average)
Common pitfalls
- The few-shot setting uses examples selected from the validation set of each fold (not the training set) to maximize topic coverage.
- The cross-lingual setting trains exclusively on English data but evaluates on other languages, introducing a temporal mismatch between training and test sets.
- Due to significant label imbalance, accuracy is misleading; macro-F1 must be used to fairly evaluate rare topics.
Evidence (verbatim from paper)
Due to the nature of X-Topic, we use the macro-F1 score, which assigns equal weights to each label, as the evaluation metric. This metric is often used for multi-label classification tasks Hazaa et al. ([2023]); Lipton et al. ([2014]); Mohammad et al. ([2018]). In order to better understand the performance of the models and due to the imbalanced nature, which can be a challenge for a model’s performance evaluation He and Garcia ([2009]), micro-F1 is also reported.
Citation
@misc{antypas2024xtopic,
title={Multilingual Topic Classification in X: Dataset and Analysis},
author={Antypas et al. (2024)},
year={2024},
note={arXiv:2410.03075}
}
1---2name: x-topic-eval3description: This benchmark evaluates multilingual topic classification on social media tweets across four languages (English, Spanish, Japanese, Greek). It probes models' ability to generalize across languages and training regimes, including zero-shot, few-shot, monolingual, cross-lingual, and multilingual fine-tuning settings. Use when the user wants to benchmark on X-Topic, or asks about evaluating this task. Reports macro-F1.4---56# x-topic-eval78> Multilingual Topic Classification in X: Dataset and Analysis — Antypas et al. (2024) (arXiv:2410.03075, 2024)910## What this evaluates1112This benchmark evaluates multilingual topic classification on social media tweets across four languages (English, Spanish, Japanese, Greek). It probes models' ability to generalize across languages and training regimes, including zero-shot, few-shot, monolingual, cross-lingual, and multilingual fine-tuning settings.1314## Datasets1516- **X-Topic** — total 5000; splits: train (3600), val (400), test (1000)1718## Metrics1920- `macro-F1` **(primary)** — range: [0, 1]21 - Computes the unweighted mean of the F1 score for each topic label, assigning equal importance to every class regardless of its frequency in the dataset.22- `micro-F1` — range: [0, 1]23 - Aggregates the total true positives, false positives, and false negatives across all topic labels before computing precision and recall, thereby weighting frequent topics more heavily.2425## Input / output format2627**Input**: A single tweet text in one of four languages (English, Spanish, Japanese, or Greek).2829**Output**: A single topic label from the dataset's fine-grained social media topic taxonomy.3031## Scoring recipe3233```python34def compute_f1(y_true, y_pred, average='macro'):35 # y_true, y_pred: lists of ground-truth and predicted topic labels36 # macro-F1: calculate F1 per class, then take the unweighted mean37 # micro-F1: sum TP, FP, FN globally across all classes, then F1 = 2*P*R/(P+R)38 from sklearn.metrics import f1_score39 return f1_score(y_true, y_pred, average=average)40```4142## Common pitfalls4344- The few-shot setting uses examples selected from the validation set of each fold (not the training set) to maximize topic coverage.45- The cross-lingual setting trains exclusively on English data but evaluates on other languages, introducing a temporal mismatch between training and test sets.46- Due to significant label imbalance, accuracy is misleading; macro-F1 must be used to fairly evaluate rare topics.4748## Evidence (verbatim from paper)4950> Due to the nature of X-Topic, we use the macro-F1 score, which assigns equal weights to each label, as the evaluation metric. This metric is often used for multi-label classification tasks Hazaa et al. ([2023]); Lipton et al. ([2014]); Mohammad et al. ([2018]). In order to better understand the performance of the models and due to the imbalanced nature, which can be a challenge for a model’s performance evaluation He and Garcia ([2009]), micro-F1 is also reported.5152## Citation5354```bibtex55@misc{antypas2024xtopic,56 title={Multilingual Topic Classification in X: Dataset and Analysis},57 author={Antypas et al. (2024)},58 year={2024},59 note={arXiv:2410.03075}60}61```6263- arXiv: 2410.03075