Spaces:
Runtime error
Runtime error
Delete app.py.py
Browse files
app.py.py
DELETED
|
@@ -1,32 +0,0 @@
|
|
| 1 |
-
#!/usr/bin/env python
|
| 2 |
-
# coding: utf-8
|
| 3 |
-
|
| 4 |
-
# In[14]:
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
import gradio as gr
|
| 8 |
-
from joblib import load
|
| 9 |
-
|
| 10 |
-
model = load("model.joblib")
|
| 11 |
-
conv = load("tfd.joblib")
|
| 12 |
-
|
| 13 |
-
def prediction(email):
|
| 14 |
-
inp =[email]
|
| 15 |
-
inp_final = conv.tranform(inp)
|
| 16 |
-
res = model.predict(inp_final)[0]
|
| 17 |
-
return "not-spam" if res==1 else "spam"
|
| 18 |
-
iface = gr.Interface(
|
| 19 |
-
fn = prediction,
|
| 20 |
-
inputs=[gr.Text(label="Email")],
|
| 21 |
-
outputs = "text",
|
| 22 |
-
title = "Spam Identifier",
|
| 23 |
-
description = "this is used an app which can identify the email"
|
| 24 |
-
)
|
| 25 |
-
iface.launch()
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
# In[ ]:
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|