amandakonet commited on
Commit
85200e9
1 Parent(s): f9902a8

model output

Browse files
Files changed (1) hide show
  1. app.py +23 -4
app.py CHANGED
@@ -202,11 +202,30 @@ with torch.no_grad():
202
  scores = model(**features).logits
203
  label_mapping = ['contradiction', 'entailment', 'neutral']
204
  labels = [label_mapping[score_max] for score_max in scores.argmax(dim=1)]
205
- st.write("**The claim:", option_claim)
206
- st.write("is ", labels[0])
207
- st.write("The claim: ", option_claim, "is ", labels, " by ", option_evidence)
 
 
 
 
 
 
 
 
 
 
 
 
208
  true_label = list(filtered_df[filtered_df['evidence'] == option_evidence]['label'])[0]
209
- st.write("The correct relationship is", true_label)
 
 
 
 
 
 
 
210
 
211
  # section 6: analysis
212
  st.markdown("## Critical Analysis")
 
202
  scores = model(**features).logits
203
  label_mapping = ['contradiction', 'entailment', 'neutral']
204
  labels = [label_mapping[score_max] for score_max in scores.argmax(dim=1)]
205
+
206
+ st.write("**The claim**:", option_claim)
207
+
208
+ # clean up pred label
209
+ pred_label = "not enough info"
210
+ if labels[0] == 'entailment':
211
+ pred_label = 'supports'
212
+ elif labels[0] == 'contradiction':
213
+ pred_label = 'refutes'
214
+
215
+ # write out
216
+ st.write("**is**", labels[0])
217
+ st.write("**with**", option_evidence)
218
+
219
+ # clean up true label
220
  true_label = list(filtered_df[filtered_df['evidence'] == option_evidence]['label'])[0]
221
+ if true_label == "NOT_ENOUGH_INFO":
222
+ true_label = "not enough info"
223
+ elif true_label == "SUPPORTS":
224
+ true_label = "supports"
225
+ else:
226
+ true_label == "refutes"
227
+
228
+ st.write("**The correct relationship is**", true_label)
229
 
230
  # section 6: analysis
231
  st.markdown("## Critical Analysis")