File size: 535 Bytes
4dd8f0b |
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 39 40 41 42 43 44 45 |
#!/usr/bin/env python
# coding: utf-8
# In[10]:
import gradio as gr
from joblib import load
model = load('model.joblib')
conv = load('tfd.joblib')
def prediction(email):
inp = [email]
inp_final = conv.transform(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 = 'spam detection')
iface.launch()
# In[9]:
# In[ ]:
|