Spaces:
Runtime error
Runtime error
README v1
Browse files
README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
---
|
2 |
title: PhishGuardian AI
|
3 |
-
emoji:
|
4 |
colorFrom: yellow
|
5 |
colorTo: purple
|
6 |
sdk: gradio
|
@@ -10,5 +10,122 @@ pinned: false
|
|
10 |
license: apache-2.0
|
11 |
short_description: UDSM AI-powered tool for real-time phishing email detection.
|
12 |
---
|
|
|
|
|
|
|
13 |
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
title: PhishGuardian AI
|
3 |
+
emoji: 🔥
|
4 |
colorFrom: yellow
|
5 |
colorTo: purple
|
6 |
sdk: gradio
|
|
|
10 |
license: apache-2.0
|
11 |
short_description: UDSM AI-powered tool for real-time phishing email detection.
|
12 |
---
|
13 |
+
Phishing Email Detection Space
|
14 |
+
Welcome to the Phishing Email Detection Hugging Face Space! This project provides an interactive web interface to classify emails as legitimate or phishing using a fine-tuned DistilBERT model (cybersectony/phishing-email-detection-distilbert_v2.4.1). Built with Gradio, this Space allows users to input email text and receive predictions with confidence scores and probability distributions.
|
15 |
+
Table of Contents
|
16 |
|
17 |
+
Overview
|
18 |
+
Features
|
19 |
+
How It Works
|
20 |
+
Usage
|
21 |
+
Installation (For Local Development)
|
22 |
+
Model Details
|
23 |
+
Contributing
|
24 |
+
License
|
25 |
+
Contact
|
26 |
+
|
27 |
+
Overview
|
28 |
+
This Space deploys a DistilBERT-based model to detect phishing emails by classifying input text into one of four categories: Legitimate Email, Phishing URL, Legitimate URL, or Phishing URL (Alt). The model is hosted on Hugging Face and integrated with a Gradio interface for easy interaction. Users can input email text and instantly view the predicted classification along with confidence scores.
|
29 |
+
Features
|
30 |
+
|
31 |
+
Interactive Interface: Input email text via a user-friendly Gradio web interface.
|
32 |
+
Real-Time Predictions: Get immediate classification results with confidence scores.
|
33 |
+
Detailed Output: View probabilities for all classes (Legitimate Email, Phishing URL, Legitimate URL, Phishing URL Alt).
|
34 |
+
Lightweight Model: Uses DistilBERT for efficient inference, suitable for CPU-based environments.
|
35 |
+
Open Source: Code and model are accessible for further customization.
|
36 |
+
|
37 |
+
How It Works
|
38 |
+
|
39 |
+
The user inputs email text into the Gradio interface.
|
40 |
+
The text is tokenized using the DistilBERT tokenizer.
|
41 |
+
The fine-tuned DistilBERT model processes the input and outputs probabilities for each class.
|
42 |
+
The interface displays the most likely classification, confidence score, and all class probabilities.
|
43 |
+
|
44 |
+
Usage
|
45 |
+
|
46 |
+
Access the Space: Visit the Hugging Face Space URL (e.g., https://<your-username>-<space-name>.hf.space).
|
47 |
+
Enter Email Text: Type or paste the email content into the provided text box.
|
48 |
+
Get Prediction: Click the "Submit" button to view the classification results.
|
49 |
+
Interpret Results: The output includes:
|
50 |
+
Prediction: The most likely class (e.g., "Phishing URL").
|
51 |
+
Confidence: The probability score for the predicted class.
|
52 |
+
All Probabilities: Probability scores for all four classes.
|
53 |
+
|
54 |
+
|
55 |
+
|
56 |
+
Example Input:
|
57 |
+
Subject: Urgent: Verify Your Account Now
|
58 |
+
Dear Customer, your account has been flagged. Click here to verify: [suspicious-link.com].
|
59 |
+
|
60 |
+
Example Output:
|
61 |
+
Prediction: Phishing URL
|
62 |
+
Confidence: 0.9278
|
63 |
+
All Probabilities:
|
64 |
+
- Legitimate Email: 0.0123
|
65 |
+
- Phishing URL: 0.9278
|
66 |
+
- Legitimate URL: 0.0345
|
67 |
+
- Phishing URL (Alt): 0.0254
|
68 |
+
|
69 |
+
Installation (For Local Development)
|
70 |
+
If you want to run this project locally or contribute to its development, follow these steps:
|
71 |
+
|
72 |
+
Clone the Repository:
|
73 |
+
git clone https://huggingface.co/spaces/<your-username>/<your-space-name>
|
74 |
+
cd <your-space-name>
|
75 |
+
|
76 |
+
|
77 |
+
Install Dependencies:Create a virtual environment and install the required packages:
|
78 |
+
python -m venv venv
|
79 |
+
source venv/bin/activate # On Windows: venv\Scripts\activate
|
80 |
+
pip install -r requirements.txt
|
81 |
+
|
82 |
+
|
83 |
+
Run the Application:Launch the Gradio interface locally:
|
84 |
+
python app.py
|
85 |
+
|
86 |
+
|
87 |
+
Access Locally:Open the provided local URL (e.g., http://127.0.0.1:7860) in your browser.
|
88 |
+
|
89 |
+
|
90 |
+
Requirements (listed in requirements.txt):
|
91 |
+
transformers
|
92 |
+
torch
|
93 |
+
gradio
|
94 |
+
|
95 |
+
Model Details
|
96 |
+
|
97 |
+
Model: cybersectony/phishing-email-detection-distilbert_v2.4.1
|
98 |
+
Architecture: DistilBERT (fine-tuned for sequence classification)
|
99 |
+
Classes:
|
100 |
+
Legitimate Email
|
101 |
+
Phishing URL
|
102 |
+
Legitimate URL
|
103 |
+
Phishing URL (Alt)
|
104 |
+
|
105 |
+
|
106 |
+
Input: Text (max length: 512 tokens)
|
107 |
+
Output: Probabilities for each class, with the highest probability determining the predicted class.
|
108 |
+
|
109 |
+
The model is hosted on Hugging Face and loaded directly in the Space. For private models, ensure you set the HF_TOKEN environment variable in your Space settings.
|
110 |
+
Contributing
|
111 |
+
Contributions are welcome! To contribute:
|
112 |
+
|
113 |
+
Fork the repository on Hugging Face.
|
114 |
+
Create a new branch for your changes (git checkout -b feature/your-feature).
|
115 |
+
Commit your changes (git commit -m "Add your feature").
|
116 |
+
Push to your fork (git push origin feature/your-feature).
|
117 |
+
Open a pull request on the Space’s repository.
|
118 |
+
|
119 |
+
Please ensure your code follows the project’s style and includes tests where applicable.
|
120 |
+
|
121 |
+
License
|
122 |
+
This project is licensed under the APACHE 2.0. See the LICENSE file for details.
|
123 |
+
|
124 |
+
Contact
|
125 |
+
For questions or feedback, please reach out via:
|
126 |
+
|
127 |
+
Hugging Face: [https://huggingface.co/MUFASA25]
|
128 |
+
Email: [[email protected]]
|
129 |
+
Issues: Open an issue on the Space’s repository.
|
130 |
+
|
131 |
+
Thank you for using the Phishing Email Detection Space!
|