anonymous8 commited on
Commit
04b0636
1 Parent(s): d65ddc0
Files changed (2) hide show
  1. app.py +5 -8
  2. requirements.txt +5 -1
app.py CHANGED
@@ -87,12 +87,12 @@ attack_recipes = {
87
  "textfooler": TextFoolerJin2019,
88
  "pso": PSOZang2020,
89
  "iga": IGAWang2019,
90
- "GA": GeneticAlgorithmAlzantot2018,
91
- "wordbugger": DeepWordBugGao2018,
92
  'clare': CLARE2020,
93
  }
94
 
95
- for attacker in ["pwws", "bae", "textfooler", "pso", "wordbugger", 'clare']:
96
  for dataset in [
97
  "agnews10k",
98
  "amazon",
@@ -392,8 +392,7 @@ with demo:
392
  ". RPD significantly (>10% defense accuracy improvement) outperforms the state-of-the-art methods."
393
  )
394
  gr.Markdown(
395
- "- The DeepWordBug, IGA, GA, PSO, and CLARE attackers are very slow on CPU Devices."
396
- " And they are unknown attackers to RPD's adversarial detector. "
397
  )
398
 
399
  gr.Markdown("## <p align='center'>Natural Example Input</p>")
@@ -409,9 +408,7 @@ with demo:
409
  "BAE",
410
  "PWWS",
411
  "TextFooler",
412
- "WordBugger",
413
- "PSO",
414
- "CLARE",
415
  ],
416
  value="TextFooler",
417
  label="Choose an Adversarial Attacker for generating an adversarial example to attack the model.",
 
87
  "textfooler": TextFoolerJin2019,
88
  "pso": PSOZang2020,
89
  "iga": IGAWang2019,
90
+ "ga": GeneticAlgorithmAlzantot2018,
91
+ "deepwordbug": DeepWordBugGao2018,
92
  'clare': CLARE2020,
93
  }
94
 
95
+ for attacker in ["pwws", "bae", "textfooler", "deepwordbug"]:
96
  for dataset in [
97
  "agnews10k",
98
  "amazon",
 
392
  ". RPD significantly (>10% defense accuracy improvement) outperforms the state-of-the-art methods."
393
  )
394
  gr.Markdown(
395
+ "- The DeepWordBug is an unknown attacker to RPD's adversarial detector, which shows the robustness of RPD."
 
396
  )
397
 
398
  gr.Markdown("## <p align='center'>Natural Example Input</p>")
 
408
  "BAE",
409
  "PWWS",
410
  "TextFooler",
411
+ "DeepWordBug"
 
 
412
  ],
413
  value="TextFooler",
414
  label="Choose an Adversarial Attacker for generating an adversarial example to attack the model.",
requirements.txt CHANGED
@@ -16,4 +16,8 @@ transformers>4.20.0
16
  torch>1.0.0
17
  sentencepiece
18
  tensorflow_text
19
- textattack[tensorflow]
 
 
 
 
 
16
  torch>1.0.0
17
  sentencepiece
18
  tensorflow_text
19
+ textattack[dev]
20
+ jieba
21
+ pycld2
22
+ OpenHowNet
23
+ pinyin