xuandin commited on
Commit
f345548
·
verified ·
1 Parent(s): c5f2ae5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -10
app.py CHANGED
@@ -104,7 +104,7 @@ st.markdown(
104
  }
105
  .stSidebar .stSlider {
106
  margin-bottom: 20px;
107
- }
108
  .stSidebar .stSelectbox {
109
  margin-bottom: 20px;
110
  }
@@ -219,19 +219,13 @@ with st.container():
219
  claim, evidence, model_tc, tokenizer_tc,
220
  "cuda" if torch.cuda.is_available() else "cpu"
221
  )
222
- if pred_tc == 1:
223
- verdict = "SUPPORTED"
224
- elif pred_tc == 2:
225
- verdict = "REFUTED"
226
- else:
227
  prob2class, pred_bc = classify_claim(
228
  claim, evidence, model_bc, tokenizer_bc,
229
  "cuda" if torch.cuda.is_available() else "cpu"
230
  )
231
- if pred_bc == 0:
232
- verdict = "SUPPORTED"
233
- else:
234
- verdict = "REFUTED"
235
  if show_details:
236
  details = f"""
237
  <p><strong>3-Class Probability:</strong> {prob3class.item():.2f}</p>
 
104
  }
105
  .stSidebar .stSlider {
106
  margin-bottom: 20px;
107
+ }
108
  .stSidebar .stSelectbox {
109
  margin-bottom: 20px;
110
  }
 
219
  claim, evidence, model_tc, tokenizer_tc,
220
  "cuda" if torch.cuda.is_available() else "cpu"
221
  )
222
+ if pred_tc != 0:
 
 
 
 
223
  prob2class, pred_bc = classify_claim(
224
  claim, evidence, model_bc, tokenizer_bc,
225
  "cuda" if torch.cuda.is_available() else "cpu"
226
  )
227
+ verdict = "SUPPORTED" if pred_bc == 0 else "REFUTED" if prob2class > prob3class else ["NEI", "SUPPORTED", "REFUTED"][pred_tc]
228
+
 
 
229
  if show_details:
230
  details = f"""
231
  <p><strong>3-Class Probability:</strong> {prob3class.item():.2f}</p>