Skip to content

feat: live HUDOC auto-refresh pipeline (self-refreshing, contamination-controlled)#3

Open
overthelex wants to merge 4 commits into
AI4Collaboration:mainfrom
overthelex:feat/live-hudoc-pipeline
Open

feat: live HUDOC auto-refresh pipeline (self-refreshing, contamination-controlled)#3
overthelex wants to merge 4 commits into
AI4Collaboration:mainfrom
overthelex:feat/live-hudoc-pipeline

Conversation

@overthelex

Copy link
Copy Markdown
Collaborator

Wires the "Live" data pipeline into the shared repo: the self-refreshing HUDOC ingestion that keeps the benchmark contamination-controlled as new ECtHR judgments are published. This is the piece that makes it LiveHumanRightsBench rather than a static snapshot.

Auto-refresh chain

  • scripts/hudoc_live_refresh.py — cron-friendly orchestrator: detect latest decision_date → fetch new judgments from HUDOC → verdict-leakage removal → append → optional HF push.
  • scripts/hudoc_scraper.py — HUDOC bulk ingestion (search + full texts).
  • scripts/verdict_leakage_removal.py + scripts/conclusion_scrub.py — 3-stage verdict removal (pattern truncation → dual-model verify → repair), with the mandatory conclusion-scrub stage (rows marked +conclusion_scrub).

Eval-set construction (produces the sets documented in DATA_SPLITS.md / PR #2)

  • build_livehrb_static.pyechr-livehrb-static-2k
  • build_temporal_split.pyechr-livehrb-temporal-2k
  • build_cutoff_partitions.py → per-model matched pre/post training-cutoff partitions (contamination control), driven by configs/model_cutoffs.json
  • build_stratified_sample.py, clean_respondent_names.py, backfill_decision_dates.py, enrich_and_push.py — sampling, normalization, metadata, HF push.

See PIPELINE.md for the full chain and cron usage.

Notes

cc @TerryJCZhang — this is the data/live-refresh piece owned end to end on my side (CRediT: Data Curation / Methodology / Software). Happy to adjust the layout to repo conventions.

🤖 Generated with Claude Code

overthelex and others added 4 commits July 13, 2026 21:53
Adds the "Live" data pipeline that keeps the benchmark contamination-controlled
as new ECtHR judgments are published:

- hudoc_live_refresh.py: cron-friendly orchestrator (detect latest date ->
  fetch new judgments -> verdict-leakage removal -> append -> optional HF push)
- hudoc_scraper.py: HUDOC bulk ingestion (search + full texts)
- verdict_leakage_removal.py + conclusion_scrub.py: 3-stage verdict removal
- eval-set builders (static-2k, temporal-2k, stratified, cutoff partitions) +
  respondent normalization, decision-date backfill, enrich/push
- configs/model_cutoffs.json for per-model pre/post-cutoff partitioning
- PIPELINE.md documenting the chain; requirements: +requests, +boto3

Supersedes the closed #1 and adds the live-refresh orchestrator that #1 lacked.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…n parse

parse_conclusion_to_pairs collapsed "Article 1 of Protocol No. 1" to "1"
(the P1-1 conflation Arian flagged). New parse_article_code() extracts the
protocol-aware code into a non-breaking article_full column while keeping
the legacy collapsed article for continuity. Verified on representative
HUDOC conclusion strings.

Part of the full-article-code rebuild (LSYC-41).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… HUDOC sweep

Published sets dropped the conclusion column, so article_full can't be
recovered from the row. This resumable sweep re-fetches HUDOC conclusion
per item_id (exact-itemid guard), parses it with the fixed parser, and
writes a non-breaking article_full column. Rows that can't be resolved
unambiguously fall back to the legacy article (never fabricated) and are
counted. Supports --limit test batches and --push-to-hf.

Verified: offline enrich() unit test + live 3-item HUDOC fetch
(001-246017 article 1 -> P1-1). Part of LSYC-41.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Per-item exact queries (~14,449 requests, ~3.5h) replaced by a paged
bulk sweep over per-year JUDGMENTS windows (~500/page, under the 10K
offset cap), keeping only target ids, then a per-item fallback for the
uncovered 002-* Information Notes. Validated: the 2024-2026 window alone
resolves 2,280 ids with correct protocol codes (P1-1, P7-2, P4-2, ...).
Full run drops from hours to ~15-20 min.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
overthelex added a commit that referenced this pull request Jul 16, 2026
Contamination MFT pipeline + adapter (interim article remap, custom_id & label fixes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant