Views
No views yet
*.myshopify.com, *.wixsite.com) or official websites (e.g., acmewidgets.com).amahdaouy/DomURLs_BERTCrabInHoney/urlbert-tiny-base-v4| Parameter | Value |
|---|---|
| Epochs | 20 |
| Learning Rate | 2e-5 |
| Batch Size | 32 |
| Max Sequence Length | 64 tokens |
| Optimizer | AdamW |
| Weight Decay | 0.01 |
| LR Scheduler | ReduceLROnPlateau |
| Early Stopping | Patience: 3, Threshold: 0.001 |
| Metric | Threshold | Achieved |
|---|---|---|
| Accuracy | ≥ 0.80 | ≥ 0.99 ✅ |
| F1 Score | ≥ 0.80 | ≥ 0.99 ✅ |
| Precision | ≥ 0.80 | ≥ 0.99 ✅ |
| Recall | ≥ 0.80 | ≥ 0.99 ✅ |
| False Positive Rate | ≤ 0.15 | < 0.01 ✅ |
| False Negative Rate | ≤ 0.15 | < 0.01 ✅ |
https://acmewidgets.com → official_website (99.98% confidence)https://store.myshopify.com → platform (75.96% confidence)https://example.wixsite.com/store → platform (high confidence)1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4# Load model and tokenizer
5model_name = "DiligentAI/urlbert-url-classifier"
6tokenizer = AutoTokenizer.from_pretrained(model_name)
7model = AutoModelForSequenceClassification.from_pretrained(model_name)
8
9# Classify URL
10url = "https://acmewidgets.com"
11inputs = tokenizer(url, return_tensors="pt", truncation=True, max_length=64)
12
13with torch.no_grad():
14 outputs = model(**inputs)
15 predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
16 predicted_class = torch.argmax(predictions, dim=1).item()
17 confidence = predictions[0][predicted_class].item()
18
19label_map = {0: "official_website", 1: "platform"}
20print(f"Prediction: {label_map[predicted_class]} ({confidence:.2%})")
21Using Hugging Face Pipeline
22from transformers import pipeline
23
24classifier = pipeline("text-classification", model="DiligentAI/urlbert-url-classifier")
25result = classifier("https://store.myshopify.com")
26
27
28Pydantic Integration (Production-Ready)
29
30from transformers import pipeline
31from pydantic import BaseModel, Field
32from typing import Literal
33
34class URLClassificationResult(BaseModel):
35 url: str
36 label: Literal["official_website", "platform"]
37 confidence: float = Field(..., ge=0.0, le=1.0)
38
39def classify_url(url: str) -> URLClassificationResult:
40 classifier = pipeline("text-classification", model="DiligentAI/urlbert-url-classifier")
41 result = classifier(url[:64])[0] # Truncate to max_length
42
43 label_map = {"LABEL_0": "official_website", "LABEL_1": "platform"}
44
45 return URLClassificationResult(
46 url=url,
47 label=label_map[result["label"]],
48 confidence=result["score"]
49 )
50
51Limitations and Bias
52Max URL Length: Model trained on 64-token sequences. Longer URLs are truncated.
53Domain Focus: Optimized for e-commerce and business websites
54Platform Coverage: Best performance on common platforms (Shopify, Wix, etc.)
55Language: Primarily trained on English-language domains
56Edge Cases: May have lower confidence on:
57Uncommon TLDs
58Very short URLs
59Internationalized domain names
60Intended Use
61
62Primary Use Cases:
63URL filtering and categorization pipelines
64Lead qualification systems
65Web scraping and data collection workflows
66Business intelligence and market research
67Out of Scope:
68Content classification (only URL structure is analyzed)
69Malicious URL detection (use dedicated security models)
70Language detection
71Spam filtering
72Model Card Authors
73DiligentAI Team
74
75Citation
76@misc{urlbert-classifier-2025,
77 author = {DiligentAI},
78 title = {URL Classifier - Platform vs Official Website Detection},
79 year = {2025},
80 publisher = {HuggingFace},
81 howpublished = {\url{https://huggingface.co/DiligentAI/urlbert-url-classifier}}
82}
83
84License
85MIT License
86Framework Versions
87Transformers: 4.57.0+
88PyTorch: 2.0.0+
89Python: 3.10+
90Training Infrastructure
91Framework: PyTorch + Hugging Face Transformers
92Pipeline Orchestration: DVC (Data Version Control)
93CI/CD: GitHub Actions
94Model Format: Safetensors
95Dependencies: See repository
96Model Versioning
97This model is automatically versioned and deployed via GitHub Actions. Each release includes:
98Model checkpoint (.safetensors)
99Tokenizer configuration
100Label mapping (label_map.json)
101Performance metrics (metrics.json)
102
103Contact
104For issues, questions, or feedback:
105GitHub: DiligentAI/url-classifier
106Organization: DiligentAI