This is the code for our long paper:
Defending Pre-trained Language Modelsfrom Adversarial Word Substitution Without Performance Sacrifice
Accepted to Findings of ACL 2021.
Download counter-fitted-vectors.txt and then put it in '/src/TextFooler/'. Download USE and then put it in '/src/TextFooler/'.
Then you can run the run_MR_pipeline.py to see how the pipeline works and gets the defense performance on MR dataset as an example.