This repo is the implemention of our paper "Infusing Wikipedia Knowledge to Enhance Stance Detection", where we propose to utilize the background knowledge from Wikipedia about the target to improve stance detection.
In this paper, we experiment on three datasets: PStance, COVID19-Stance, and VAST.
- VAST is publicly available at here and thus the data is also included in this repo.
- The authors of PStance did not make the dataset readily accessible on the Internet. To gain access to it, please contact the first author of the paper. After you have the data files (raw_{phase}_{target}.csv, phase
$\in$ {train, val, test}, target$\in$ {bernie, trump, biden}), put them under data/pstance and run the jupyter notebook to pre-process the data. - For COVID19-Stance, the author just made the tweet ids publicly available at here. To gain the tweet contents, you can either use Twitter API or contact the first author. After you have the data files, put them under data/covid19-stance
Install Pytorch and Huggingface Transformers.
PStance, target-specific stance detection, Biden
python run_pstance_biden.py
COVID19-Stance, target-specific stance detection, face mask
python run_covid_fauci.py
PStance, cross-target stance detection, Biden
python run_pstance_biden2sanders.py
VAST, zero/few-shot stance detection
python run_vast.py
@inproceedings{he2022infusing,
title={Infusing Knowledge from Wikipedia to Enhance Stance Detection},
author={He, Zihao and Mokhberian, Negar and Lerman, Kristina},
booktitle={Proceedings of the 12th Workshop on Computational Approaches to Subjectivity, Sentiment \& Social Media Analysis},
pages={71--77},
year={2022}
}