Upload 3 files
Browse files- Requirements.txt +3 -0
- app.py.py +32 -0
- model.joblib +3 -0
Requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
gradio
|
| 2 |
+
joblib
|
| 3 |
+
scikit-learn
|
app.py.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
|
model.joblib
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:97447542bda5d3cc1e08fca0b5d1101ee0d115b1df8cd23e3a6c4451ca8a8f52
|
| 3 |
+
size 239895
|