File size: 529 Bytes
1b7d446 e250a73 1b7d446 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
import sklearn
import streamlit as st
import pickle
# loading the trained model
model = pickle.load(open('model.pkl', 'rb'))
# create title
st.title('Predicting if message is spam or not')
message = st.text_input('Enter a message')
submit = st.button('Predict')
if submit:
prediction = model.predict([message])
# print(prediction)
# st.write(prediction)
if prediction[0] == 'spam':
st.warning('This message is spam')
else:
st.success('This message is Legit (HAM)')
st.balloons() |