from joblib import load from sklearn.feature_extraction.text import TfidfVectorizer import numpy as np import streamlit as st vectorizer = TfidfVectorizer(use_idf=True, lowercase=True, strip_accents='ascii', stop_words='english') user_input = st.text_input("Enter some text:", "Default Text") if user_input is not None: x = vectorizer.fit_transform(np.array(user_input)) model = load('Naive_Bayes_Spam_Detection.joblib') pred = model.predict(x) st.write(pred)