Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from transformers import pipeline | |
| model_path = "./model" | |
| classifier = pipeline("text-classification", model="./model") | |
| def predict(text): | |
| result = classifier(text) | |
| return "Safe Email" if result[0]['label'] == "LABEL_0" else "Phishing Email" | |
| iface = gr.Interface( | |
| fn=predict, | |
| inputs="text", | |
| outputs="label", | |
| title="Spam or Phishing", | |
| description="Enter Email body to classify it as spam or phishing.", | |
| ) | |
| iface.launch() |