File size: 2,775 Bytes
8c2b9c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: law2code
emoji: ⚖️
colorFrom: blue
colorTo: indigo
sdk: static
pinned: false
models:
  - MudraForge/law2code-tax-t1-encoder
  - MudraForge/law2code-corporate-f1-encoder
  - MudraForge/law2code-parser-stages-v1
datasets:
  - MudraForge/law2code-corporate-f1-corpus
---

# ⚖️ law2code: MudraForge Statutory AST & Catala Studio

Translates raw statutory text into formal, deterministic **Catala Abstract Syntax Trees (AST)** and executable specifications.

## Hosted MudraForge Models & Checkpoints
- **Domain Backbone Encoders**:
  - [`MudraForge/law2code-tax-t1-encoder`](https://huggingface.co/MudraForge/law2code-tax-t1-encoder): 4.43M parameter transformer backbone (16,384 vocabulary) specialized for direct tax, TDS, and US Internal Revenue Code.
  - [`MudraForge/law2code-corporate-f1-encoder`](https://huggingface.co/MudraForge/law2code-corporate-f1-encoder): 4.95M parameter transformer backbone (20,480 vocabulary) specialized for commercial restructuring, slump sale (50B), and MSMED Act delayed payments (43B(h)).
  - Both encoders exported to ONNX (Opset 17) and verified in PyTorch with float32 maximum numerical drift <= 2.62e-06.
- **Downstream Neural Parser Stack**:
  - [`MudraForge/law2code-parser-stages-v1`](https://huggingface.co/MudraForge/law2code-parser-stages-v1): 15.93M parameter 4-stage neural pipeline:
    - Stage 1 Non-Operands Tree Encoder (4.62M params)
    - Stage 1.5 Catala Operands Tree Pointer & Leaf Classifier (6.26M params)
    - Stage 2 Clause Factorizer & Dynamic Refiner (4.58M params + 0.47M Stage 2B)
    - Stage 3 Reflexion Repair Engine for conformal uncertainty and invariant compliance
- **Pretraining & Evaluation Corpus**:
  - [`MudraForge/law2code-corporate-f1-corpus`](https://huggingface.co/datasets/MudraForge/law2code-corporate-f1-corpus): 26,674 provisions, 4,538,061 tokens, across 172 authoritative statutory sources with 0-drift character offset alignments.

## Core Capabilities
- **Deterministic AST Compilation**: Eliminates ambiguous textual statutory math by factorizing legal text into formal scopes, conditional gates, exception overrides, and rule effects.
- **Inria / Stanford Catala Specification**: Generates `.catala_en` literate source code conforming to the Catala default logic paradigm.
- **Statutory Invariant Verification**: Permanently enforces `isAuthorizedToDisburse: false` (statutory calculation never autonomously disburses funds).
- **Interactive Rule Handles & Dynamic Simulation**: Adjust statutory variables (taxable income, payments, deduction limits) to observe dynamic branch selection and effect calculation in real time.
- **LLM Battle Mode**: Side-by-side verification comparing deterministic AST output against standard zero-shot monolithic LLM hallucinations.