Giter Club home page Giter Club logo

man's Introduction

Multinomial Adversarial Nets

This repo contains the source code for our paper:

Multinomial Adversarial Networks for Multi-Domain Text Classification
Xilun Chen, Claire Cardie
NAACL-HLT 2018
paper, bibtex

Requirements:

  • Python 3.6
  • PyTorch 0.4
  • PyTorchNet
  • scipy
  • tqdm (for progress bar)

An Anaconda environment.yml file is also provided.

Dev version

The dev branch contains a full version of our code, including some options we experimented but did not include in the final version.

Follow-up Paper

You might also be interested in our follow-up ACL 2019 paper (source code available here) with an improved model and better performance.

Before Running

The pre-trained word embeddings file exceeds the 100MB limit of github, and is thus provided as a gzipped tar ball. Please run the following command to extract it first:

tar -xvf data/w2v/word2vec.tar.gz -C data/w2v/

Experiment 1: MDTC on the multi-domain Amazon dataset

cd code/
python train_man_exp1.py --dataset prep-amazon --model mlp

Experiment 2: Multi-Source Domain Adaptation

cd code/
# target domain: books
python train_man_exp2.py --dataset prep-amazon --model mlp --no_wgan_trick --domains dvd electronics kitchen --unlabeled_domains books --dev_domains books
# target domain: dvd
python train_man_exp2.py --dataset prep-amazon --model mlp --no_wgan_trick --domains books electronics kitchen --unlabeled_domains dvd --dev_domains dvd
# target domain: electronics
python train_man_exp2.py --dataset prep-amazon --model mlp --no_wgan_trick --domains books dvd kitchen --unlabeled_domains electronics --dev_domains electronics
# target domain: kitchen
python train_man_exp2.py --dataset prep-amazon --model mlp --no_wgan_trick --domains dvd electronics kitchen --unlabeled_domains kitchen --dev_domains kitchen

Experiment 3: MDTC on the FDU-MTL dataset

cd code/
python train_man_exp3.py --dataset fdu-mtl --model cnn --max_epoch 50

A larger batch size can also be used to reduce the training time.

man's People

Contributors

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