dviro/urlbert-onnx-mini
By dviro · ↓ 0 · ♥ 0 · Updated 2025-05-10
What's in this repo
This page lists the files in dviro/urlbert-onnx-mini, including phishing_detector.onnx.
- 1 ONNX models (.onnx files)
- 8 files, including 4 .json, 1 .md, 1 .onnx, 1 .txt
- Last updated 2025-05-10
ONNX files
| File | Size | Download |
|---|---|---|
| phishing_detector.onnx | — | Download |
How to use
These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.
README
URLBert Phishing Detector (ONNX)
This is an ONNX version of the CrabInHoney/urlbert-tiny-v4-phishing-classifier model, which is designed to detect phishing URLs.
Usage with Hugging Face Transformers
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import onnxruntime as ort
import numpy as np
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("dviro/urlbert-onnx-mini")
# Load ONNX model
ort_session = ort.InferenceSession("phishing_detector.onnx")
# Example URL
url = "example.com"
# Tokenize
inputs = tokenizer(url, return_tensors="np", padding="max_length", truncation=True)
input_ids = inputs["input_ids"].astype(np.int64)
attention_mask = inputs["attention_mask"].astype(np.int64)
token_type_ids = inputs.get("token_type_ids", np.zeros_like(input_ids)).astype(np.int64)
# Run inference
outputs = ort_session.run(
None,
{
"input_ids": input_ids,
"attention_mask": attention_mask,
"token_type_ids": token_type_ids
}
)
# Process results
logits = outputs[0][0]
scores = np.exp(logits) / np.sum(np.exp(logits))
labels = ["Safe", "Phishing"]
prediction = labels[np.argmax(scores)]
confidence = np.max(scores)
print(f"URL: {url}")
print(f"Prediction: {prediction}")
print(f"Confidence: {confidence:.4f}")
Usage with ONNX Runtime Web
This model can also be used in browser applications with ONNX Runtime Web. See the example code in the accompanying GitHub repository.
Model Details
- Original model: CrabInHoney/urlbert-tiny-v4-phishing-classifier
- Task: Binary classification (phishing detection)
- Framework: ONNX
- Model size: Small (BERT-tiny architecture)
Files (8)
Related models
More from dviro
No other models by this author.
More models
No task type declared.