Skip to content

Commit 3542339

Browse files
committed
add more extended features in doc
1 parent 567079b commit 3542339

2 files changed

Lines changed: 34 additions & 9 deletions

File tree

docs/1start/attacks4Components.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,16 @@ This modular design enables us to easily assemble attacks from the literature wh
1212
![two-categorized-attacks](/_static/imgs/intro/01-categorized-attacks.png)
1313

1414

15-
16-
15+
- You can create one new attack (in one line of code!!!) from composing members of four components we proposed, for instance:
16+
17+
```bash
18+
# Shows how to build an attack from components and use it on a pre-trained model on the Yelp dataset.
19+
textattack attack --attack-n --model bert-base-uncased-yelp --num-examples 8 \
20+
--goal-function untargeted-classification \
21+
--transformation word-swap-wordnet \
22+
--constraints edit-distance^12 max-words-perturbed^max_percent=0.75 repeat stopword \
23+
--search greedy
24+
```
1725

1826
### Goal Functions
1927

docs/1start/multilingual-visualization.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@ TextAttack Extended Functions (Multilingual)
33

44

55

6-
## Multilingual Supports
7-
8-
- 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.
6+
## Textattack Supports Multiple Model Types besides huggingface models and our textattack models:
97

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.
8+
- Example attacking TensorFlow models @ [https://textattack.readthedocs.io/en/latest/2notebook/Example_0_tensorflow.html](https://textattack.readthedocs.io/en/latest/2notebook/Example_0_tensorflow.html)
9+
- Example attacking scikit-learn models @ [https://textattack.readthedocs.io/en/latest/2notebook/Example_1_sklearn.html](https://textattack.readthedocs.io/en/latest/2notebook/Example_1_sklearn.html)
10+
- Example attacking AllenNLP models @ [https://textattack.readthedocs.io/en/latest/2notebook/Example_2_allennlp.html](https://textattack.readthedocs.io/en/latest/2notebook/Example_2_allennlp.html)
11+
- Example attacking Kera models @ [https://textattack.readthedocs.io/en/latest/2notebook/Example_3_Keras.html](https://textattack.readthedocs.io/en/latest/2notebook/Example_3_Keras.html)
1112

1213

14+
## Multilingual Supports
1315

1416

15-
## We have built a new WebDemo For Visulizing TextAttack generated Examples;
17+
- see tutorial notebook for using our framework to attack French-BERT.: [https://textattack.readthedocs.io/en/latest/2notebook/Example_4_CamemBERT.html](https://textattack.readthedocs.io/en/latest/2notebook/Example_4_CamemBERT.html)
1618

17-
- [TextAttack-WebDemo Github](https://github.com/QData/TextAttack-WebDemo)
19+
- see example code for using our framework to attack French-BERT: [https://github.com/QData/TextAttack/blob/master/examples/attack/attack_camembert.py](https://github.com/QData/TextAttack/blob/master/examples/attack/attack_camembert.py) .
1820

1921

2022

@@ -46,6 +48,21 @@ Then, run an attack with the argument `--model-from-file my_model.py`. The model
4648

4749

4850

49-
### Custom attack components
51+
## User defined Custom attack components
5052

5153
The [documentation website](https://textattack.readthedocs.io/en/latest) contains walkthroughs explaining basic usage of TextAttack, including building a custom transformation and a custom constraint..
54+
55+
- custom transformation example @ [https://textattack.readthedocs.io/en/latest/2notebook/1_Introduction_and_Transformations.html](https://textattack.readthedocs.io/en/latest/2notebook/1_Introduction_and_Transformations.html)
56+
57+
- custome constraint example @[https://textattack.readthedocs.io/en/latest/2notebook/2_Constraints.html#A-custom-constraint](https://textattack.readthedocs.io/en/latest/2notebook/2_Constraints.html#A-custom-constraint)
58+
59+
60+
61+
62+
## Visulizing TextAttack generated Examples;
63+
64+
65+
- You can visualize the generated adversarial examples vs. see examples, following visualization ways we provided here: [https://textattack.readthedocs.io/en/latest/2notebook/2_Constraints.html](https://textattack.readthedocs.io/en/latest/2notebook/2_Constraints.html)
66+
67+
- If you have webapp, we have also built a new WebDemo [TextAttack-WebDemo Github](https://github.com/QData/TextAttack-WebDemo) for visualizing generated adversarial examples from textattack..
68+

0 commit comments

Comments
 (0)