anonauthors commited on
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 Language of LMs")
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 subsituitions 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 subsituitions",
90
- description=f'Overall, we found :red[{len(title_secret_languages)}] secret languages of :blue[{title}].',
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 subsituitions 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,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 secret languages.*',
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 Secret Language of {title} on {key}.')
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 Secret Language of {title} on {task}.', icon="⚠️")
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 Secret Language.', icon="⚠️")
 
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="⚠️")