Spaces:
Sleeping
Sleeping
File size: 657 Bytes
45928ec | 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 34 35 36 37 38 | #!/usr/bin/env python
# coding: utf-8
# In[3]:
import gradio as gr
from joblib import load
model = load("model.joblib")
conv = load("tfd.joblib")
def prediction(email):
inp = [email] # passing input
inp_final = conv.transform(inp) # converting input
res = model.predict(inp_final)[0] # predicting output
return "Not Spam" if res==1 else "Spam" # predicting result
iface = gr.Interface(
fn = prediction,
inputs=[gr.Text(label="Email")],
outputs= "text",
title="Spam Idetifier",
description="This is used an app which can identify the email")
iface.launch()
# In[ ]:
|