PFEemp2024 commited on
Commit
8f915ec
·
1 Parent(s): 7a2beef

highlighting deleted/added words

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -291,15 +291,18 @@ if __name__ == "__main__":
291
  """)
292
  ori_text_diff = gr.HighlightedText(
293
  label="The Original Natural Example",
294
- combine_adjacent=False,
 
295
  )
296
  adv_text_diff = gr.HighlightedText(
297
  label="Character Editions of Adversarial Example Compared to the Natural Example",
298
- combine_adjacent=False,
 
299
  )
300
  restored_text_diff = gr.HighlightedText(
301
  label="Character Editions of Repaired Adversarial Example Compared to the Natural Example",
302
- combine_adjacent=False,
 
303
  )
304
 
305
  gr.Markdown(
 
291
  """)
292
  ori_text_diff = gr.HighlightedText(
293
  label="The Original Natural Example",
294
+ combine_adjacent=True,
295
+ highlight_words=True,
296
  )
297
  adv_text_diff = gr.HighlightedText(
298
  label="Character Editions of Adversarial Example Compared to the Natural Example",
299
+ combine_adjacent=True,
300
+ highlight_words=True,
301
  )
302
  restored_text_diff = gr.HighlightedText(
303
  label="Character Editions of Repaired Adversarial Example Compared to the Natural Example",
304
+ combine_adjacent=True,
305
+ highlight_words=True,
306
  )
307
 
308
  gr.Markdown(