Spaces:
Runtime error
Runtime error
anonymousauthors
commited on
Commit
β’
265c345
1
Parent(s):
b00878a
Upload 2 files
Browse files
pages/0_π_Dictionary_(Search).py
CHANGED
@@ -53,7 +53,7 @@ if title in datas:
|
|
53 |
title_mean = dictionary.meaning(title)
|
54 |
_string = '>'
|
55 |
for key in title_mean:
|
56 |
-
_string += f':violet[{key}]: {";".join(title_mean[key])}<br>'
|
57 |
st.markdown(_string, unsafe_allow_html=True)
|
58 |
except:
|
59 |
st.error(f'We cannot find the meaning of {title} in English (PyDictionary), which might be due to the bug.',
|
@@ -180,7 +180,7 @@ if title in datas:
|
|
180 |
if task == 'QA':
|
181 |
_all[_sl]['Replaced hypothesis'].append(_dict['replaced sentences'][i].replace('<s>', ''))
|
182 |
else:
|
183 |
-
_all[_sl]['Replaced hypothesis'].append(_dict['replaced sentences'][i])
|
184 |
_all[_sl]['Premise'].append(_dict['premise / sentence 2 / text'][i])
|
185 |
_all[_sl]['output'].append(_dict['output'][i])
|
186 |
if len(_all.keys()):
|
@@ -206,7 +206,7 @@ if title in datas:
|
|
206 |
_string += 'hypothesis**: :'
|
207 |
elif task == 'QA':
|
208 |
_string += 'question**: :'
|
209 |
-
elif task == '
|
210 |
_string += 'sentence 1**: :'
|
211 |
_string += f'blue[{_all[_sl]["Original hypothesis"][j]}]'.replace(":", "[colon]")
|
212 |
_string += '<br> **Replaced '
|
@@ -214,14 +214,14 @@ if title in datas:
|
|
214 |
_string += 'hypothesis**: :'
|
215 |
elif task == 'QA':
|
216 |
_string += 'question**: :'
|
217 |
-
elif task == '
|
218 |
_string += 'sentence 1**: :'
|
219 |
_string += f'red[{_all[_sl]["Replaced hypothesis"][j]}]'.replace(":", "[colon]")
|
220 |
if task == 'NLI':
|
221 |
_string += '<br> **Premise**: :'
|
222 |
elif task == 'QA':
|
223 |
_string += '<br> **Text**: :'
|
224 |
-
elif task == '
|
225 |
_string += '<br> **Sentence 2**: :'
|
226 |
_string += f'blue[{_all[_sl]["Premise"][j]}]'.replace(":", "[colon]")
|
227 |
_string += "<br>**Model's prediction:** :" + f'blue[{_all[_sl]["output"][j]}]'.replace(":", "[colon]")
|
|
|
53 |
title_mean = dictionary.meaning(title)
|
54 |
_string = '>'
|
55 |
for key in title_mean:
|
56 |
+
_string += f':violet[{key}]: {"; ".join(title_mean[key])}<br>'
|
57 |
st.markdown(_string, unsafe_allow_html=True)
|
58 |
except:
|
59 |
st.error(f'We cannot find the meaning of {title} in English (PyDictionary), which might be due to the bug.',
|
|
|
180 |
if task == 'QA':
|
181 |
_all[_sl]['Replaced hypothesis'].append(_dict['replaced sentences'][i].replace('<s>', ''))
|
182 |
else:
|
183 |
+
_all[_sl]['Replaced hypothesis'].append(_dict['replaced sentences'][i].replace('[CLS]', '', 1))
|
184 |
_all[_sl]['Premise'].append(_dict['premise / sentence 2 / text'][i])
|
185 |
_all[_sl]['output'].append(_dict['output'][i])
|
186 |
if len(_all.keys()):
|
|
|
206 |
_string += 'hypothesis**: :'
|
207 |
elif task == 'QA':
|
208 |
_string += 'question**: :'
|
209 |
+
elif task == 'Paraphrase':
|
210 |
_string += 'sentence 1**: :'
|
211 |
_string += f'blue[{_all[_sl]["Original hypothesis"][j]}]'.replace(":", "[colon]")
|
212 |
_string += '<br> **Replaced '
|
|
|
214 |
_string += 'hypothesis**: :'
|
215 |
elif task == 'QA':
|
216 |
_string += 'question**: :'
|
217 |
+
elif task == 'Paraphrase':
|
218 |
_string += 'sentence 1**: :'
|
219 |
_string += f'red[{_all[_sl]["Replaced hypothesis"][j]}]'.replace(":", "[colon]")
|
220 |
if task == 'NLI':
|
221 |
_string += '<br> **Premise**: :'
|
222 |
elif task == 'QA':
|
223 |
_string += '<br> **Text**: :'
|
224 |
+
elif task == 'Paraphrase':
|
225 |
_string += '<br> **Sentence 2**: :'
|
226 |
_string += f'blue[{_all[_sl]["Premise"][j]}]'.replace(":", "[colon]")
|
227 |
_string += "<br>**Model's prediction:** :" + f'blue[{_all[_sl]["output"][j]}]'.replace(":", "[colon]")
|