Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- 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
|
| 46 |
-
st.error(f"🚨 **SPAM** (Confidence score: {
|
| 47 |
else:
|
| 48 |
-
st.success(f"✅ **HAM / LEGITIMATE** (Confidence score: {
|
|
|
|
| 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})")
|