GithubHelp home page GithubHelp logo

ericduy / stance-conditional Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sheffieldnlp/stance-conditional

0.0 1.0 0.0 69 KB

Stance Detection with Conditional Encoding

Perl 5.72% Python 94.28%
stance

stance-conditional's Introduction

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

stance-conditional's People

Contributors

isabelleaugenstein avatar rockt avatar andreasvlachos avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.