Skip to content

sheffieldnlp/stance-conditional

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stance-conditional

Experiments for "unseen target" stance detection with conditional encoding on the SemEval 2016 Stance Detection (http://alt.qcri.org/semeval2016/task6/) dataset.

Paper: Isabelle Augenstein, Tim Rocktäschel, Andreas Vlachos, Kalina Bontcheva. Twitter Stance Detection with Bidirectional Conditional Encoding. Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP 2016), November 2016.

Official stance data is available via https://www.dropbox.com/sh/o8789zsmpvy7bu3/AABRja7NDVPtbjSa-y3GH0jAa?dl=0 and collected unlabelled tweets are stored in https://www.dropbox.com/sh/7i2zdnet49yb1sh/AAA_AzN64JLuNlfU5pt69W8ia?dl=0

  • semeval2016-task6-trainingdata.txt is the official training set for Task A (seen target)
  • semeval2016-task6-trialdata.txt is the official trial data for Task A (seen target)
  • semeval2016-task6-train+dev.txt is the official training data concatenated with the official trial data for Task A (seen target)
  • semEval2016-Task6-subtaskA-testdata-gold.txt is the official test data for Task A (seen target)
  • downloaded_Donald_Trump.txt is the official development data for Task B (unseen target)
  • semEval2016-Task6-subtaskB-testdata.txt is the official test data for Task B (unseen target)
  • additionalTweetsStanceDetection.json contains additional crawled tweets (November - January) containing, each mentioning at least one of the targets for Task A or Task B

Note that for the unseen target task, no labelled training data is available, only unlabelled development data. The Task A train + dev data can be used for training instead.

Results:

Dependencies:

Running instructions:

  • Download all the above mentioned files and save them in the data/ subfolder
  • Download the official SemEval evaluation materials from here and put the file eval.pl in the stancedetection directory.
  • Add the twokenize submodule:
git submodule add https://github.com/leondz/twokenize.git twokenize_wrapper
touch twokenize_wrapper/__init__.py
  • Make sure twokenize_wrapper, readwrite, and stancedetection are on PYTHONPATH
  • Run word2vec_training.py first to pre-train a word2vec model on the unlabelled data
mkdir out
cd stancedetection
python3 word2vec_training.py
  • To run stance detection training and test with conditional encoding:
python3 conditional.py

Note that accuracy and loss are printed during training for the training set, whereas P/R/F1 are printed during training for the dev or test set.

Bidirectional Conditional Encoding for Tensorflow version 0.11+:

  • A version of the bidirectional conditional reader for Tensorflow version 0.11+ implemented with dynamic RNNs is contained in stancedetection/bicond_tf11.py
  • Note that this is only for illustration purposes / for those who want to apply the model to other tasks, and it is not connected to the rest of the code

About

Stance Detection with Conditional Encoding

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published