denispeskoff commited on
Commit
f753ae4
·
verified ·
1 Parent(s): 3a99a72

Upload LOCUS-Fines dataset

Browse files
Files changed (2) hide show
  1. README.md +119 -0
  2. locus_fines_supplement.parquet +3 -0
README.md ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ pretty_name: LOCUS-Fines
4
+ language:
5
+ - en
6
+ size_categories:
7
+ - 1M<n<10M
8
+ task_categories:
9
+ - text-classification
10
+ source_datasets:
11
+ - LocalLaws/LOCUS-v1
12
+ tags:
13
+ - legal
14
+ - law
15
+ - us-local-law
16
+ - ordinances
17
+ - fines
18
+ - penalties
19
+ - locus
20
+ configs:
21
+ - config_name: default
22
+ data_files:
23
+ - split: train
24
+ path: locus_fines_supplement.parquet
25
+ ---
26
+
27
+ # LOCUS-Fines
28
+
29
+ A fine-grained fines layer for
30
+ [LOCUS](https://huggingface.co/datasets/LocalLaws/LOCUS-v1), the Local
31
+ Ordinance Corpus for the United States. We annotate roughly 600,000 rows with
32
+ detailed information about fines.
33
+
34
+ We use `gemini-3.5-flash-lite` for the annotations. Every dollar amount is
35
+ checked against the original text to reduce hallucinations. Rarely, a number
36
+ referring to something else, such as a number of months, may be miscategorized
37
+ as a fine.
38
+
39
+ ## `annotation_source`
40
+
41
+ | value | rows | meaning |
42
+ |---|---|---|
43
+ | `LLM` | 632,005 | annotated by the model |
44
+ | `unchanged_LOCUS` | 1,579,511 | not sent to the model; derived from LOCUS fields |
45
+
46
+ Consumers who want only model-read rows can filter `annotation_source ==
47
+ "LLM"`; those who want a corpus-complete view use all rows.
48
+
49
+ ## Schema
50
+
51
+ | column | type | description |
52
+ |---|---|---|
53
+ | `state`, `source_jurisdiction_type`, `city`, `county` | string | jurisdiction identity, verbatim from LOCUS-v1 |
54
+ | `function`, `header` | string | section identity within the code, verbatim from LOCUS-v1 |
55
+ | `content_sha1` | string | 16-hex fingerprint of the section text (join key; see below) |
56
+ | `fine_relevant` | bool | the section states, references, or implies a monetary penalty |
57
+ | `penalty_scope` | enum/null | `code_general` (code-wide catch-all), `chapter_general` (chapter/article catch-all), `specific` (particular conduct); `null` when the section states no penalty of its own |
58
+ | `penalty_stated` | enum/null | `amounts_here` (penalty stated in this text), `cross_reference` (points elsewhere, e.g. "Penalty, see § 1-8"), `implicit` (conduct prohibited, no penalty mentioned) |
59
+ | `fine_structure` | enum/null | `fixed` (one flat amount) or `fluid` (maximum, range, discretion, or escalation) |
60
+ | `fixed_amount` | float/null | the flat amount when `fine_structure = "fixed"` |
61
+ | `min_amount`, `max_amount` | float/null | smallest / largest amount stated as a penalty ("not less than" / "not to exceed") |
62
+ | `first_violation_amount`, `second_violation_amount`, `subsequent_violation_amount` | float/null | amounts tied to offense counts |
63
+ | `effective_min`, `effective_max` | float/null | min / max across all six amount fields; the section's true penalty span (rolls tiered amounts into the range) |
64
+ | `per_day_violation` | bool | text explicitly makes each day a separate violation |
65
+ | `jail_mentioned` | bool | imprisonment stated as a penalty or alternative |
66
+ | `penalty_nature` | enum/null | `criminal`, `civil`, or `both` |
67
+ | `extraction_flag` | string/null | edge cases (`fragment_incomplete`, `table_fragment`, `not_ordinance_text`); `null` = an ordinary, complete section |
68
+ | `grounded` | bool/null | `false` when at least one amount field could not be found in the section's text and was removed; `null` on rule-derived rows |
69
+ | `annotation_source` | enum | provenance of the row: `LLM` or `unchanged_LOCUS` (see the provenance table above) |
70
+
71
+ **Invariant:** `penalty_scope` is always `null` when `penalty_stated =
72
+ "implicit"`; a section that states no penalty has no penalty scope.
73
+
74
+ ## Joining back to LOCUS-v1
75
+
76
+ The text is not duplicated here. Re-attach it by recomputing the same
77
+ fingerprint on LOCUS-v1 and joining on the seven identity columns:
78
+
79
+ ```python
80
+ import hashlib
81
+ import pandas as pd
82
+ from datasets import load_dataset
83
+
84
+ locus = load_dataset("LocalLaws/LOCUS-v1", split="train").to_pandas()
85
+ fines = load_dataset("LocalLaws/LOCUS-Fines", split="train").to_pandas()
86
+
87
+ locus["content_sha1"] = [hashlib.sha1(c.encode()).hexdigest()[:16]
88
+ for c in locus["content"]]
89
+ keys = ["state", "source_jurisdiction_type", "city", "county",
90
+ "function", "header", "content_sha1"]
91
+ merged = locus.merge(fines, on=keys, how="left") # 1:1, no fan-out
92
+ ```
93
+
94
+ The `content_sha1` term makes the join exact even where different sections
95
+ share a heading.
96
+
97
+ ## Limitations
98
+
99
+ - Model annotations reflect a single, cost-efficient model at temperature 0.
100
+ Dollar amounts are verified against the source; the non-amount fields
101
+ (`penalty_scope`, `penalty_stated`, `fine_structure`,
102
+ `penalty_nature`, `fine_relevant`) are **not** independently verified and
103
+ have not been human-reviewed at scale. Treat `grounded = false` and
104
+ non-null `extraction_flag` rows with extra caution.
105
+ - Grounding covers *amount* fields only. It catches unverifiable or
106
+ wrong-unit dollar figures, but does not check the categorical judgments.
107
+ - Sections chunked across multiple LOCUS rows are annotated per row; a
108
+ penalty schedule split across chunks may be partially captured in each.
109
+ - Rule-derived rows (`annotation_source = "unchanged_LOCUS"`) carry no
110
+ amounts by construction.
111
+ - Boilerplate ordinance language repeats across jurisdictions, so counts of
112
+ "N sections do X" overstate independent policy choices.
113
+
114
+ ## Citation
115
+
116
+ Built on and intended as a companion to LOCUS-v1. Please cite the LOCUS
117
+ corpus (see [LocalLaws/LOCUS-v1](https://huggingface.co/datasets/LocalLaws/LOCUS-v1))
118
+ alongside this supplement.
119
+
locus_fines_supplement.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ea48b61f040645053f5d037f6dac33de97dbcc243c5898ec3b753db4b39fe2c7
3
+ size 86878441