Paper link: [TODO]
Please cite:
@inproceedings{Allaway2020Zero,
title={Zero-Shot Stance Detection: A Dataset and Model using Generalized Topic Representations},
author={Emily Allaway and Kathleen McKeown},
booktitle={Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing},
year={2020}
}
python 3.7.6
scikit-learn 0.22.1
transformers 2.3.0
pytorch 1.5.0 (Cuda 9.2)
numpy 1.18.1
pandas 0.25.3
matplotlib 3.1.3
scipy 1.4.1
Run
cd src/
./train.sh <config_name> <num_warmup_epochs> <optimization_key>
For example:
cd src/
./train.sh ../config/config-tganet.txt 0 "f-0_macro"
Opimization key is for early stopping. Potential values are
- "f_macro": macro F1 on all examples in the dev set
- "f-0_macro": macro F1 on zero-shot examples in the dev set
- "f-1_macro": macro F1 on few-shot examples in the dev set
Run
cd src/
./eval.sh "eval" <config_name>
For example
cd src/
./eval.sh "eval" ../config/config-tganet.txt
Run
cd src/
./eval.sh "predict" <config_name> <output_file_name>
For example
cd src/
./eval.sh "predict" ../config/config-tganet.txt ../tganet_predictions.csv
For BoWV model, run
cd src/modeling/
python baselines.py -m "eval" -i vast_train.csv -d vast_test.csv -t "bowv"
For CMaj model, run
cd src/modeling/
python baselines.py -m "eval" -i vast_train.csv -d vast_test.csv -t "cmaj"
Run
cd src/
python hyperparam_selection.py -m 1 -k <optimization_key> -s <config_name>
For example
python hyperparam_selection.py -m 1 -k "f-0_macro" -s ../config/hyperparam-tganet.txt
Run
cd src/clustering/
./gen_reps.sh
Please contact Emily Allaway at [email protected] with an questions.