Spaces:
Runtime error
Runtime error
Commit
Β·
6609588
1
Parent(s):
258102c
Update pages/0_π_Dictionary_(Search).py
Browse files
pages/0_π_Dictionary_(Search).py
CHANGED
@@ -18,7 +18,7 @@ hide_expander_border = """
|
|
18 |
</style>
|
19 |
"""
|
20 |
|
21 |
-
# st.title("Obstinate Adversarial Examples
|
22 |
|
23 |
# sidebar
|
24 |
st.sidebar.header("π Dictionary")
|
@@ -82,12 +82,12 @@ if title in datas:
|
|
82 |
# st.markdown(data_title.keys())
|
83 |
title_secret_languages = list(sorted(list(set(data_title["secret languages"]))))
|
84 |
# dataframe = pd.DataFrame(datas[title])
|
85 |
-
# st.markdown(f'### We found {len(set(dataframe.loc[:, "secret languages"]))} obstinate
|
86 |
# st.markdown(f'Overall, we found :red[{len(title_secret_languages)}] secret languages of :blue[{title}].',
|
87 |
# unsafe_allow_html=True)
|
88 |
colored_header(
|
89 |
-
label=f"{title}'s obstinate
|
90 |
-
description=f'Overall, we found :red[{len(title_secret_languages)}]
|
91 |
color_name="red-70",
|
92 |
)
|
93 |
special = '"'
|
@@ -114,7 +114,7 @@ if title in datas:
|
|
114 |
if all_sl[i] != '':
|
115 |
new_all_sl.append(all_sl[i].replace("\n", "/n").strip())
|
116 |
all_sl = sorted(new_all_sl)
|
117 |
-
with st.expander(f'***{len(all_sl)}*** obstinate
|
118 |
# st.markdown(
|
119 |
# f':red[{len(all_sl)}] secret languages of :blue[{title}] on {task.replace("paraphrase", "Paraphrase")}',
|
120 |
# unsafe_allow_html=True)
|
@@ -138,7 +138,7 @@ if title in datas:
|
|
138 |
st.caption('\**Due to the grammatical properties of HTML, the layout of this page may vary.*')
|
139 |
colored_header(
|
140 |
label=f"Examples of replaced sentences",
|
141 |
-
description=f'**The number following the tasks represents the number of examples found for a particular task, which may be different from the number of
|
142 |
color_name="orange-70",
|
143 |
)
|
144 |
_num = Counter(data_title['tasks'])
|
@@ -183,7 +183,7 @@ if title in datas:
|
|
183 |
# st.dataframe(new_dataframe)
|
184 |
st.markdown(hide_expander_border, unsafe_allow_html=True)
|
185 |
else:
|
186 |
-
st.error(f'We did not find any
|
187 |
|
188 |
|
189 |
def present_dict(_dict, task):
|
@@ -257,7 +257,7 @@ if title in datas:
|
|
257 |
# st.dataframe(new_dataframe)
|
258 |
st.markdown(hide_expander_border, unsafe_allow_html=True)
|
259 |
else:
|
260 |
-
st.error(f'We did not find any
|
261 |
|
262 |
|
263 |
with tab1:
|
@@ -275,4 +275,4 @@ if title in datas:
|
|
275 |
# f'<span id="jump">ΒΉ</span>*Enlish meaning is supported by [PyDictionary](https://pypi.org/project/PyDictionary/).*',
|
276 |
# unsafe_allow_html=True)
|
277 |
else:
|
278 |
-
st.error(f'{title} is not in the dictionary of
|
|
|
18 |
</style>
|
19 |
"""
|
20 |
|
21 |
+
# st.title("Obstinate Adversarial Examples of LMs")
|
22 |
|
23 |
# sidebar
|
24 |
st.sidebar.header("π Dictionary")
|
|
|
82 |
# st.markdown(data_title.keys())
|
83 |
title_secret_languages = list(sorted(list(set(data_title["secret languages"]))))
|
84 |
# dataframe = pd.DataFrame(datas[title])
|
85 |
+
# st.markdown(f'### We found {len(set(dataframe.loc[:, "secret languages"]))} obstinate substitutions of {title}.', unsafe_allow_html=True)
|
86 |
# st.markdown(f'Overall, we found :red[{len(title_secret_languages)}] secret languages of :blue[{title}].',
|
87 |
# unsafe_allow_html=True)
|
88 |
colored_header(
|
89 |
+
label=f"{title}'s obstinate substitutions",
|
90 |
+
description=f'Overall, we found :red[{len(title_secret_languages)}] obstinate adversarial substitutions of :blue[{title}].',
|
91 |
color_name="red-70",
|
92 |
)
|
93 |
special = '"'
|
|
|
114 |
if all_sl[i] != '':
|
115 |
new_all_sl.append(all_sl[i].replace("\n", "/n").strip())
|
116 |
all_sl = sorted(new_all_sl)
|
117 |
+
with st.expander(f'***{len(all_sl)}*** obstinate substitutions of ***{title}*** on {task.replace("paraphrase", "Paraphrase")}'):
|
118 |
# st.markdown(
|
119 |
# f':red[{len(all_sl)}] secret languages of :blue[{title}] on {task.replace("paraphrase", "Paraphrase")}',
|
120 |
# unsafe_allow_html=True)
|
|
|
138 |
st.caption('\**Due to the grammatical properties of HTML, the layout of this page may vary.*')
|
139 |
colored_header(
|
140 |
label=f"Examples of replaced sentences",
|
141 |
+
description=f'**The number following the tasks represents the number of examples found for a particular task, which may be different from the number of obstinate adversarial substitutions.*',
|
142 |
color_name="orange-70",
|
143 |
)
|
144 |
_num = Counter(data_title['tasks'])
|
|
|
183 |
# st.dataframe(new_dataframe)
|
184 |
st.markdown(hide_expander_border, unsafe_allow_html=True)
|
185 |
else:
|
186 |
+
st.error(f'We did not find any obstinate substituition of {title} on {key}.')
|
187 |
|
188 |
|
189 |
def present_dict(_dict, task):
|
|
|
257 |
# st.dataframe(new_dataframe)
|
258 |
st.markdown(hide_expander_border, unsafe_allow_html=True)
|
259 |
else:
|
260 |
+
st.error(f'We did not find any obstinate substituition of {title} on {task}.', icon="β οΈ")
|
261 |
|
262 |
|
263 |
with tab1:
|
|
|
275 |
# f'<span id="jump">ΒΉ</span>*Enlish meaning is supported by [PyDictionary](https://pypi.org/project/PyDictionary/).*',
|
276 |
# unsafe_allow_html=True)
|
277 |
else:
|
278 |
+
st.error(f'{title} is not in the dictionary of obstinate substituitions.', icon="β οΈ")
|