Chadsglm commited on
Commit
6e44b92
·
verified ·
1 Parent(s): 9642be7

Upload 3 files

Browse files
Files changed (3) hide show
  1. app.py +5 -6
  2. requirements.txt +1 -2
  3. sms_spam_model.joblib +3 -0
app.py CHANGED
@@ -1,9 +1,8 @@
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")
@@ -11,7 +10,7 @@ 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.")
 
1
  import streamlit as st
2
+ import joblib
3
 
4
  # Load the model
5
+ model = joblib.load('sms_spam_model.joblib')
 
6
 
7
  # Streamlit app
8
  st.title("SMS Spam Classifier")
 
10
 
11
  if st.button("Classify"):
12
  prediction = model.predict([message])
13
+ if prediction[0] == 1:
14
+ st.error("This message is classified as SPAM.")
15
  else:
16
+ st.success("This message is classified as NOT SPAM.")
requirements.txt CHANGED
@@ -1,4 +1,3 @@
1
  streamlit
2
  nltk
3
- sklearn
4
- pickle
 
1
  streamlit
2
  nltk
3
+ sklearn
 
sms_spam_model.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:513d9048802fef7acb694e345c9ca45272331d91602850a00ef561f51d52b3da
3
+ size 451150