File size: 1,167 Bytes
1d4802c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
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-Opacity

A ModernBERT regression model that scores local-ordinance text along the
**Opacity** axis of the LOCUS (Local Ordinances Corpus, United States) dataset.

Fine-tuned from [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base). The
target is a TrueSkill `mu` distilled from pairwise LLM comparisons on the
opacity axis, then z-score normalized across the training corpus.

## Usage

```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

tok = AutoTokenizer.from_pretrained("LocalLaws/LOCUS-Opacity")
model = AutoModelForSequenceClassification.from_pretrained("LocalLaws/LOCUS-Opacity")
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)
```