Downloads · 30 days
8
2% of all-time downloads
CrabInHoney/urlbert-tiny-v2-phishing-classifier
urlbert-tiny-v2-phishing-classifier is a text classification model from CrabInHoney. Use it when you need a label for a piece of text. The card lists the license as mit.
This is a very small version of BERT, designed to categorize links into phishing and non-phishing links
Downloads · 30 days
8
2% of all-time downloads
All-time downloads
456
Public
Parameters
3.7M
14.8 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors14.8 MB · 100%
From the Hugging Face model README
This is a very small version of BERT, designed to categorize links into phishing and non-phishing links
An updated, lighter version of the old classification model for URL analysis
Old version: https://huggingface.co/CrabInHoney/urlbert-tiny-v1-phishing-classifier
Val score: 0.9622
Model size
3.7M params
Tensor type
F32
Dataset (urls.json only)
Example:
from transformers import BertTokenizerFast, BertForSequenceClassification, pipeline
import torch
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
print(f"Используемое устройство: {device}")
model_path = "./urlbert-tiny-v2-phishing-classifier"
tokenizer = BertTokenizerFast.from_pretrained(model_path)
model = BertForSequenceClassification.from_pretrained(model_path)
model.to(device)
classifier = pipeline(
"text-classification",
model=model,
tokenizer=tokenizer,
device=0 if torch.cuda.is_available() else -1,
return_all_scores=True
)
test_urls = [
"huggingface.co/",
"p64.hu991ngface.co.com.ru/"
]
for url in test_urls:
results = classifier(url)
print(f"\nURL: {url}")
for result in results[0]:
label = result['label']
score = result['score']
print(f"Класс: {label}, вероятность: {score:.4f}")
Output:
Используемое устройство: cuda
URL: huggingface.co/
Класс: good, вероятность: 0.8515
Класс: phish, вероятность: 0.1485
URL: p64.hu991ngface.co.com.ru/
Класс: good, вероятность: 0.0289
Класс: phish, вероятность: 0.9711