Loading…
Loading…
This is an ONNX version of Horizon-Labs/phishing-scam-detector-base. It was automatically converted and uploaded using this Hugging Face Space.
See the pipeline documentation for text-classification: https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.TextClassificationPipeline
Flags phishing, scams and spam in emails, SMS, chat and social-media messages in many languages. Three labels:
fraud: phishing (fake bank, delivery, account or tax messages with links), scams (prizes, investment and crypto schemes,
fake jobs, "hi mum, new number", romance, advance fee), requests for passwords, one-time codes or payment details, malware lures;spam: unwanted advertising and bulk marketing that is not trying to steal anything;legitimate: everything else, including genuine notifications that look similar (real one-time codes, delivery updates,
bank alerts).Built on mmBERT-base, Apache-2.0, ONNX files for CPU and the browser (transformers.js) included. Useful for message filtering and moderation, and for AI agents that read email or chats (see also our prompt-injection guard for attacks on the agent itself).
P(fraud) + P(spam) for "unwanted", or P(fraud) alone if marketing is acceptable. The default threshold is 0.5;
raise it to cut false positives (see the false-positive rates below).onnx/model_quantized.onnx (int8 embeddings, 641 MB) gives the same top label as fp32 for 99.8% of 520 benchmark texts.from transformers import pipeline
clf = pipeline("text-classification", model="Horizon-Labs/phishing-scam-detector-base", top_k=None)
print(clf("Your parcel could not be delivered. Pay the 1.99 EUR customs fee within 24h: dhl-redelivery.example.com"))
# [[{'label': 'fraud', 'score': ...}, {'label': 'legitimate', 'score': ...}, {'label': 'spam', 'score': ...}]]
transformers.js:
import { pipeline } from "@huggingface/transformers";
const clf = await pipeline("text-classification", "Horizon-Labs/phishing-scam-detector-base", { dtype: "q8" });
console.log(await clf("Ihr Konto wurde gesperrt. Bestätigen Sie Ihre Daten: sparkasse-sicher.example.de", { top_k: null }));
Public spam / phishing / smishing test sets, used only for evaluation. Every model is scored the same way (code/): AUC of its
"unwanted" probability (for this model P(fraud) + P(spam)), and F1 and false-positive rate at 0.5.
| model | licence | real smishing, 3 languages: AUC | F1 @ 0.5 | false-positive rate @ 0.5 | phishing & spam emails (English): AUC | SMS spam (English): AUC | SMS spam, 21 languages (machine-translated): AUC | note |
|---|---|---|---|---|---|---|---|---|
| this model (307M) | Apache-2.0 | 0.925 | 0.768 | 0.110 | 0.978 | 0.978 | 0.950 | multilingual |
| cybersectony/phishing-email-detection-distilbert_v2.4.1 (67M) | Apache-2.0 | 0.606 | 0.715 | 0.880 | 0.999 | 0.759 | 0.664 | English emails and URLs |
| ptouch/phishing-distilbert-cyber207 (67M) | none given | 0.485 | 0.664 | 0.738 | 0.991 | 0.892 | 0.720 | English |
| ealvaradob/bert-finetuned-phishing (110M) | Apache-2.0 | 0.797 | 0.763 | 0.672 | 1.000 | 0.999 | 0.965 | English emails, SMS, URLs, websites |
| mshenoda/roberta-spam (125M) | MIT | 0.803 | 0.823 | 0.332 | 0.996 | 0.999 | 0.974 | English spam messages |
| mrm8488/bert-tiny-finetuned-sms-spam-detection (4M) | none given | 0.834 | 0.779 | 0.541 | 0.450 | 0.994 | 0.964 | trained on the UCI SMS set (in-domain) |
| mrm8488/bert-tiny-finetuned-enron-spam-detection (4M) | Apache-2.0 | 0.735 | 0.709 | 0.959 | 0.983 | 0.735 | 0.785 | trained on Enron spam (in-domain) |
| Qwen/Qwen3.8-27B (teacher, prompted) (27B) | Apache-2.0 | 0.945 | 0.878 | 0.128 | 0.996 | 0.986 | 0.969 | our teacher, for reference |
spam / fraud split comes from our teacher; the public sets only distinguish wanted from unwanted, so only that is measured.Per set:
| set | AUC | F1 @ 0.5 | false-positive rate | recall |
|---|---|---|---|---|
| Bengali / Banglish / English SMS (smishing + promotions) | 0.979 | 0.946 | 0.112 | 0.952 |
| Mozambican Portuguese SMS and Facebook (smishing) | 0.840 | 0.450 | 0.096 | 0.319 |
| Korean SMS (smishing) | 0.957 | 0.909 | 0.120 | 0.934 |
| phishing vs safe emails (English) | 0.978 | 0.916 | 0.112 | 0.943 |
| Enron spam vs ham (English) | 0.978 | 0.934 | 0.076 | 0.944 |
| UCI SMS spam (English) | 0.978 | 0.900 | 0.063 | 0.872 |
code/ in this repository.Horizon-Labs/phishing-scam-detector-base