leads-doctype-classifier — Auxiliary Legal Document-Type Classifier

Part of L.E.A.D.S. (Legal Education & Analytical Deep-Search). This is an auxiliary metadata tagger: it predicts a legal document's typebill, opinion, regulation, statute — from sentence embeddings.

  • Features: sentence-transformers/all-MiniLM-L6-v2 embeddings (384-d, ONNX — no torch).
  • Head: scikit-learn LogisticRegression (class_weight="balanced").
  • Training data: the PUBLIC L.E.A.D.S. legal corpus (CourtListener opinions, govinfo statutes, Federal Register / eCFR regulations, Congress bills). No PII.
  • Samples: 3137 · Features: 384-d

Metrics (honest — held-out test split + 5-fold cross-validation)

Metric Value
Held-out accuracy 0.9252
Held-out macro-F1 0.897
5-fold CV macro-F1 0.8091 ± 0.1075
class precision recall F1 test support
bill 0.929 0.929 0.929 14
opinion 0.673 0.946 0.787 37
regulation 0.945 0.922 0.933 334
statute 0.953 0.926 0.939 243

Classes excluded (too few samples, <20): docket (12), statistic (8)

Usage

import joblib, numpy as np
from huggingface_hub import hf_hub_download
from sentence_transformers import SentenceTransformer  # or any all-MiniLM-L6-v2 encoder

clf = joblib.load(hf_hub_download("lmoody68/leads-doctype-classifier", "doctype_clf.joblib"))
enc = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2")
X = enc.encode(["The debt collector shall not communicate with third parties..."])
print(clf.predict(np.asarray(X)))

⚠️ Disclaimer

This model classifies document type only. It is NOT legal advice, not a model of the law, and must never be used to answer legal questions. Trained on public legal text for educational/portfolio purposes.

Auto-generated model card. Trained 2026-06-14T18:45:53+00:00.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support