zihaohe123 / wiki-enhanced-stance-detection

21 stars 4 forks source link

Infusing Wikipedia Knowledge to Enhance Stance Detection

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.

Dataset Preparation

In this paper, we experiment on three datasets: PStance, COVID19-Stance, and VAST.

  1. VAST is publicly available at here and thus the data is also included in this repo.
  2. 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.
  3. 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

Installation

Install Pytorch and Huggingface Transformers.

Run

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 $\rightarrow$ Sanders

python run_pstance_biden2sanders.py

VAST, zero/few-shot stance detection

python run_vast.py

Citation

@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}
}