Roderick3rd commited on
Commit
0d062bf
Β·
verified Β·
1 Parent(s): 8b7fb56

Update model card: Legal Agent Council architecture, v24 corpus stats, comprehensive overview

Browse files
Files changed (1) hide show
  1. README.md +197 -55
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
- **Ohio Family Law & Custody Specialist** β€” Fine-tuned ModernBERT for Ohio family law, child custody, and parental alienation analysis.
21
 
22
- ## Model Overview
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  | | |
25
  |---|---|
26
- | **Base Model** | ModernBERT-base (149.7M params) |
27
  | **Domain** | Ohio family law, child custody, parental alienation |
28
- | **Training** | Kaggle 2Γ—T4, 864 examples, 3 epochs, bf16 |
29
- | **Loss** | 1.01 β†’ 0.84 (final eval: 0.91) |
30
- | **Version** | v0.1 (v0.2 in progress) |
31
 
32
- ## Part of the Legal Agent Council
33
 
34
- OhioCustodyBERT is one of **4 models** in a multi-agent legal council architecture. All models are fine-tuned on the **identical curated Ohio family law corpus**, enabling consensus-based legal analysis where different architectures cross-validate each other.
35
 
36
- | Model | Role in Council |
37
- |---|---|
38
- | **OhioCustodyBERT** ← this model | Retriever + Verifier (classification, NER, fact-checking) |
39
- | Qwen3.5-9B (LoRA) | Specialist Agents (statute, case law, adversary) |
40
- | Qwen3-30B-A3B (LoRA) | Procedure Agent (sparse expert routing) |
41
- | Qwen3.5-27B-Claude-Opus-Distilled (Q8_0) | Synthesis Judge (Claude reasoning distilled, 28 GB) |
42
-
43
- **Principle**: Same data, different architectures = meaningful consensus. When all 4 models agree, confidence is high. When they disagree, the disagreement reveals where the law is ambiguous or the facts need closer examination.
44
-
45
- ## Training Corpus (v0.2 β€” March 2026)
46
-
47
- ### Court Opinions β€” 469 deduplicated, full-text opinions (14.9 MB)
48
- | Source | Count | Key Cases |
49
- |---|---|---|
50
- | Ohio Court of Appeals | 149 | PA, custody, GAL, DV, contempt, visitation |
51
- | Ohio Supreme Court | 199 | Shearer, Felton, In re Murray, In re Bonfield |
52
- | US Supreme Court | 121 | Santosky v. Kramer, Stanley v. Illinois, Troxel v. Granville |
53
-
54
- ### SFT Training Data (audited March 12, 2026)
55
- | Dataset | Records | Status |
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
- | **Total corpus** | **2,576 records** | **24.3 MB** |
 
70
 
71
- ### Reference Materials
72
- - **941 records (4.0 MB)**: Black's Law Dictionary (591), OH Task Force on Family Law, Custody Evaluator Toolkit, GAL Task Force, Parenting Time Guide
73
- - **ORC Family Law (323 records, 1.2 MB)**: Β§3109, Β§2919, Β§2151, Β§3111, Β§3127, Β§3105
74
- - **55 PA references**: Academic papers, case analyses, legal guides
75
 
76
- ## Intended Use
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
 
78
- - **Classification**: Custody outcome prediction, legal issue spotting
79
- - **NER**: Legal entity recognition (judges, statutes, case names)
80
- - **Retrieval**: Semantic search over Ohio family law corpus
81
- - **Fact-checking**: Citation verification for LLM-generated legal text
82
- - **Council agent**: BERT Retriever + Verifier roles in Legal Agent Council
 
83
 
84
  ## Limitations
85
 
86
- - Trained primarily on Ohio law β€” may not generalize to other jurisdictions
87
- - v0.1 had limited training examples (864); v0.2 will substantially expand this
88
- - Not a substitute for legal counsel
89
- - Classification boundaries reflect Ohio statutory framework (R.C. 3109.04)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
 
91
  ## Citation
92
 
93
  ```bibtex
94
  @misc{ohiocustodybert2026,
95
- title={OhioCustodyBERT: Domain-Specific Legal Language Model for Ohio Family Law},
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
- - **Corpus**: [Roderick3rd/OhioCustodyBERT-corpus](https://huggingface.co/datasets/Roderick3rd/OhioCustodyBERT-corpus)
 
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)