Rifky commited on
Commit
b9ccf67
1 Parent(s): e44280a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -74,7 +74,11 @@ if submit:
74
 
75
  input_column.markdown(f"<small>Compute Finished in {int(time.time() - last_time)} seconds</small>", unsafe_allow_html=True)
76
  prediction = np.argmax(result, axis=-1)
77
- input_column.success(f"This news is {label[prediction]}.")
 
 
 
 
78
  input_column.text(f"{int(result[prediction]*100)}% confidence")
79
  input_column.progress(result[prediction])
80
 
 
74
 
75
  input_column.markdown(f"<small>Compute Finished in {int(time.time() - last_time)} seconds</small>", unsafe_allow_html=True)
76
  prediction = np.argmax(result, axis=-1)
77
+ if prediction == 0:
78
+ input_column.success(f"This news is {label[prediction]}.")
79
+ else:
80
+ input_column.error(f"This news is {label[prediction]}.")
81
+
82
  input_column.text(f"{int(result[prediction]*100)}% confidence")
83
  input_column.progress(result[prediction])
84