CoolFace
Modelpublic

aryasuneesh-quilr/hybrid-intent-crossencoder-minilm-L12-v2

sourceHugging Faceapache-2.0updated 7mo agoView on Hugging Face
0likes67downloads
Model Card

hybrid-intent-crossencoder-minilm-L12-v2

Cross-encoder reranker for enterprise intent detection (DLP / security). Fine-tuned from cross-encoder/ms-marco-MiniLM-L12-v2 on a hybrid synthetic intent-detection dataset.

Input format

user_input [SEP] intent_description

Performance (held-out test set, threshold=0.3)

MetricValue
Recall0.9913
Precision0.9522
F10.9714
AUC-ROC0.9978
PR-AUC0.9982
Best threshold (F1-optimal)0.8819 → F1=0.9820

Training config

ParameterValue
Base modelcross-encoder/ms-marco-MiniLM-L12-v2
Batch size64
Grad accum steps1
Effective batch64
Learning rate2e-05
Label smoothing0.05
Warmup ratio0.06
Max sequence length256
Early stoppingrecall@0.3 (patience=3)
Epochs trained10
Training time5.6 min

Inference snippet

python
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification

model_id  = "aryasuneesh-quilr/hybrid-intent-crossencoder-minilm-L12-v2"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model     = AutoModelForSequenceClassification.from_pretrained(model_id)
model.eval()

def score(user_input: str, intent_description: str) -> float:
    pair = f"{user_input} [SEP] {intent_description}"
    enc  = tokenizer(pair, return_tensors="pt", truncation=True, max_length=256)
    with torch.no_grad():
        logits = model(**enc).logits
    return torch.softmax(logits, dim=1)[0, 1].item()   # P(match)

# Example
s = score(
    "Our AWS_SECRET_ACCESS_KEY was found in a public repo",
    "Identify exposure of authentication credentials or API keys"
)
print(f"Match probability: {s:.4f}")   # use threshold 0.8819 for best F1

Files in this repo

FileDescription
model.safetensorsHF-native weights
best_model.ptRaw PyTorch state_dict (for resuming training)
training_config.jsonFull hyperparameter record
metrics/Per-epoch + test-set evaluation CSVs

Generated 2026-02-24 10:20 UTC by ablation_reranker_training.py