zefang-liu/phishing-email-dataset
Viewer • Updated • 18.7k • 967 • 33
How to use takumi123xxx/phishing-email-detector-deberta-v3 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="takumi123xxx/phishing-email-detector-deberta-v3") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("takumi123xxx/phishing-email-detector-deberta-v3")
model = AutoModelForSequenceClassification.from_pretrained("takumi123xxx/phishing-email-detector-deberta-v3")# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("takumi123xxx/phishing-email-detector-deberta-v3")
model = AutoModelForSequenceClassification.from_pretrained("takumi123xxx/phishing-email-detector-deberta-v3")フィッシングメール検出のためにファインチューニングされたDeBERTa-v3-largeモデル
このモデルはmicrosoft/deberta-v3-largeをベースに、フィッシングメールと安全なメールを分類するためにファインチューニングされています。
閾値を0.0007に設定することで、フィッシングメールを100%検出できます。
| Metric | Value |
|---|---|
| Accuracy | 97.59% |
| F1-score | 96.99% |
| Precision | 95.01% |
| Recall | 99.04% |
| Metric | Value |
|---|---|
| Accuracy | 95.23% |
| F1-score | 94.26% |
| Precision | 89.15% |
| Recall | 100.00% |
from transformers import pipeline
classifier = pipeline("text-classification", model="takumi123xxx/phishing-email-detector-deberta-v3")
result = classifier("Your email text here")
print(result)
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model = AutoModelForSequenceClassification.from_pretrained("takumi123xxx/phishing-email-detector-deberta-v3")
tokenizer = AutoTokenizer.from_pretrained("takumi123xxx/phishing-email-detector-deberta-v3")
THRESHOLD = 0.0007 # For 100% Recall
def detect_phishing(text):
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
with torch.no_grad():
outputs = model(**inputs)
probs = torch.softmax(outputs.logits, dim=-1)
phishing_prob = probs[0][1].item()
return {
"is_phishing": phishing_prob >= THRESHOLD,
"phishing_probability": phishing_prob,
"label": "Phishing Email" if phishing_prob >= THRESHOLD else "Safe Email"
}
# Example
result = detect_phishing("Congratulations! You've won $1,000,000. Click here to claim your prize!")
print(result)
0: Safe Email1: Phishing Email| Use Case | Threshold | Recall | False Positives |
|---|---|---|---|
| Balanced | 0.5 | 99.04% | 38 |
| High Security | 0.0007 | 100.00% | 89 |
MIT License
Base model
microsoft/deberta-v3-large
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="takumi123xxx/phishing-email-detector-deberta-v3")