Spaces:
Runtime error
Runtime error
amandakonet
commited on
Commit
•
7b630e1
1
Parent(s):
aab8b6c
Update app.py
Browse files
app.py
CHANGED
@@ -64,31 +64,31 @@ ex_evidence = ['Recent Research Shows Human Activity Driving Earth Towards Globa
|
|
64 |
'The estimate of total CO 2 emissions includes biotic carbon emissions, mainly from deforestation.',
|
65 |
'The vast majority of anthropogenic carbon dioxide emissions come from combustion of fossil fuels, principally coal, oil, and natural gas, with additional contributions coming from deforestation, changes in land use, soil erosion and agriculture (including livestock).']
|
66 |
|
67 |
-
ex_labels = ['
|
68 |
-
'
|
69 |
-
'
|
70 |
-
'
|
71 |
-
'
|
72 |
-
'
|
73 |
-
'
|
74 |
-
'
|
75 |
-
'
|
76 |
-
'
|
77 |
-
'
|
78 |
-
'
|
79 |
-
'
|
80 |
-
'
|
81 |
-
'
|
82 |
-
'
|
83 |
-
'
|
84 |
-
'
|
85 |
-
'
|
86 |
-
'
|
87 |
-
'
|
88 |
-
'
|
89 |
-
'
|
90 |
-
'
|
91 |
-
'
|
92 |
|
93 |
ex_df = pd.DataFrame({'claim' : ex_claims, 'evidence' : ex_evidence, 'label': ex_labels})
|
94 |
|
@@ -208,25 +208,10 @@ with torch.no_grad():
|
|
208 |
st.write("**Claim:**", option_claim)
|
209 |
st.write("**Evidence**", option_evidence)
|
210 |
|
211 |
-
# clean up pred label
|
212 |
-
pred_label = "not enough info"
|
213 |
-
if labels[0] == 'entailment':
|
214 |
-
pred_label = 'supports'
|
215 |
-
elif labels[0] == 'contradiction':
|
216 |
-
pred_label = 'refutes'
|
217 |
-
|
218 |
st.write("**The predicted label is**:", labels[0])
|
219 |
|
220 |
# clean up true label
|
221 |
true_label = list(filtered_df[filtered_df['evidence'] == option_evidence]['label'])[0]
|
222 |
-
true_out = true_label
|
223 |
-
if true_label == "NOT_ENOUGH_INFO":
|
224 |
-
true_out = "not enough info"
|
225 |
-
elif true_label == "SUPPORTS":
|
226 |
-
true_out = "supports"
|
227 |
-
else:
|
228 |
-
true_out == "refutes"
|
229 |
-
|
230 |
st.write("**The true label is**", true_out)
|
231 |
|
232 |
st.write("Check out my github repository to try out custom claim and evidence pairs, linked under references.")
|
|
|
64 |
'The estimate of total CO 2 emissions includes biotic carbon emissions, mainly from deforestation.',
|
65 |
'The vast majority of anthropogenic carbon dioxide emissions come from combustion of fossil fuels, principally coal, oil, and natural gas, with additional contributions coming from deforestation, changes in land use, soil erosion and agriculture (including livestock).']
|
66 |
|
67 |
+
ex_labels = ['not enough info',
|
68 |
+
'supports',
|
69 |
+
'not enough info',
|
70 |
+
'supports',
|
71 |
+
'not enough info',
|
72 |
+
'not enough info',
|
73 |
+
'not enough info',
|
74 |
+
'not enough info',
|
75 |
+
'refutes',
|
76 |
+
'refutes',
|
77 |
+
'not enough info',
|
78 |
+
'supports',
|
79 |
+
'not enough info',
|
80 |
+
'supports',
|
81 |
+
'supports',
|
82 |
+
'not enough info',
|
83 |
+
'not enough info',
|
84 |
+
'not enough info',
|
85 |
+
'not enough info',
|
86 |
+
'not enough info',
|
87 |
+
'refutes',
|
88 |
+
'not enough info',
|
89 |
+
'refutes',
|
90 |
+
'not enough info',
|
91 |
+
'not enough info']
|
92 |
|
93 |
ex_df = pd.DataFrame({'claim' : ex_claims, 'evidence' : ex_evidence, 'label': ex_labels})
|
94 |
|
|
|
208 |
st.write("**Claim:**", option_claim)
|
209 |
st.write("**Evidence**", option_evidence)
|
210 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
st.write("**The predicted label is**:", labels[0])
|
212 |
|
213 |
# clean up true label
|
214 |
true_label = list(filtered_df[filtered_df['evidence'] == option_evidence]['label'])[0]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
st.write("**The true label is**", true_out)
|
216 |
|
217 |
st.write("Check out my github repository to try out custom claim and evidence pairs, linked under references.")
|