All Projects → ccsasuke → adan

ccsasuke / adan

Licence: MIT license
Language-Adversarial Training for Cross-Lingual Text Classification (TACL)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to adan

FeatureScatter
Feature Scattering Adversarial Training
Stars: ✭ 64 (+6.67%)
Mutual labels:  adversarial-training
AdMRL
Code for paper "Model-based Adversarial Meta-Reinforcement Learning" (https://arxiv.org/abs/2006.08875)
Stars: ✭ 30 (-50%)
Mutual labels:  adversarial-training
AWP
Codes for NeurIPS 2020 paper "Adversarial Weight Perturbation Helps Robust Generalization"
Stars: ✭ 114 (+90%)
Mutual labels:  adversarial-training
Adversarial-Patch-Training
Code for the paper: Adversarial Training Against Location-Optimized Adversarial Patches. ECCV-W 2020.
Stars: ✭ 30 (-50%)
Mutual labels:  adversarial-training
KitanaQA
KitanaQA: Adversarial training and data augmentation for neural question-answering models
Stars: ✭ 58 (-3.33%)
Mutual labels:  adversarial-training
domain-shift-robustness
Code for the paper "Addressing Model Vulnerability to Distributional Shifts over Image Transformation Sets", ICCV 2019
Stars: ✭ 22 (-63.33%)
Mutual labels:  adversarial-training
Adversarial-Distributional-Training
Adversarial Distributional Training (NeurIPS 2020)
Stars: ✭ 52 (-13.33%)
Mutual labels:  adversarial-training
consistency-adversarial
Consistency Regularization for Adversarial Robustness (AAAI 2022)
Stars: ✭ 37 (-38.33%)
Mutual labels:  adversarial-training
Robust-Semantic-Segmentation
Dynamic Divide-and-Conquer Adversarial Training for Robust Semantic Segmentation (ICCV2021)
Stars: ✭ 25 (-58.33%)
Mutual labels:  adversarial-training

Language-Adversarial Training for Cross-Lingual Text Classification

This repo contains the source code for our TACL journal paper:

Adversarial Deep Averaging Networks for Cross-Lingual Sentiment Classification
Xilun Chen, Yu Sun, Ben Athiwaratkun, Claire Cardie, Kilian Weinberger
Transactions of the Association for Computational Linguistics (TACL)
paper (arXiv), bibtex (arXiv), paper (TACL), bibtex, talk@EMNLP2018

Introduction

ADAN transfers the knowledge learned from labeled data on a resource-rich source language to low-resource languages where only unlabeled data exists. It achieves cross-lingual model transfer via learning language-invariant features extracted by Language-Adversarial Training.

Requirements

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

File Structure

.
├── README.md
└── code
    ├── data_prep                       (data processing scripts)
    │   ├── chn_hotel_dataset.py        (processing the Chinese Hotel Review dataset)
    │   └── yelp_dataset.py             (processing the English Yelp Review dataset)
    ├── layers.py                       (lower-level helper modules)
    ├── models.py                       (higher-level modules)
    ├── options.py                      (hyper-parameters aka. all the knobs you may want to turn)
    ├── train.py                        (main file to train the model)
    ├── utils.py                        (helper functions)
    └── vocab.py                        (vocabulary)

Dataset

The datasets can be downloaded separately here.

To support new datasets, simply write a new script under data_prep similar to the current ones and update train.py to correctly load it.

Run Experiments

python train.py --model_save_file {path_to_save_the_model}

By default, the code uses CNN as the feature extractor. To use the LSTM (with dot attention) feature extractor:

python train.py --model lstm --F_layers 2 --model_save_file {path_to_save_the_model}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].