This is the source code of IJCNN 2024 paper SentKB-BERT: Sentiment-filtered Knowledge-based Stance Detection
To run the code in this repo, you need to have following dependencies:
python==3.9.6
pytorch==1.12.1
transformers==4.32.1
torch-scatter==2.0.9
pytorch-geometric==2.3.1
spacy==3.5.3
requests==2.27.1
responses==0.13.3
tqdm==4.65.0
gensim==4.3.0
networkx==3.1
We evaluated the proposed model on VAST, which is included in data/VAST of this repo.
The ConceptNet must be downloaded separately and placed in data/ with VAST.
Following WS-BERT, we collected topic-related data and store them into data/VAST/wiki-vast.csv and data/VAST/wiki_dict.pkl.
The summarized text are indluded in data/VAST of this repo. You can also choose other summarization model to regenerate the summarization.
Before training the stance detection model, we first train a graph encoder following BS-RGCN:
python src/preprocess_graph.py
python src/train_and_extract_graph_features.py
python src/extract_graph_features.pypython run_vast.py
