This model was trained to identify phishing-related content by analyzing linguistic and structural patterns commonly found in malicious communications.
By leveraging BERT’s bidirectional transformer architecture, it effectively detects phishing attempts even when the message appears legitimate or well-written.
1from transformers import pipeline
2# Load the phishing detection model
3classifier = pipeline("text-classification", model="your-username/phishing-email-detector-capstone")
4# Example texts
5examples = [
6 "Dear colleague, your email storage is full. Click here to verify your account: https://secure-update-login.com",
7 "Hi team, the meeting starts at 2 PM today.",
8 "You have won a free gift card! Claim now at http://bit.ly/3xYzabc"
9]
10# Run inference
11for text in examples:
12 result = classifier(text)[0]
13 print(f"Text: {text}\nPrediction: {result['label']} (score: {result['score']:.4f})\n")