The Implementation for
Li, Yitong, Timothy Baldwin and Trevor Cohn (2018) What's in a Domain? Learning Domain-Robust Text Representations Using Adversarial Training , In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics – Human Language Technologies (NAACL HLT 2018), New Orleans, USA.
- Multi-Domain Sentiment Dataset (Blitzer et al., 2007);
- Language identification data (Lui and Baldwin (2011)).
- python 2.7
- Tensorflow 1.1+
- numpy
- scipy
- Baseline: ood_BDEK_adv_baseline.py
- Cond: ood_BDEK_adv_cond.py
- Gen: ood_BDEK_adv_gen.py
as described in the paper.
python ood_BDEK_adv_*.py [parameters]
--num_train_epochs: normal training epochs w\o adversarial supervision;
--num_tune_epochs: adversarial learning epochs;
--adv_lambda: hyper-parameter lambda for adversarial loss.
Baseline w\o adversarial:
python ood_BDEK_adv_baseline.py --num_train_epochs 50
Baseline w adversarial loss:
python ood_BDEK_adv_baseline.py --num_tune_epochs 50 --adv_lambda 1e-3
Gen model with pre-train:
python ood_BDEK_adv_gen.py --num_train_epochs 50 --num_tune_epochs 50