An adversarial attack method against text classifiers which uses FastText Embeddings for transformations.
To run: Using Google Colab with GPU runtime is recommended. It will help you save time by not installing a ton of dependencies!
-
Make a copy of the FastAttack-models folder from https://drive.google.com/drive/folders/1izR5sO08up0LJ3-g7qtO30iHfNnaxFAU?usp=sharing to your drive.
-
Open FastAttack.ipynb on Colab.
-
Load fasttext.model by changing the path appropriately.
-
The target models and datasets can be changed at the locations pointed in the notebook. List of available models and datasets is available here: https://textattack.readthedocs.io/en/latest/3recipes/models.html#available-models
-
Run the attack for a certain number of examples. The attack results and a summary will be printed on the console.