| #!/usr/bin/env python | |
| # coding: utf-8 | |
| # In[14]: | |
| import gradio as gr | |
| from joblib import load | |
| model = load("model.joblib") | |
| conv = load("tfd.joblib") | |
| def prediction(email): | |
| inp =[email] | |
| inp_final = conv.tranform(inp) | |
| res = model.predict(inp_final)[0] | |
| return "not-spam" if res==1 else "spam" | |
| iface = gr.Interface( | |
| fn = prediction, | |
| inputs=[gr.Text(label="Email")], | |
| outputs = "text", | |
| title = "Spam Identifier", | |
| description = "this is used an app which can identify the email" | |
| ) | |
| iface.launch() | |
| # In[ ]: | |