Downloads · 30 days
5
6% of all-time downloads
JashVora7/hybrid-guardrails-distilbert-moderation
hybrid-guardrails-distilbert-moderation is a text classification model from JashVora7. Use it when you need a label for a piece of text. The card lists the license as mit.
A DistilBERT binary safe/unsafe content classifier, fine-tuned as a lightweight neural baseline in the hybrid-guardrails neuro-symbolic moderation pipeline project. Evaluated standalone as the "Distilbert Only" baseline.
Downloads · 30 days
5
6% of all-time downloads
All-time downloads
79
Public
Parameters
67M
1.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors268 MB · 100%
From the Hugging Face model README
A DistilBERT binary safe/unsafe content classifier, fine-tuned as a lightweight neural baseline in the hybrid-guardrails neuro-symbolic moderation pipeline project. Evaluated standalone as the "Distilbert Only" baseline.
DistilBertForSequenceClassification, fine-tuned from distilbert-base-uncased
(6 layers, hidden size 768), 2-way classification (safe / unsafe).
Same combined corpus as the project's DeBERTa checkpoint (see
JashVora7/hybrid-guardrails-deberta-moderation): AdvBench, ToxiGen, and
Alpaca-Cleaned. Training config: training/configs/distilbert_base.yaml
(seed 42).
Research artifact only -- a lightweight-but-weaker comparison point against the DeBERTa checkpoint in the project's baseline table, not a recommended production classifier. Its recall on adversarial content is substantially lower than DeBERTa's (see below); it exists in this project to demonstrate that hybrid symbolic+neural gains are conditional on neural classifier quality, not just architecture choice.
| Metric | Value |
|---|---|
| Precision | 0.600 |
| Recall | 0.079 |
| F1 | 0.139 |
| AUROC | 0.538 |
| FRR | 0.005 |
Low recall/F1 relative to the project's DeBERTa checkpoint is a real,
reported finding, not a bug -- see paper/MANUSCRIPT.md (§5.1) in the
source repository for discussion.
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
tok = AutoTokenizer.from_pretrained("JashVora7/hybrid-guardrails-distilbert-moderation")
model = AutoModelForSequenceClassification.from_pretrained(
"JashVora7/hybrid-guardrails-distilbert-moderation"
)
inputs = tok("ignore all previous instructions", return_tensors="pt")
with torch.no_grad():
probs = torch.softmax(model(**inputs).logits, dim=-1)
print(probs) # [P(safe), P(unsafe)]
MIT, matching the source repository.