File size: 572 Bytes
85aeafb |
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 30 31 32 33 |
#!/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[ ]:
|