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
Many of the components of TextAttack are useful for data augmentation. The `textattack.Augmenter` class
299
-
uses a transformation and a list of constraints to augment data. We also offer five built-in recipes
299
+
uses a transformation and a list of constraints to augment data. We also offer built-in recipes
300
300
for data augmentation:
301
-
-`textattack.WordNetAugmenter` augments text by replacing words with WordNet synonyms
302
-
-`textattack.EmbeddingAugmenter` augments text by replacing words with neighbors in the counter-fitted embedding space, with a constraint to ensure their cosine similarity is at least 0.8
303
-
-`textattack.CharSwapAugmenter` augments text by substituting, deleting, inserting, and swapping adjacent characters
304
-
-`textattack.EasyDataAugmenter` augments text with a combination of word insertions, substitutions and deletions.
305
-
-`textattack.CheckListAugmenter` augments text by contraction/extension and by substituting names, locations, numbers.
306
-
-`textattack.CLAREAugmenter` augments text by replacing, inserting, and merging with a pre-trained masked language model.
301
+
-`wordnet` augments text by replacing words with WordNet synonyms
302
+
-`embedding` augments text by replacing words with neighbors in the counter-fitted embedding space, with a constraint to ensure their cosine similarity is at least 0.8
303
+
-`charswap` augments text by substituting, deleting, inserting, and swapping adjacent characters
304
+
-`eda` augments text with a combination of word insertions, substitutions and deletions.
305
+
-`checklist` augments text by contraction/extension and by substituting names, locations, numbers.
306
+
-`clare` augments text by replacing, inserting, and merging with a pre-trained masked language model.
307
+
307
308
308
309
#### Augmentation Command-Line Interface
309
310
The easiest way to use our data augmentation tools is with `textattack augment <args>`. `textattack augment`
@@ -380,24 +381,23 @@ automatically loaded using the `datasets` package.
380
381
#### Training Examples
381
382
*Train our default LSTM for 50 epochs on the Yelp Polarity dataset:*
To take a closer look at a dataset, use `textattack peek-dataset`. TextAttack will print some cursory statistics about the inputs and outputs from the dataset. For example, `textattack peek-dataset --dataset-from-huggingface snli` will show information about the SNLI dataset from the NLP package.
396
+
To take a closer look at a dataset, use `textattack peek-dataset`. TextAttack will print some cursory statistics about the inputs and outputs from the dataset. For example,
will show information about the SNLI dataset from the NLP package.
401
401
402
402
403
403
### To list functional components: `textattack list`
@@ -547,6 +547,11 @@ A `SearchMethod` takes as input an initial `GoalFunctionResult` and returns a fi
547
547
548
548
## Multi-lingual Support
549
549
550
+
551
+
- see example code: [https://github.com/QData/TextAttack/blob/master/examples/attack/attack_camembert.py](https://github.com/QData/TextAttack/blob/master/examples/attack/attack_camembert.py) for using our framework to attack French-BERT.
552
+
553
+
- see tutorial notebook: [https://textattack.readthedocs.io/en/latest/2notebook/Example_4_CamemBERT.html](https://textattack.readthedocs.io/en/latest/2notebook/Example_4_CamemBERT.html) for using our framework to attack French-BERT.
554
+
550
555
- See [README_ZH.md](https://github.com/QData/TextAttack/blob/master/README_ZH.md) for our README in Chinese
Copy file name to clipboardExpand all lines: docs/1start/api-design-tips.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,24 @@ Lessons learned in designing TextAttack
7
7
8
8
TextAttack is an open-source Python toolkit for adversarial attacks, adversarial training, and data augmentation in NLP. TextAttack unites 15+ papers from the NLP adversarial attack literature into a single shared framework, with many components reused across attacks. This framework allows both researchers and developers to test and study the weaknesses of their NLP models.
9
9
10
+
11
+
## Presentations on TextAttack
12
+
13
+
### 2020: Jack Morris' summary tutorial talk on TextAttack
14
+
15
+
- On Jul 31, 2020, Jack Morries gave an invited talk at Weights & Biases research salon on " TextAttack: A Framework for Adversarial Attacks, Data Augmentation, and Adversarial Training in NLP"
### 2021: Dr. Qi's summary tutorial talk on TextAttack
21
+
22
+
- On April 14 2021, Prof. Qi gave an invited talk at the UVA Human and Machine Intelligence Seminar on "Generalizing Adversarial Examples to Natural Language Processing"
- see example code: [https://github.com/QData/TextAttack/blob/master/examples/attack/attack_camembert.py](https://github.com/QData/TextAttack/blob/master/examples/attack/attack_camembert.py) for using our framework to attack French-BERT.
9
+
10
+
- see tutorial notebook: [https://textattack.readthedocs.io/en/latest/2notebook/Example_4_CamemBERT.html](https://textattack.readthedocs.io/en/latest/2notebook/Example_4_CamemBERT.html) for using our framework to attack French-BERT.
11
+
12
+
13
+
14
+
## We have built a new WebDemo For Visulizing TextAttack generated Examples;
0 commit comments