This repository contains code to train and evaluate transformer-based models for multi-label classification of fallacies developed by MALTO for FADE-IT @EVALITA 2026.
It supports two workflows:
- Internal evaluation: train on train split, validate on val split, evaluate on test split (with two annotator label sets).
- Competition / submission: train on a full labeled dataset (original or augmented) and predict labels for an unlabeled
test.tsvfile, producing a submission TSV.
Install dependencies:
pip install torch transformers scikit-learn tqdm iterstrat numpyIf you use a GPU, make sure your installed PyTorch build supports CUDA.
The code expects the following structure:
paper_repo/
├─ train.py
├─ train_pipeline.py
├─ full_data.json
├─ full_data_augmented.json
├─ splits/
│ ├─ train_set.json
│ ├─ val_set.json
│ ├─ test_set.json
│ ├─ train_set_augmented.json
├─ test.tsv # (Evalita provided unlabeled test file)
This mode is used to reproduce results for the paper and inspect performance.
python train.py --mode internal --model alberto --loss bce --dataset original_dataModels
xlm-roberta→xlm-roberta-baseumberto→Musixmatch/umberto-commoncrawl-cased-v1alberto→m-polignano-uniba/bert_uncased_L-12_H-768_A-12_italian_alb3rt0
Loss functions
bceweighted_bcefocal
Internal datasets
original_data→ usessplits/train_set.json,splits/val_set.json,splits/test_set.jsonaugmented_data→ usessplits/train_set_augmented.json,splits/val_set.json,splits/test_set.json
After training, the program prints:
- Metrics on Test set using labels_a1
- Metrics on Test set using labels_a2
- Mean metrics (average of the two)
- Per-label metrics table (precision/recall/F1/support)
A run folder is created under:
runs/internal/<dataset>__<model>__<loss>__<timestamp>/
This folder typically contains:
cli_args.json(the command-line arguments used)results.json(global metrics and metadata)- optional: prediction JSON files (if enabled in
train_pipeline.py)
This mode is used to train on a full labeled dataset and predict on an unlabeled test.tsv file.
python train.py --mode competition --model xlm-roberta --loss focal --competition_dataset original_full --test_tsv test.tsv --out_tsv submission.tsvpython train.py --mode competition --model xlm-roberta --loss focal --competition_dataset augmented_full --test_tsv test.tsv --out_tsv submission.tsvCompetition mode uses full training JSON files only:
original_full→train_full_original.jsonaugmented_full→train_full_augmented.json
The output file is a TSV (e.g., submission.tsv) with the same columns as the input test.tsv, but filled with predictions:
labels_a1contains predicted labels as a pipe-separated string:Label1|Label2|...labels_a2is filled with the same predictions by default
The file is saved either at the path you provide in --out_tsv or inside the run folder if you provide a filename only.