Spaces:
Build error
Build error
Upload 3 files
Browse files- app.py +17 -0
- best_model.pkl +3 -0
- requirements.txt +3 -0
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pickle
|
| 3 |
+
|
| 4 |
+
# Load the model
|
| 5 |
+
with open('best_model.pkl', 'rb') as f:
|
| 6 |
+
model = pickle.load(f)
|
| 7 |
+
|
| 8 |
+
# Streamlit app
|
| 9 |
+
st.title("SMS Spam Classifier")
|
| 10 |
+
message = st.text_area("Enter your message:")
|
| 11 |
+
|
| 12 |
+
if st.button("Classify"):
|
| 13 |
+
prediction = model.predict([message])
|
| 14 |
+
if prediction == 1:
|
| 15 |
+
st.write("This message is classified as SPAM.⚠️⚠️⚠️")
|
| 16 |
+
else:
|
| 17 |
+
st.write("This message is classified as NOT SPAM.")
|
best_model.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fca28fa548ce5c6f4b6800b5ed864bc7d4d2199ecf0f4d60aff17e6656a62a6d
|
| 3 |
+
size 450931
|
requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
streamlit
|
| 2 |
+
nltk
|
| 3 |
+
sklearn
|