Update model card: Legal Agent Council architecture, v24 corpus stats, comprehensive overview
Browse files
README.md
CHANGED
|
@@ -10,6 +10,10 @@ tags:
|
|
| 10 |
- parental-alienation
|
| 11 |
- bert
|
| 12 |
- modernbert
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
datasets:
|
| 14 |
- Roderick3rd/OhioCustodyBERT-corpus
|
| 15 |
pipeline_tag: text-classification
|
|
@@ -17,82 +21,220 @@ pipeline_tag: text-classification
|
|
| 17 |
|
| 18 |
# OhioCustodyBERT
|
| 19 |
|
| 20 |
-
**
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
| | |
|
| 25 |
|---|---|
|
| 26 |
-
| **Base
|
| 27 |
| **Domain** | Ohio family law, child custody, parental alienation |
|
| 28 |
-
| **Training** |
|
| 29 |
-
| **
|
| 30 |
-
| **
|
| 31 |
|
| 32 |
-
|
| 33 |
|
| 34 |
-
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
|
| 41 |
-
|
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
|
| 49 |
-
|
|
| 50 |
-
|
|
| 51 |
-
|
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|---|---|---|
|
| 57 |
-
| v19 curated pairs | 916 train / 76 valid | β
Audited (77% clean) |
|
| 58 |
-
| Opinion-generated pairs (glm-5:cloud) | 480 (469/469 opinions) | β
Complete (96.6% clean) |
|
| 59 |
-
| Phase 2 strategy pairs | 177 | β
Ready |
|
| 60 |
-
| OFR report pairs (glm-5:cloud) | 115 (117 reports) | β
Complete |
|
| 61 |
-
| **Packaged total** | **1,536 train / 115 valid** | **1,651 unique pairs** |
|
| 62 |
-
|
| 63 |
-
### Cloud-Scraped Corpus (March 12, 2026)
|
| 64 |
| Source | Records | Size |
|
| 65 |
-
|---|---|---|
|
| 66 |
| Ohio Revised Code (19 chapters) | 1,034 sections | 3.0 MB |
|
| 67 |
| Ohio Administrative Code (19 divisions) | 1,283 rules | 7.3 MB |
|
| 68 |
| CourtListener opinions (OH App, SC, SCOTUS) | 259 opinions | 14 MB |
|
| 69 |
-
|
|
|
|
|
| 70 |
|
| 71 |
-
###
|
| 72 |
-
- **
|
| 73 |
-
- **
|
| 74 |
-
- **
|
| 75 |
|
| 76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
|
|
|
| 83 |
|
| 84 |
## Limitations
|
| 85 |
|
| 86 |
-
- Trained primarily on Ohio law β may not generalize to other
|
| 87 |
-
-
|
| 88 |
-
-
|
| 89 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
## Citation
|
| 92 |
|
| 93 |
```bibtex
|
| 94 |
@misc{ohiocustodybert2026,
|
| 95 |
-
title={OhioCustodyBERT: Domain-Specific Legal
|
| 96 |
author={Roderick Mullins},
|
| 97 |
year={2026},
|
| 98 |
howpublished={HuggingFace: Roderick3rd/OhioCustodyBERT}
|
|
@@ -101,6 +243,6 @@ OhioCustodyBERT is one of **4 models** in a multi-agent legal council architectu
|
|
| 101 |
|
| 102 |
## Related Resources
|
| 103 |
|
| 104 |
-
- **
|
|
|
|
| 105 |
- **Kaggle**: [ohio-legal-corpus](https://www.kaggle.com/datasets/phoenixintelligence/ohio-legal-corpus), [pa-references](https://www.kaggle.com/datasets/phoenixintelligence/pa-references)
|
| 106 |
-
- **Council Architecture**: 6 agents, 4 models, sequential swap on M4 Pro 48GB
|
|
|
|
| 10 |
- parental-alienation
|
| 11 |
- bert
|
| 12 |
- modernbert
|
| 13 |
+
- legal-agent-council
|
| 14 |
+
- multi-agent
|
| 15 |
+
- retrieval
|
| 16 |
+
- classification
|
| 17 |
datasets:
|
| 18 |
- Roderick3rd/OhioCustodyBERT-corpus
|
| 19 |
pipeline_tag: text-classification
|
|
|
|
| 21 |
|
| 22 |
# OhioCustodyBERT
|
| 23 |
|
| 24 |
+
**A domain-specific legal AI system for Ohio family law, child custody, and parental alienation.** Built from the ground up with over 13,000 curated training examples from Ohio statutes, appellate decisions, Supreme Court cases, and legal reference materials.
|
| 25 |
|
| 26 |
+
> β οΈ **This is a legal research tool, not legal advice.** Always consult a licensed attorney for legal matters.
|
| 27 |
+
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
## Why This Exists
|
| 31 |
+
|
| 32 |
+
The Ohio family court system processes thousands of custody cases annually. Parents β especially pro se litigants β face a legal system built on decades of case law, statutes, and procedural rules that are nearly impossible to navigate without expensive legal counsel.
|
| 33 |
+
|
| 34 |
+
**OhioCustodyBERT aims to democratize access to Ohio family law knowledge** by providing AI models trained specifically on:
|
| 35 |
+
- Ohio Revised Code (ORC) Chapter 3109 and related family law statutes
|
| 36 |
+
- Ohio Administrative Code (OAC) custody and child welfare rules
|
| 37 |
+
- Appellate court decisions on custody, parental alienation, and visitation
|
| 38 |
+
- US Supreme Court precedent on parental rights (Santosky, Stanley, Troxel)
|
| 39 |
+
- Ohio Supreme Court reports, bench cards, and practice guides
|
| 40 |
+
|
| 41 |
+
---
|
| 42 |
+
|
| 43 |
+
## The Legal Agent Council
|
| 44 |
+
|
| 45 |
+
OhioCustodyBERT is not a single model β it's a **multi-agent legal reasoning system** where specialized AI models work together to provide comprehensive legal analysis. Each model is fine-tuned on the same curated Ohio family law corpus, but serves a different role.
|
| 46 |
+
|
| 47 |
+
### Architecture
|
| 48 |
+
|
| 49 |
+
```
|
| 50 |
+
User Query
|
| 51 |
+
β
|
| 52 |
+
βΌ
|
| 53 |
+
βββββββββββββββββββββββββββββββ
|
| 54 |
+
β β BERT Retriever β β OhioCustodyBERT (this model)
|
| 55 |
+
β Finds relevant statutes, β ModernBERT-base, 149.7M params
|
| 56 |
+
β case law, and rules β
|
| 57 |
+
ββββββββββββ¬βββββββββββββββββββ
|
| 58 |
+
β Retrieved context
|
| 59 |
+
βΌ
|
| 60 |
+
βββββββββββββββββββββββββββββββ
|
| 61 |
+
β β‘ Statute Agent β β OhioCustodyBERT-Qwen3.5-9B (LoRA)
|
| 62 |
+
β "What does the law say?" β Analyzes applicable statutes
|
| 63 |
+
βββββββββββββββββββββββββββββββ€
|
| 64 |
+
β β’ Case Law Agent β β Same base, different prompt
|
| 65 |
+
β "What have courts held?" β Finds binding precedent
|
| 66 |
+
βββββββββββββββββββββββββββββββ€
|
| 67 |
+
β β£ Procedure Agent β β Qwen3-30B-A3B (MoE, planned)
|
| 68 |
+
β "Was due process followed?"β Procedural compliance check
|
| 69 |
+
βββββββββββββββββββββββββββββββ€
|
| 70 |
+
β β€ Adversary Agent β β OhioCustodyBERT-Qwen3.5-9B (LoRA)
|
| 71 |
+
β "What's the other side?" β Steel-mans the opposition
|
| 72 |
+
ββββββββββββ¬βββββββββββββββββββ
|
| 73 |
+
β All analyses
|
| 74 |
+
βΌ
|
| 75 |
+
βββββββββββββββββββββββββββββββ
|
| 76 |
+
β β₯ Synthesis Judge β β QwQ-32B (deep reasoning)
|
| 77 |
+
β Weighs all perspectives, β Produces final analysis with
|
| 78 |
+
β resolves conflicts β confidence scoring
|
| 79 |
+
ββββββββββββ¬βββββββββββββββββββ
|
| 80 |
+
β Final analysis
|
| 81 |
+
βΌ
|
| 82 |
+
βββββββββββββββββββββββββββββββ
|
| 83 |
+
β β¦ BERT Verifier β β OhioCustodyBERT (this model)
|
| 84 |
+
β Fact-checks citations, β Catches hallucinated case law
|
| 85 |
+
β validates statute refs β and incorrect statute numbers
|
| 86 |
+
βββββββββββββββββββββββββββββββ
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
### Why Multiple Models?
|
| 90 |
+
|
| 91 |
+
**Same data, different architectures = meaningful consensus.** When all models agree on a legal analysis, confidence is high. When they disagree, the disagreement reveals where the law is ambiguous or the facts need closer examination β which is exactly what a good lawyer would identify.
|
| 92 |
+
|
| 93 |
+
---
|
| 94 |
+
|
| 95 |
+
## Models in This System
|
| 96 |
+
|
| 97 |
+
| Model | HuggingFace | Role | Architecture |
|
| 98 |
+
|-------|-------------|------|-------------|
|
| 99 |
+
| **OhioCustodyBERT** | [This repo](https://huggingface.co/Roderick3rd/OhioCustodyBERT) | Retriever + Verifier | ModernBERT-base (149.7M) |
|
| 100 |
+
| **OhioCustodyBERT-Qwen3.5-9B** | [Adapter repo](https://huggingface.co/Roderick3rd/OhioCustodyBERT-Qwen3.5-9B) | Generative Agents | Qwen3.5-9B + LoRA |
|
| 101 |
+
| **Training Corpus** | [Dataset](https://huggingface.co/datasets/Roderick3rd/OhioCustodyBERT-corpus) | All training data | 13,346 SFT pairs + raw corpus |
|
| 102 |
+
|
| 103 |
+
---
|
| 104 |
+
|
| 105 |
+
## This Model: ModernBERT Retriever + Verifier
|
| 106 |
+
|
| 107 |
+
### What It Does
|
| 108 |
+
- **Semantic retrieval**: Find the most relevant statutes, rules, and case law for a given legal question
|
| 109 |
+
- **Classification**: Identify legal issues (custody type, parental alienation indicators, due process violations)
|
| 110 |
+
- **NER**: Extract legal entities (judge names, case citations, statute references)
|
| 111 |
+
- **Citation verification**: Validate that LLM-generated citations point to real cases and statutes
|
| 112 |
+
|
| 113 |
+
### Model Details
|
| 114 |
|
| 115 |
| | |
|
| 116 |
|---|---|
|
| 117 |
+
| **Base** | ModernBERT-base (149.7M params) |
|
| 118 |
| **Domain** | Ohio family law, child custody, parental alienation |
|
| 119 |
+
| **Training** | Masked Language Modeling on curated Ohio legal corpus |
|
| 120 |
+
| **Version** | v0.1 (v0.2 training in progress β full corpus) |
|
| 121 |
+
| **License** | Apache 2.0 |
|
| 122 |
|
| 123 |
+
---
|
| 124 |
|
| 125 |
+
## Training Corpus (v24 β March 2026)
|
| 126 |
|
| 127 |
+
All models in the Legal Agent Council are trained on the same curated corpus:
|
| 128 |
+
|
| 129 |
+
### SFT Training Data β 13,346 unique pairs
|
| 130 |
+
|
| 131 |
+
| Source | Pairs | Description |
|
| 132 |
+
|--------|-------|-------------|
|
| 133 |
+
| Ohio Revised Code | 4,145 | R.C. 3109, 2919, 2151, 3111, 3127, 3105 β statutes on custody, DV, juvenile, paternity, UCCJEA, divorce |
|
| 134 |
+
| Ohio Administrative Code | 3,849 | OAC rules on child welfare, custody evaluation, court procedures |
|
| 135 |
+
| Curated Q&A | 2,288 | Hand-audited pairs from opinion analysis, case strategy, verified datasets |
|
| 136 |
+
| CourtListener opinions | 1,374 | Ohio appellate court custody and family law decisions |
|
| 137 |
+
| Reference materials | 732 | Ohio SC task force reports, bench cards, GAL guides, custody evaluator toolkit |
|
| 138 |
+
| Targeted opinions | 560 | Ohio appellate, Ohio SC, and SCOTUS parental rights decisions |
|
| 139 |
+
| Sperm donor cases | 154 | R.C. 3111 paternity and donor rights case law |
|
| 140 |
+
| OhioFamilyRights | 113 | Family law reform advocacy, legislative testimony, case analyses |
|
| 141 |
+
| Juvenile court | 75 | Juvenile court procedures and delinquency |
|
| 142 |
+
| Gemini-generated | 56 | Cloud-generated Q&A from corpus documents |
|
| 143 |
+
|
| 144 |
+
**Generators**: Gemini 2.5 Flash, qwen3-coder:480b, Ollama local models, manual curation
|
| 145 |
+
|
| 146 |
+
### Raw Corpus
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
| Source | Records | Size |
|
| 148 |
+
|--------|---------|------|
|
| 149 |
| Ohio Revised Code (19 chapters) | 1,034 sections | 3.0 MB |
|
| 150 |
| Ohio Administrative Code (19 divisions) | 1,283 rules | 7.3 MB |
|
| 151 |
| CourtListener opinions (OH App, SC, SCOTUS) | 259 opinions | 14 MB |
|
| 152 |
+
| Reference materials | 941 records | 4.0 MB |
|
| 153 |
+
| Parental alienation research | 55 papers | β |
|
| 154 |
|
| 155 |
+
### Key Cases Covered
|
| 156 |
+
- **SCOTUS**: Santosky v. Kramer, Stanley v. Illinois, Troxel v. Granville, Michael H. v. Gerald D., Lehr v. Robertson
|
| 157 |
+
- **Ohio SC**: In re Murray, In re Bonfield, Shearer v. Shearer, Felton, Davis v. Flickinger
|
| 158 |
+
- **Topics**: Best interest standard (R.C. 3109.04), shared parenting, parental alienation, GAL standards, custody evaluation, DV protective orders, contempt, UCCJEA jurisdiction
|
| 159 |
|
| 160 |
+
---
|
| 161 |
+
|
| 162 |
+
## Quick Start
|
| 163 |
+
|
| 164 |
+
### Using This Model (ModernBERT β Retrieval/Classification)
|
| 165 |
+
|
| 166 |
+
```python
|
| 167 |
+
from transformers import AutoModel, AutoTokenizer
|
| 168 |
+
|
| 169 |
+
model = AutoModel.from_pretrained("Roderick3rd/OhioCustodyBERT")
|
| 170 |
+
tokenizer = AutoTokenizer.from_pretrained("Roderick3rd/OhioCustodyBERT")
|
| 171 |
+
|
| 172 |
+
# Encode legal text for semantic search
|
| 173 |
+
text = "What factors does R.C. 3109.04 consider for shared parenting?"
|
| 174 |
+
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
|
| 175 |
+
outputs = model(**inputs)
|
| 176 |
+
embeddings = outputs.last_hidden_state.mean(dim=1)
|
| 177 |
+
```
|
| 178 |
+
|
| 179 |
+
### Using the Generative Model (Qwen3.5-9B β Legal Analysis)
|
| 180 |
+
|
| 181 |
+
```python
|
| 182 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 183 |
+
from peft import PeftModel
|
| 184 |
+
|
| 185 |
+
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-9B")
|
| 186 |
+
model = PeftModel.from_pretrained(base, "Roderick3rd/OhioCustodyBERT-Qwen3.5-9B")
|
| 187 |
+
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3.5-9B")
|
| 188 |
+
```
|
| 189 |
+
|
| 190 |
+
### Using via Ollama (Easiest)
|
| 191 |
|
| 192 |
+
```bash
|
| 193 |
+
ollama run ohio-custody
|
| 194 |
+
>>> What are the best interest factors under R.C. 3109.04?
|
| 195 |
+
```
|
| 196 |
+
|
| 197 |
+
---
|
| 198 |
|
| 199 |
## Limitations
|
| 200 |
|
| 201 |
+
- **Ohio-specific**: Trained primarily on Ohio law β may not generalize to other states
|
| 202 |
+
- **Not legal advice**: This is a research tool, not a substitute for a licensed attorney
|
| 203 |
+
- **v0.1**: Current model trained on limited examples; v0.2 will substantially improve quality
|
| 204 |
+
- **Case law currency**: Training data has a cutoff; recent decisions may not be reflected
|
| 205 |
+
- **Classification bias**: Reflects the Ohio statutory framework (R.C. 3109.04 best interest factors)
|
| 206 |
+
|
| 207 |
+
---
|
| 208 |
+
|
| 209 |
+
## Intended Use
|
| 210 |
+
|
| 211 |
+
| Use Case | β
Appropriate | β Not Appropriate |
|
| 212 |
+
|----------|---------------|-------------------|
|
| 213 |
+
| Legal research | Identifying relevant statutes and cases | Generating court filings |
|
| 214 |
+
| Case preparation | Understanding legal standards and precedent | Making custody recommendations |
|
| 215 |
+
| Education | Learning Ohio family law framework | Replacing legal counsel |
|
| 216 |
+
| Citation checking | Verifying case law references | Autonomous legal decision-making |
|
| 217 |
+
|
| 218 |
+
---
|
| 219 |
+
|
| 220 |
+
## Project Status
|
| 221 |
+
|
| 222 |
+
| Component | Status | Notes |
|
| 223 |
+
|-----------|--------|-------|
|
| 224 |
+
| ModernBERT v0.1 | β
Live | 149.7M params, 864 examples |
|
| 225 |
+
| ModernBERT v0.2 | π Training | Full corpus MLM retraining |
|
| 226 |
+
| Qwen3.5-9B LoRA | π Training | 13,346 pairs, MLX on M4 Pro 48GB |
|
| 227 |
+
| v24 Corpus | β
Complete | 13,346 pairs from 19 sources |
|
| 228 |
+
| Legal Agent Council | π In Development | 6-agent pipeline, sequential model swap |
|
| 229 |
+
| Kaggle Datasets | β
Published | `ohio-legal-corpus`, `pa-references`, `ohio-custody-sft-v21` |
|
| 230 |
+
|
| 231 |
+
---
|
| 232 |
|
| 233 |
## Citation
|
| 234 |
|
| 235 |
```bibtex
|
| 236 |
@misc{ohiocustodybert2026,
|
| 237 |
+
title={OhioCustodyBERT: Domain-Specific Legal AI System for Ohio Family Law},
|
| 238 |
author={Roderick Mullins},
|
| 239 |
year={2026},
|
| 240 |
howpublished={HuggingFace: Roderick3rd/OhioCustodyBERT}
|
|
|
|
| 243 |
|
| 244 |
## Related Resources
|
| 245 |
|
| 246 |
+
- **Generative Model**: [OhioCustodyBERT-Qwen3.5-9B](https://huggingface.co/Roderick3rd/OhioCustodyBERT-Qwen3.5-9B) β LoRA adapter for legal analysis generation
|
| 247 |
+
- **Training Corpus**: [OhioCustodyBERT-corpus](https://huggingface.co/datasets/Roderick3rd/OhioCustodyBERT-corpus) β Full dataset with SFT pairs
|
| 248 |
- **Kaggle**: [ohio-legal-corpus](https://www.kaggle.com/datasets/phoenixintelligence/ohio-legal-corpus), [pa-references](https://www.kaggle.com/datasets/phoenixintelligence/pa-references)
|
|
|