Home

Awesome

Crafting Adversarial Examples for Neural Machine Translation

We provide code for the ACL2021 Paper: Crafting Adversarial Examples for Neural Machine Translation
Xinze Zhang, Junzhe Zhang, Zhenhua Chen, Kun He

Environment

Pre-installation

Due to the space limitation of the github, some auxiliary files, especially the pre-trained model files and the processed word vector files, are too big to be uploaded in the current repository.

And the pre-trained BERT models, i.e., the uncased whole word masked models, used in this work, had the effective web-link when this work was just published. But these links are not available directly for now (2022 Apr.) becasue of some unknown reasons. To tackle this issue, you need search the model name in https://huggingface.co/models .

Hence, for the replication, we provide these necessary files in the Google Drive. You need download these files as follows and copy them to the corresponding path (cor_path) to finish the pre-installation procedure.

File_nameCor_pathLinkRemark
en_core_web_sm-2.2.0.tar.gz./aux_files/en_core_web_sm-2.2.0.tar.gzClick hereProvided by Spacy.
googleNewsWV.bin./aux_files/googleNewsWV.binClick herePre-trained by Google.
googleNewsWV.bin.vectors.npy.tar.gz./aux_files/googleNewsWV.bin.vectors.npyClick herePre-trained by Google. It's a file, unzip first.
en-de-en.tar.gz./models/Transformer/en-de-enClick herePre-trained by FAIR. It's a folder, unzip first.
jobs.tar.gz./corpus/wmt19/jobsClick hereIt's a folder, unzip first.
test.en./corpus/wmt19/test.enClick hereProvided by WMT19.
test.de./corpus/wmt19/test.deClick hereProvided by WMT19.

Due to the space limitation of Google Drive and the huge size of the NMT models as well as word-vector models, we only upload the model files related to en-de experiment. For the model files about other experiments, please contact the code contributor of this repository.

Installation

Usage

Contact

For replication, if you have any questions of the code details, please contact xinze (xinze@hust.edu.cn), the first author of this paper.

--2022-04-10--