CoolFace
Modelpublic

CrabInHoney/urlbert-tiny-v4-phishing-classifier

sourceHugging Faceapache-2.0updated 8mo agoView on Hugging Face
2likes356downloads
Model Card

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-v3-phishing-classifier

Comparison with the previous version of urlbert phishing-classifier:
VersionAccuracyPrecisionRecallF1-score
v20.96650.97560.95220.9637
v30.98190.98760.97340.9805
v4 (this model)0.99070.99450.98550.9900

Model size

3.69M 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_name = "CrabInHoney/urlbert-tiny-v4-phishing-classifier"

tokenizer = BertTokenizerFast.frompretrained(modelname) model = BertForSequenceClassification.frompretrained(modelname) model.to(device)

classifier = pipeline( "text-classification", model=model, tokenizer=tokenizer, device=0 if torch.cuda.isavailable() else -1, returnall_scores=True )

test_urls = [ "huggingface.co/", "hu991ngface.com.ru/" ]

labelmapping = {"LABEL0": "good", "LABEL_1": "fish"}

for url in testurls: results = classifier(url) print(f"\nURL: {url}") for result in results[0]: label = result['label'] score = result['score'] friendlylabel = labelmapping.get(label, label) print(f"Класс: {friendlylabel}, вероятность: {score:.4f}")

Используемое устройство: cuda

URL: huggingface.co/ Класс: good, вероятность: 0.9710 Класс: fish, вероятность: 0.0290

URL: hu991ngface.com.ru/ Класс: good, вероятность: 0.0013 Класс: fish, вероятность: 0.9987