Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +2 -2
src/streamlit_app.py
CHANGED
|
@@ -14,11 +14,11 @@ def predict(text):
|
|
| 14 |
pred = torch.argmax(probs , dim = 1).item()
|
| 15 |
return "Spam" if pred == 1 else "Not Spam"
|
| 16 |
st.title("Spam Detector - BERT")
|
| 17 |
-
st.write("Paste an email message to check if it
|
| 18 |
user_input = st.text_area("Email Content", height = 200)
|
| 19 |
if st.button("Classify"):
|
| 20 |
if not user_input.strip():
|
| 21 |
st.warning("Please enter some text")
|
| 22 |
else:
|
| 23 |
-
result
|
| 24 |
st.sucess(f"Prediction: {result}")
|
|
|
|
| 14 |
pred = torch.argmax(probs , dim = 1).item()
|
| 15 |
return "Spam" if pred == 1 else "Not Spam"
|
| 16 |
st.title("Spam Detector - BERT")
|
| 17 |
+
st.write("Paste an email message to check if it's spam")
|
| 18 |
user_input = st.text_area("Email Content", height = 200)
|
| 19 |
if st.button("Classify"):
|
| 20 |
if not user_input.strip():
|
| 21 |
st.warning("Please enter some text")
|
| 22 |
else:
|
| 23 |
+
result = predict(user_input)
|
| 24 |
st.sucess(f"Prediction: {result}")
|