Spaces:
Runtime error
Runtime error
Commit
·
c65d4d6
1
Parent(s):
8996779
Fixing seperators highlitedText bug
Browse files
app.py
CHANGED
|
@@ -302,10 +302,13 @@ if __name__ == "__main__":
|
|
| 302 |
theme=gr.themes.Base(),
|
| 303 |
|
| 304 |
)
|
|
|
|
|
|
|
| 305 |
restored_text_diff = gr.HighlightedText(
|
| 306 |
label="Character Editions of Repaired Adversarial Example Compared to the Natural Example",
|
| 307 |
combine_adjacent=True,
|
| 308 |
show_legend=True,
|
|
|
|
| 309 |
theme=gr.themes.Base(),
|
| 310 |
)
|
| 311 |
|
|
@@ -319,9 +322,9 @@ if __name__ == "__main__":
|
|
| 319 |
label="Adversarial Example Detection Result"
|
| 320 |
)
|
| 321 |
gr.Markdown(
|
| 322 |
-
"The is_adversarial field indicates if an adversarial example is detected. "
|
| 323 |
-
"The perturbed_label is the predicted label of the adversarial example. "
|
| 324 |
-
"The confidence field represents the ratio of Inverted samples among the total number of generated candidates. "
|
| 325 |
)
|
| 326 |
with gr.Column():
|
| 327 |
with gr.Group():
|
|
|
|
| 302 |
theme=gr.themes.Base(),
|
| 303 |
|
| 304 |
)
|
| 305 |
+
|
| 306 |
+
|
| 307 |
restored_text_diff = gr.HighlightedText(
|
| 308 |
label="Character Editions of Repaired Adversarial Example Compared to the Natural Example",
|
| 309 |
combine_adjacent=True,
|
| 310 |
show_legend=True,
|
| 311 |
+
color_map={"+": "red", "-": "green"}),
|
| 312 |
theme=gr.themes.Base(),
|
| 313 |
)
|
| 314 |
|
|
|
|
| 322 |
label="Adversarial Example Detection Result"
|
| 323 |
)
|
| 324 |
gr.Markdown(
|
| 325 |
+
" - The is_adversarial field indicates if an adversarial example is detected. "
|
| 326 |
+
" - The perturbed_label is the predicted label of the adversarial example. "
|
| 327 |
+
" - The confidence field represents the ratio of Inverted samples among the total number of generated candidates. "
|
| 328 |
)
|
| 329 |
with gr.Column():
|
| 330 |
with gr.Group():
|