Downloads · 30 days
60
23% of all-time downloads
spotproject/spot-distilbert-phishing
spot-distilbert-phishing is a text classification model from spotproject. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
A DistilBERT-based binary email classifier that labels emails as phishing or legitimate. This is the model shipped inside SPOT's analyzer-nlp plugin; it is mirrored here as a public artefact so researchers, integrator…
Downloads · 30 days
60
23% of all-time downloads
All-time downloads
259
Public
Parameters
67M
268 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors268 MB · 100%
From the Hugging Face model README
A DistilBERT-based binary email classifier that labels emails as
phishing or legitimate. This is the model shipped inside
SPOT's analyzer-nlp plugin; it
is mirrored here as a public artefact so researchers, integrators, and
auditors can inspect what SPOT actually runs in production.
DistilBertForSequenceClassification (6 layers,
768-dim hidden state, 12 attention heads). Sequence-classification
head with two output labels.cybersectony/phishing-email-detection-distilbert_v2.1,
re-headed from 4 labels to 2 (ignore_mismatched_sizes=True) and
fine-tuned end-to-end.[P(legitimate), P(phishing)]. The
predicted class is the argmax.POST /internal/analyze on analyzer-nlp; the wrapper in
analyzer-nlp
loads this model and answers an AnalyzerVerdict (a score, a
confidence and the nlp.phishing_probability signal) that the
workflow's verdict policy combines with the other analyzers' answers.Fine-tuned on the public SetFit/enron_spam
dataset:
| Split | Examples |
|---|---|
| Train | 31 716 |
| Test (used as eval split) | 2 000 |
Labels: 0 = legitimate, 1 = phishing/spam. The dataset is the
Enron corpus relabelled by SetFit; it skews toward early-2000s English
business email and reflects historical phishing patterns. Performance
on contemporary phishing (modern brand impersonation, AI-generated
text, image-only emails) is not guaranteed by this corpus, which is
exactly why SPOT augments the verdict with rule-based and contextual
analyzers.
| Hyper-parameter | Value |
|---|---|
| epochs | 3 |
per_device_train_batch_size | 16 |
per_device_eval_batch_size | 64 |
warmup_steps | 500 |
weight_decay | 0.01 |
| optimizer | AdamW (HF Trainer defaults) |
| max sequence length | 512 (truncated, padded to max) |
Hardware: 2x NVIDIA Tesla T4 GPUs, run as a Kaggle notebook.
Framework: Hugging Face transformers.Trainer.
Final metrics on the held-out SetFit/enron_spam test split (2 000
examples) at the end of epoch 3:
| Metric | Value |
|---|---|
eval_loss | 0.0277 |
eval_runtime (s) | 16.80 |
eval_samples_per_second | 119.06 |
Accuracy / precision / recall / F1 were not computed during training.
The production wrapper in analyzer-nlp/tests/ exercises the
end-to-end SPOT integration on a larger, internal evaluation set;
those numbers are not yet published here.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
tok = AutoTokenizer.from_pretrained("spotproject/spot-distilbert-phishing")
model = AutoModelForSequenceClassification.from_pretrained("spotproject/spot-distilbert-phishing")
text = "Dear customer, your account has been suspended. Click here to verify..."
inputs = tok(text, return_tensors="pt", truncation=True, max_length=512)
with torch.no_grad():
logits = model(**inputs).logits
probs = torch.softmax(logits, dim=-1)[0]
print({"legitimate": probs[0].item(), "phishing": probs[1].item()})
For the full SPOT integration ; with workflow context, knowledge-store
enrichment, and aggregation across analyzers ; see
analyzer-nlp on Codeberg.
Apache-2.0, matching the analyzer-nlp
source repository.
@software{spot_distilbert_phishing,
title = {spot-distilbert-phishing: phishing classifier for the SPOT platform},
author = {SPOT Project},
year = {2026},
url = {https://huggingface.co/spotproject/spot-distilbert-phishing},
license = {Apache-2.0}
}