This is the codes of our paper: LexicalAT: Lexical-Based Adversarial Reinforcement Trainingfor Robust Sentiment Classification.
- Ubuntu 16.0.4
- Python 3.6
- Tensorflow 1.12
- NLTK 3.4.3
cd cnn_lstm
CUDA_VISIBLE_DEVIVES=0 bash sst_adv_cnn.sh
Before executing the command below, you need to download the pretrained model and vocabulary of bert. The download url and other detailed information can be found in bert.
cd bert
CUDA_VISIBLE_DEVICES=0 bash rt_adv_bert.sh
- Before running the code, you need to download wordnet via nltk.
- The code is currently non-deterministic due to various GPU ops, so you are likely to end up with a slightly better or worse evaluation.
If you use the above codes for your research, please cite our paper.