amandakonet commited on
Commit
4d0465f
1 Parent(s): b5d1e6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -202,8 +202,11 @@ features = tokenizer(option_claim, option_evidence,
202
  model.eval()
203
  with torch.no_grad():
204
  scores = model(**features).logits
205
- label_mapping = ['contradiction', 'entailment', 'neutral']
206
  labels = [label_mapping[score_max] for score_max in scores.argmax(dim=1)]
 
 
 
207
 
208
  # clean up pred label
209
  pred_label = "not enough info"
@@ -212,7 +215,7 @@ with torch.no_grad():
212
  elif labels[0] == 'contradiction':
213
  pred_label = 'refutes'
214
 
215
- st.write("**The predicted label is**:", pred_label)
216
 
217
  # clean up true label
218
  true_label = list(filtered_df[filtered_df['evidence'] == option_evidence]['label'])[0]
 
202
  model.eval()
203
  with torch.no_grad():
204
  scores = model(**features).logits
205
+ label_mapping = ['refutes', 'supports', 'not enough info']
206
  labels = [label_mapping[score_max] for score_max in scores.argmax(dim=1)]
207
+
208
+ st.write("**Claim:**", option_claim)
209
+ st.write("**Evidence**", option_evidence)
210
 
211
  # clean up pred label
212
  pred_label = "not enough info"
 
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]