| import gradio as gr | |
| from joblib import load | |
| model = load("model.joblib") | |
| tfd = load("tfd.joblib") | |
| def prediction(email): | |
| inp = [email] | |
| inp_final = tfd.transform(inp) | |
| res = model.predict_proba(inp_final)[0] | |
| return "Not Spam" if res==1 else "Spam" | |
| iface = gr.Interface( | |
| fn = prediction, | |
| inputs = [gr.Text(label="Enter Email Text")], | |
| outputs = "text", | |
| title = "Spam Identifier", | |
| description = "This is used an app which can identify the email.") | |
| iface.launch() | |