GithubHelp home page GithubHelp logo

codeaudit / emnlp2018-causal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zachwooddoughty/emnlp2018-causal

0.0 2.0 0.0 15 KB

Code for "Challenges of Using Text Classifiers for Causal Inference," at EMNLP '18

Python 100.00%

emnlp2018-causal's Introduction

This is the code for the experiments in the EMNLP '18 paper, Challenges of Using Text Classifiers for Causal Inference.

To get the raw data, either:

To get started with the code, create a python3 virtualenv and run pip install -r requirements.txt.

To preprocess the data, run python build_yelp_dataset.py n_vocab min_freq --workdir raw_data_directory/

  • n_vocab is the number of reviews to load in creating the word vocabulary.
  • min_freq is the minimum frequency a word can occur in those n_vocab reviews to be included.
  • the flag --n_total controls how many actual reviews to preprocess, and by default equals n_vocab.
  • n_vocab and min_freq are the two params that specify a dataset in all Yelp experiments.

To run a Yelp missing data experiment, run:

python missing_data.py logn_examples --dataset yelp --n_vocab n_vocab --min_freq min_freq --workdir raw_data_directory/

To run a synthetic missing data experiment, run:

python missing_data.py logn_examples --dataset synthetic --vocab_size vocab_size

To run a Yelp measurement error experiment, run:

python measurement_error.py logn_examples --dataset yelp --n_vocab n_vocab --min_freq min_freq --workdir raw_data_directory/

To run a synthetic measurement error experiment, run:

python measurement_error.py logn_examples --dataset synthetic --vocab_size vocab_size

If you use this code, please cite:

@inproceedings{wooddoughty2018challenges,
  title={Challenges of Using Text Classifiers for Causal Inference},
  author={Wood-Doughty, Zach, Ilya Shpitser, and Mark Dredze},
  booktitle={Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing},
  year={2018}
}

emnlp2018-causal's People

Contributors

zachwooddoughty avatar

Watchers

 avatar  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.