PFEemp2024 commited on
Commit
86735c0
1 Parent(s): 9ef5340

Fixing typeError highlitedText bug

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -69,7 +69,7 @@ cache = set()
69
 
70
 
71
  def generate_adversarial_example(dataset, attacker, text=None, label=None):
72
- if not text or text in cache:
73
  if "agnews" in dataset.lower():
74
  text, label = get_agnews_example()
75
  elif "sst2" in dataset.lower():
@@ -317,17 +317,17 @@ if __name__ == "__main__":
317
  gr.Markdown(
318
  "The is_adversarial field indicates if an adversarial example is detected. "
319
  "The perturbed_label is the predicted label of the adversarial example. "
320
- "The confidence field represents the confidence of the predicted adversarial example detection. "
321
  )
322
  with gr.Column():
323
  with gr.Group():
324
  output_df = gr.DataFrame(
325
- label="Repaired Standard Classification Result"
326
  )
327
  gr.Markdown(
328
- "If is_repaired=true, it has been repaired by Rapid. "
329
  "The pred_label field indicates the standard classification result. "
330
- "The confidence field represents the confidence of the predicted label. "
331
  "The is_correct field indicates whether the predicted label is correct."
332
  )
333
 
 
69
 
70
 
71
  def generate_adversarial_example(dataset, attacker, text=None, label=None):
72
+ if not text :
73
  if "agnews" in dataset.lower():
74
  text, label = get_agnews_example()
75
  elif "sst2" in dataset.lower():
 
317
  gr.Markdown(
318
  "The is_adversarial field indicates if an adversarial example is detected. "
319
  "The perturbed_label is the predicted label of the adversarial example. "
320
+ "The confidence field represents the ratio of Inverted samples among the total number of generated candidates. "
321
  )
322
  with gr.Column():
323
  with gr.Group():
324
  output_df = gr.DataFrame(
325
+ label="Correction Classification Result"
326
  )
327
  gr.Markdown(
328
+ "If is_corrected=true, it has been Corrected by DCWIR. "
329
  "The pred_label field indicates the standard classification result. "
330
+ "The confidence field represents ratio of the dominant class among all Inverted candidates."
331
  "The is_correct field indicates whether the predicted label is correct."
332
  )
333