CrabInHoney/urlbert-tiny-v4-phishing-classifier
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:
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
