Download scripts/00_build_input.py from arthrod/edgar_segmenter_artifacts: direct link, hf CLI and curl.
- Browser
- Download file 673 Bytes
-
https://huggingface.co/datasets/arthrod/edgar_segmenter_artifacts/resolve/main/scripts/00_build_input.py
- Command line
-
hf download hf://datasets/arthrod/edgar_segmenter_artifacts/scripts/00_build_input.py
-
curl -L -o 00_build_input.py https://huggingface.co/datasets/arthrod/edgar_segmenter_artifacts/resolve/main/scripts/00_build_input.py
673 Bytes
| """Segmenter input from the source of truth only: one row per agreement with | |
| id, idx, family_id and html = the SOT's `full_html_content`. Each document is | |
| its own family (fam-<idx>). No other file is read.""" | |
| import json | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| rows = [] | |
| for line in (ROOT / "segments_with_original_text_2026-09-22.jsonl").open(): | |
| r = json.loads(line) | |
| rows.append({"id": f"doc-{r['idx']:04d}", "idx": r["idx"], "family_id": f"fam-{r['idx']:04d}", "html": r["full_html_content"]}) | |
| (ROOT / "sample/sot_input.jsonl").write_text("".join(json.dumps(x, ensure_ascii=False) + "\n" for x in rows)) | |
| print(len(rows), "documents") | |