π‘οΈ Phishing URL Detector β RoBERTa + LoRA
This repository stores a LoRA adapter for roberta-base
, fineβtuned for phishing URL detection.
β οΈ Note: The π€ Inference Widget is disabled because this uses PEFT LoRA adapters. Use the code snippet below to run inference locally.
π¦ Model Details
- Base:
roberta-base
- Adapter Type: LoRA via PEFT
- Task: Phishing vs Legitimate URL classification
- Model Size: ~8.4 MB
- Files Included (9 total):
adapter_model.safetensors
β LoRA weights (~3.6β―MB)adapter_config.json
tokenizer_config.json
special_tokens_map.json
vocab.json
merges.txt
π Performance
Metric | Score |
---|---|
Accuracy | 99.81% |
Precision | 99.99% |
Recall | 99.68% |
F1 Score | 99.84% |
AUC | 99.78% |
π§ͺ Usage in Python
from transformers import RobertaTokenizerFast, RobertaForSequenceClassification
from peft import PeftModel, PeftConfig
import torch
# Load LoRA adapter with base model
config = PeftConfig.from_pretrained("Irshadcse2k16/PhishUrlDetection-RoBERTa")
base_model = RobertaForSequenceClassification.from_pretrained(
config.base_model_name_or_path, num_labels=2
)
model = PeftModel.from_pretrained(
base_model, "Irshadcse2k16/PhishUrlDetection-RoBERTa"
)
tokenizer = RobertaTokenizerFast.from_pretrained(
"Irshadcse2k16/PhishUrlDetection-RoBERTa"
)
# Inference
url = "http://secure-login-update.com"
inputs = tokenizer(url, return_tensors="pt", truncation=True, padding=True, max_length=128)
with torch.no_grad():
logits = model(**inputs).logits
probs = torch.softmax(logits, dim=1)
label = torch.argmax(probs).item()
print("π¨ Phishing" if label == 1 else "β
Legitimate")
- Downloads last month
- -
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
π
Ask for provider support