GithubHelp home page GithubHelp logo

xhuang28 / semi-supervised-baselines Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bplank/semi-supervised-baselines

0.0 2.0 0.0 2.75 MB

Code for "Strong Baselines for Neural Semi-supervised Learning under Domain Shift" (Ruder & Plank, 2018 ACL)

Shell 2.20% Python 97.80%

semi-supervised-baselines's Introduction

Strong Baselines for Neural Semi-supervised Learning under Domain Shift

Sebastian Ruder, Barbara Plank (2018). Strong Baselines for Neural Semi-supervised Learning under Domain Shift. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), Melbourne, Australia.

Requirements

Python 3.6, scipy, progress, sklearn, and gensim. The packages can be installed with the following commands:

pip install scipy
pip install progress
pip install sklearn
pip install gensim

Alternatively, you can also install all packages directly with: pip install -r requirements.txt

DyNet

We use the neural network library DyNet, which works well with networks that have dynamic structures. If you just want to run DyNet on CPU, you can install it with: pip install dynet. If you want GPU compatibility, follow the instructions here.

Data

Part-of-speech tagging

For part-of-speech tagging, Wall Street Journal (WSJ) data is used for training and development (in data/gweb_sancl/pos_fine/wsj). For a specific target domain TARGET, unlabeled data from data/gweb_sancl/pos_fine/unlabeled/gweb-TARGET-unlabeled.txt is used and test data is in data/gweb_sancl/TARGET.

Sentiment analysis

For sentiment analysis, download the processed version of the Multi-Domain Sentiment Dataset (processed_acl.tar.gz)from here. Extract it to data/processed_acl. We use the same splits as in (Ganin et al., 2016; Saito et al., 2017). Note that these are different from the "standard" splits used in (Blitzer et al., 2007).

Examples

We provide examples for running the MT-Tri POS tagger and sentiment model.

Example for running the Tagger (MT-Tri)

  1. Make sure the unlabeled and labeled seed data is in data/gweb_sancl (example for answers is provided)
  2. Download the embeddings from https://www.dropbox.com/s/4easof0ggsbox9y/embeds-acl2018.tar.gz?dl=0 and extract to embeds/

Now run the tagger (which by default uses the pos_glove setup and the 10% setup):

sh run-tagger-mttri.sh

Example for running the sentiment model (MT-Tri)

  1. Download the sentiment data and extract it to data/processed_acl as described above.

Run the sentiment model (the default setting is Books -> DVD):

sh run-sentiment-mttri.sh

Reference

If you make use of the contents of this repository, we appreciate citing the following paper:

@InProceedings{P18-1096,
  author =	"Ruder, Sebastian
  	 and Plank, Barbara",
  title =    "Strong Baselines for Neural Semi-Supervised Learning under Domain Shift",
  booktitle = 	     "Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
  year =    "2018",
  publisher =	"Association for Computational Linguistics",
  pages =   "1044--1054",
  location =	"Melbourne, Australia",
  url =    "http://aclweb.org/anthology/P18-1096"
}

semi-supervised-baselines's People

Contributors

bplank avatar sebastianruder avatar

Watchers

James Cloos avatar paper2code - bot 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.