tweeteval-eval
TweetEval: Unified Benchmark and Comparative Evaluation for Tweet Classification — Barbieri et al. (2020) (arXiv:2010.12421, 2020)
What this evaluates
Evaluates the ability of language models to classify short social media posts across seven distinct Twitter-specific tasks, including sentiment, emotion, hate speech, and irony detection. It probes domain adaptation by comparing models pre-trained on generic text versus those further trained on large-scale Twitter corpora.
Datasets
Metrics
M-F1 (primary) — range: [0, 1]
- Macro-averaged F1 score, computed as the unweighted mean of the F1 scores for each class. Calculated as 2 * (precision * recall) / (precision + recall) per class, then averaged across all classes.
F(i) — range: [0, 1]
- F1 score specifically used for the irony detection task.
M-Rec — range: [0, 1]
- Macro-averaged recall, computed as the unweighted mean of recall scores across all classes.
AVG (F(a), F(f)) — range: [0, 1]
- Average of the F1 scores for the two stance targets (against and for), used for the stance prediction task.
Input / output format
Input: Raw tweet text (strings, typically ≥3 tokens, with URLs removed).
Output: Discrete class label corresponding to the specific classification task (e.g., positive/negative for sentiment, emotion categories, offensive/non-offensive, etc.).
Scoring recipe
def compute_macro_f1(predictions, gold_labels, num_classes):
class_f1s = []
for c in range(num_classes):
tp = sum(1 for p, g in zip(predictions, gold_labels) if p == c and g == c)
fp = sum(1 for p, g in zip(predictions, gold_labels) if p == c and g != c)
fn = sum(1 for p, g in zip(predictions, gold_labels) if p != c and g == c)
prec = tp / (tp + fp) if (tp + fp) > 0 else 0
rec = tp / (tp + fn) if (tp + fn) > 0 else 0
f1 = 2 * prec * rec / (prec + rec) if (prec + rec) > 0 else 0
class_f1s.append(f1)
return sum(class_f1s) / len(class_f1s)
Common pitfalls
- Training data for emoji prediction was downscaled to ≤50k tweets per task due to Twitter's data distribution policy, leading to lower performance compared to original SemEval benchmarks that used larger datasets.
- Validation and test splits for hate speech were collected at different timespans, causing topic distribution shifts and significant performance drops when models are optimized on the validation set.
- Models should be evaluated on the test set using the best hyperparameters selected on the validation set, not the validation scores themselves.
Evidence (verbatim from paper)
Table 3: TweetEval validation and test results. For neural models we report both the average result from three runs and its standard deviation, and the best result according to the validation set (parentheses). SotA results correspond to the best systems in the original shared tasks - they are included for completeness as they not directly comparable. Splits might differ, and * indicates that a larger training set is used.* Metric | | M-F1 | M-F1 | M-F1 | F(i) | M-F1 | M-Rec | AVG (F(a),$F^{(f)}$) | TE |
Citation
@misc{barbieri2020tweeteval,
title={TweetEval: Unified Benchmark and Comparative Evaluation for Tweet Classification},
author={Barbieri et al. (2020)},
year={2020},
note={arXiv:2010.12421}
}
1---2name: tweeteval-eval3description: Evaluates the ability of language models to classify short social media posts across seven distinct Twitter-specific tasks, including sentiment, emotion, hate speech, and irony detection. It probes domain adaptation by comparing models pre-trained on generic text versus those further trained on large-scale Twitter corpora. Use when the user wants to benchmark on TweetEval, or asks about evaluating this task. Reports M-F1.4---56# tweeteval-eval78> TweetEval: Unified Benchmark and Comparative Evaluation for Tweet Classification — Barbieri et al. (2020) (arXiv:2010.12421, 2020)910## What this evaluates1112Evaluates the ability of language models to classify short social media posts across seven distinct Twitter-specific tasks, including sentiment, emotion, hate speech, and irony detection. It probes domain adaptation by comparing models pre-trained on generic text versus those further trained on large-scale Twitter corpora.1314## Datasets1516- **TweetEval** — total ?; splits: train (-1), val (-1), test (-1); repo https://github.com/cardiffnlp/tweeteval1718## Metrics1920- `M-F1` **(primary)** — range: [0, 1]21 - Macro-averaged F1 score, computed as the unweighted mean of the F1 scores for each class. Calculated as 2 * (precision * recall) / (precision + recall) per class, then averaged across all classes.22- `F(i)` — range: [0, 1]23 - F1 score specifically used for the irony detection task.24- `M-Rec` — range: [0, 1]25 - Macro-averaged recall, computed as the unweighted mean of recall scores across all classes.26- `AVG (F(a), F(f))` — range: [0, 1]27 - Average of the F1 scores for the two stance targets (against and for), used for the stance prediction task.2829## Input / output format3031**Input**: Raw tweet text (strings, typically ≥3 tokens, with URLs removed).3233**Output**: Discrete class label corresponding to the specific classification task (e.g., positive/negative for sentiment, emotion categories, offensive/non-offensive, etc.).3435## Scoring recipe3637```python38def compute_macro_f1(predictions, gold_labels, num_classes):39 class_f1s = []40 for c in range(num_classes):41 tp = sum(1 for p, g in zip(predictions, gold_labels) if p == c and g == c)42 fp = sum(1 for p, g in zip(predictions, gold_labels) if p == c and g != c)43 fn = sum(1 for p, g in zip(predictions, gold_labels) if p != c and g == c)44 prec = tp / (tp + fp) if (tp + fp) > 0 else 045 rec = tp / (tp + fn) if (tp + fn) > 0 else 046 f1 = 2 * prec * rec / (prec + rec) if (prec + rec) > 0 else 047 class_f1s.append(f1)48 return sum(class_f1s) / len(class_f1s)49```5051## Common pitfalls5253- Training data for emoji prediction was downscaled to ≤50k tweets per task due to Twitter's data distribution policy, leading to lower performance compared to original SemEval benchmarks that used larger datasets.54- Validation and test splits for hate speech were collected at different timespans, causing topic distribution shifts and significant performance drops when models are optimized on the validation set.55- Models should be evaluated on the test set using the best hyperparameters selected on the validation set, not the validation scores themselves.5657## Evidence (verbatim from paper)5859> Table 3: TweetEval validation and test results. For neural models we report both the average result from three runs and its standard deviation, and the best result according to the validation set (parentheses). SotA results correspond to the best systems in the original shared tasks - they are included for completeness as they not directly comparable. Splits might differ, and * indicates that a larger training set is used.* Metric | | M-F1 | M-F1 | M-F1 | F(i) | M-F1 | M-Rec | AVG (F(a),$F^{(f)}$) | TE |6061## Citation6263```bibtex64@misc{barbieri2020tweeteval,65 title={TweetEval: Unified Benchmark and Comparative Evaluation for Tweet Classification},66 author={Barbieri et al. (2020)},67 year={2020},68 note={arXiv:2010.12421}69}70```7172- arXiv: 2010.12421