|
|
import streamlit as st
|
|
|
import joblib
|
|
|
|
|
|
|
|
|
st.title("📩 SMS Spam Sınıflandırıcı")
|
|
|
st.write("Bir SMS mesajı girin, spam olup olmadığını tahmin edelim.")
|
|
|
|
|
|
|
|
|
model = joblib.load("sms_spam_model.pkl")
|
|
|
|
|
|
|
|
|
user_input = st.text_area("Mesajınızı buraya girin:")
|
|
|
|
|
|
if st.button("Tahmin Et"):
|
|
|
if user_input.strip() == "":
|
|
|
st.warning("Lütfen bir mesaj girin.")
|
|
|
else:
|
|
|
prediction = model.predict([user_input])[0]
|
|
|
label = "📢 SPAM" if prediction == 1 else "✅ Normal"
|
|
|
st.subheader("Sonuç:")
|
|
|
st.success(label if prediction == 0 else label)
|
|
|
|