Text Classification
Transformers
Safetensors
modernbert
regression
legal
locus
text-embeddings-inference
Instructions to use LocalLaws/LOCUS-Enforcement-Discretion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LocalLaws/LOCUS-Enforcement-Discretion with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="LocalLaws/LOCUS-Enforcement-Discretion")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("LocalLaws/LOCUS-Enforcement-Discretion") model = AutoModelForSequenceClassification.from_pretrained("LocalLaws/LOCUS-Enforcement-Discretion", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from LocalLaws/LOCUS-Enforcement-Discretion: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/LocalLaws/LOCUS-Enforcement-Discretion/resolve/main/README.md
- Command line
-
hf download hf://LocalLaws/LOCUS-Enforcement-Discretion/README.md
-
curl -L -o README.md https://huggingface.co/LocalLaws/LOCUS-Enforcement-Discretion/resolve/main/README.md
1.24 kB
metadata
base_model: answerdotai/ModernBERT-base
library_name: transformers
pipeline_tag: text-classification
tags:
- text-classification
- regression
- legal
- locus
- modernbert
license: apache-2.0
datasets:
- LocalLaws/LOCUS-v1.0
LocalLaws/LOCUS-Enforcement-Discretion
A ModernBERT regression model that scores local-ordinance text along the Enforcement Discretion axis of the LOCUS (Local Ordinances Corpus, United States) dataset.
Fine-tuned from answerdotai/ModernBERT-base. The
target is a TrueSkill mu distilled from pairwise LLM comparisons on the
enforcement discretion axis, then z-score normalized across the training corpus.
Usage
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
tok = AutoTokenizer.from_pretrained("LocalLaws/LOCUS-Enforcement-Discretion")
model = AutoModelForSequenceClassification.from_pretrained("LocalLaws/LOCUS-Enforcement-Discretion")
model.eval()
text = "No person shall keep any swine within the city limits."
enc = tok(text, return_tensors="pt", truncation=True, max_length=2048)
with torch.no_grad():
score = model(**enc).logits.squeeze(-1).item()
print(score)