Download app.py.py from AbdulIAIML/email_spam_classifier: direct link, hf CLI and curl.
- Browser
- Download file 572 Bytes
-
https://huggingface.co/AbdulIAIML/email_spam_classifier/resolve/main/app.py.py
- Command line
-
hf download hf://AbdulIAIML/email_spam_classifier/app.py.py
-
curl -L -o app.py.py https://huggingface.co/AbdulIAIML/email_spam_classifier/resolve/main/app.py.py
572 Bytes
| #!/usr/bin/env python | |
| # coding: utf-8 | |
| # In[14]: | |
| import gradio as gr | |
| from joblib import load | |
| model = load("model.joblib") | |
| conv = load("tfd.joblib") | |
| def prediction(email): | |
| inp =[email] | |
| inp_final = conv.tranform(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 = "this is used an app which can identify the email" | |
| ) | |
| iface.launch() | |
| # In[ ]: | |