You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[EMNLP 2020] "T3: Tree-Autoencoder Constrained Adversarial Text Generation for Targeted Attack" by Boxin Wang, Hengzhi Pei, Boyuan Pan, Qian Chen, Shuohang Wang, Bo Li
This repo contains the code to attack both classification models (self-attentive models and BERT) and question answering models (BiDAF and BERT). We put our attack code in each folders.
You may use our code to attack other NLP tasks.
Note
Before using our T3(Sent), a tree-based autoencoder needs to be trained in a large corpus.
Train Tree-based Autoencoder
We trained our tree-based autoencoder on the Yelp review training dataset.
Related code can be found SAM-attack/my_generator/. Before training, each
sentence in the training set should be parsed by Stanford CoreNLP Parser to get its dependency structures.
We also provide our pre-trained tree auto-encoder checkpoint here.
Contributions
We welcome all kinds of contribution by opening a pull request. If you have questions, please open an issue for discussion.
About
[EMNLP 2020] "T3: Tree-Autoencoder Constrained Adversarial Text Generation for Targeted Attack" by Boxin Wang, Hengzhi Pei, Boyuan Pan, Qian Chen, Shuohang Wang, Bo Li