File size: 9,277 Bytes
2e511b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# How to publish LEGEX to Hugging Face anonymously

This walkthrough takes the contents of `submission/` and publishes **three
public Hugging Face dataset repositories** under the anonymous account
`legexbenchmark`:

1. **`legexbenchmark/goldensets`** — expert-coded gold annotations
   (19 jurisdictions, 1,548 judgments / 1,974 rows incl. secondary
   re-annotations).
2. **`legexbenchmark/inference-results`** — Harvey (2 runs) / Gemini / GPT /
   Legora (2 runs) outputs (19 jurisdictions × 6 runs = 114 files, JSONL)
   plus the per-column prompts of the commercial runs (`prompts/`, 4 files).
3. **`legexbenchmark/code`** — Python pipeline (scrape → process → infer →
   clean → evaluate).

> **All data files are JSONL** (one JSON object per line). Inference was CSV
> in the first release and is now JSONL — see *Updating an existing release*
> below.

---

## 0. Updating an existing release (goldensets + inference-results)

The three repos already exist, and local clones live in
`../hf-uploads/{goldensets,inference-results,code}`. The staged bundle
(`submission/goldensets/`, `submission/inference-results/`) mirrors the two
data repos 1:1: data + the per-repo dataset card (`README.md`).

Rebuild the bundle only if the underlying data changed
(`convert_goldenset_to_jsonl.py` needs the local-only
`data/reannotation/annotators.json` + `ANNOTATOR_SALT` from `.env`):

```bash
uv run python submission/convert_goldenset_to_jsonl.py --data-dir data --out-dir submission/goldensets/data
(cd submission && uv run python build_inference_jsonl.py --data-dir ../data --gold-dir goldensets/data --out-dir inference-results/data)
```

When the working trees in `../hf-uploads/` are already synced from
`submission/` (data + README copied in, stale CSVs removed), pushing the
update is:

```bash
# Log in once with the anonymous account's WRITE token.
pip install --upgrade huggingface_hub && git lfs install --skip-repo
huggingface-cli login                 # paste the hf_… write token
huggingface-cli whoami                # must print: legexbenchmark

# --- goldensets ---
cd ../hf-uploads/goldensets
git status && git diff --stat         # review: data/<cc>/*.jsonl + README.md
git config user.name anonymous && git config user.email anonymous@anonymous.invalid
git add -A
git commit -m "Update: re-annotations, Nepal/Singapore extensions, traceability fields, refreshed card"
git push
cd -

# --- inference-results (CSV -> JSONL) ---
cd ../hf-uploads/inference-results
git status                            # review: CSVs deleted, 57 JSONL added, README.md, .gitattributes
git config user.name anonymous && git config user.email anonymous@anonymous.invalid
git add -A
git commit -m "Switch inference to JSONL; 19 jurisdictions; cleaning provenance; refreshed card"
git push
cd -
```

Then **verify usability** (the old CSV raised `ArrowInvalid`):

```python
from datasets import load_dataset
load_dataset("legexbenchmark/goldensets", split="brazil")
load_dataset("legexbenchmark/inference-results", "harvey", split="united_states")
load_dataset("legexbenchmark/inference-results", "gpt", split="switzerland")
```

Also confirm on the web UI that every commit author reads **`anonymous`**, the
dataset viewer renders both repos, and no `inference_*.csv` remain in
`inference-results`.

**`code`** is updated separately once the cleaned analysis package is staged —
see item 3 of [CHANGES_SINCE_SUBMISSION.md](CHANGES_SINCE_SUBMISSION.md).

---

## 1. Create the anonymous Hugging Face account (once)

1. Open a private / incognito browser window so cookies from any existing
   HF account are isolated.
2. Visit <https://huggingface.co/join>.
3. Sign up with a **fresh email address** that is not tied to any of the
   authors (a `proton.me` / `tutanota.com` mailbox works fine).
4. Pick the username **`legexbenchmark`** so the public URLs match the
   names used in the paper.
5. Verify the email and log in.

> **Why a fresh account?** HF attaches your account's display name, avatar
> and email to commits in each repo's history. Reusing an existing account
> would leak your identity even if every file in the repo is clean.

## 2. Create a write-scoped access token (once)

1. Visit <https://huggingface.co/settings/tokens>.
2. Click **New token**, name it `upload`, role **Write**, click **Generate
   token**, copy the value (it starts with `hf_`).

## 3. Install the tooling and log in (once)

```bash
pip install --upgrade huggingface_hub
git lfs install --skip-repo   # macOS: brew install git-lfs first

# Paste the write token created in step 2 when prompted.
huggingface-cli login
```

## 4. Push the three repositories (initial release)

Run steps 4a → 4c **in order**. Each step is independent — if something
breaks in 4b you can fix it without redoing 4a.

### 4a. Push `legexbenchmark/goldensets`

```bash
# 1. Create the empty repo via the web UI:
#    https://huggingface.co/new-dataset
#    Owner: legexbenchmark | Name: goldensets | License: MIT | Public

# 2. Clone, anonymise local git, copy in the staged files.
git clone https://huggingface.co/datasets/legexbenchmark/goldensets hf-goldensets
cd hf-goldensets
git config user.name  "anonymous"
git config user.email "anonymous@anonymous.invalid"
git lfs track "*.jsonl"
git add .gitattributes

cp -R ../submission/goldensets/. .

# 3. Commit and push.
git add .
git commit -m "Initial release"
git push -u origin main
cd ..
```

Open <https://huggingface.co/datasets/legexbenchmark/goldensets>. Verify:

- The dataset card renders with the jurisdiction tables.
- `data/<cc>/goldenset_<cc>.jsonl` is browsable for all 19 jurisdictions.
- The author next to every commit is **`anonymous`**.

### 4b. Push `legexbenchmark/inference-results`

```bash
# 1. Create the empty repo:
#    https://huggingface.co/new-dataset
#    Owner: legexbenchmark | Name: inference-results | License: MIT | Public

# 2. Clone, anonymise, copy in.
git clone https://huggingface.co/datasets/legexbenchmark/inference-results hf-inference
cd hf-inference
git config user.name  "anonymous"
git config user.email "anonymous@anonymous.invalid"
git lfs track "*.jsonl"
git add .gitattributes

cp -R ../submission/inference-results/. .

# 3. Commit and push.
git add .
git commit -m "Initial release"
git push -u origin main
cd ..
```

Verify on <https://huggingface.co/datasets/legexbenchmark/inference-results>:

- 19 `data/<cc>/` folders (all jurisdictions).
- Each folder has `inference_harvey.jsonl`, `inference_gemini.jsonl`,
  `inference_gpt.jsonl` (no `.csv`).

### 4c. Push `legexbenchmark/code`

```bash
# 1. Create the empty repo:
#    https://huggingface.co/new-dataset
#    Owner: legexbenchmark | Name: code | License: MIT | Public
#    (HF dataset repos accept arbitrary files — we use "dataset" type as
#    the most permissive container for source code.)

# 2. Clone, anonymise, copy in the cleaned package (see
#    CHANGES_SINCE_SUBMISSION.md item 3 for what goes into the code repo).
git clone https://huggingface.co/datasets/legexbenchmark/code hf-code
cd hf-code
git config user.name  "anonymous"
git config user.email "anonymous@anonymous.invalid"

# 3. Commit and push.
git add .
git commit -m "Initial release"
git push -u origin main
cd ..
```

Verify on <https://huggingface.co/datasets/legexbenchmark/code>:

- The repo card lists the CLI entrypoints and the workflow.
- `legex/scrapers/` contains 19 jurisdiction modules.

## 5. Cross-verify the org page

Open <https://huggingface.co/legexbenchmark> in a fresh tab — you should
see three pinned datasets. Click each card and confirm:

- The README renders correctly.
- The "Files and versions" tab is browsable.
- No identifying information appears next to commits (everything should
  read `anonymous`).

Also run one final string search per repo via the file viewer for your own
surname, your affiliation, and your work email domain:

```
<your-surname>       # must return nothing
<your-affiliation>   # must return nothing
<your-email-domain>  # must return nothing
```

## 6. Share with reviewers

The single URL that ties the three repos together is
<https://huggingface.co/legexbenchmark>. Add it to the supplementary
material of your OpenReview submission; reviewers can browse all three
datasets from that org page without logging into HF.

---

## Troubleshooting

**A commit shows your real name despite the local config.** Run
`git log -1 --pretty='%an <%ae>'` inside the clone. If it still shows your
real identity, redo `git config user.name / user.email` and then
`git commit --amend --reset-author` before pushing.

**HF complains about LFS quota.** Free accounts get 1 GB of LFS storage;
this release uses ~30 MB so quota is not a concern.

**A file exceeds 5 GB.** None of the files in this release do. If a future
addition does, `git lfs track` the path and recommit.

**You want to delete a repo.** Each repo's Settings page has "Delete this
dataset repository" — that removes files and history.

**You need to re-push after a fix.** `cd` into the local clone, edit, commit
with `--reset-author` if you also re-ran `git config`, then `git push`.

**Reviewers ask for a single zip.** HF's "Use this dataset" → "Repository
size" → "Download repository" gives a `.tar.gz` of the whole repo.