File size: 548 Bytes
f2fceb6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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()