RebKip commited on
Commit
9fbe637
·
verified ·
1 Parent(s): 6dc701a

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +6 -3
src/streamlit_app.py CHANGED
@@ -41,8 +41,11 @@ if st.button("Predict"):
41
  # Run inference
42
  prediction = model.predict(processed_text)
43
 
 
 
 
44
  # Display output based on your 0.6 precision threshold
45
- if prediction[0] > 0.20:
46
- st.error(f"🚨 **SPAM** (Confidence score: {prediction[0][0]:.2f})")
47
  else:
48
- st.success(f"✅ **HAM / LEGITIMATE** (Confidence score: {prediction[0][0]:.2f})")
 
41
  # Run inference
42
  prediction = model.predict(processed_text)
43
 
44
+ # Extract the exact decimal scalar score
45
+ predicton_score = float(prediction[0][0])
46
+
47
  # Display output based on your 0.6 precision threshold
48
+ if predicton_score > 0.20:
49
+ st.error(f"🚨 **SPAM** (Confidence score: {predicton_score:.2f})")
50
  else:
51
+ st.success(f"✅ **HAM / LEGITIMATE** (Confidence score: {prediction_score:.2f})")