Download app.py from alzx1/email-classifier: direct link, hf CLI and curl.
- Browser
- Download file 548 Bytes
-
https://huggingface.co/alzx1/email-classifier/resolve/main/app.py
- Command line
-
hf download hf://alzx1/email-classifier/app.py
-
curl -L -o app.py https://huggingface.co/alzx1/email-classifier/resolve/main/app.py
548 Bytes
| 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() | |