eurlex: drop third-party credits, UN ECE regulations and Parliament stubs (v2#108)

#173
by ppuzio - opened
Commit history is no longer available for this pull request.
Fabryka AI org

eurlex: drop third-party credits, UN ECE regulations and Parliament stubs (v2#108)

Drops 480 rows chosen by a pinned row review: 242,968 → 242,488 documents, 5,902,889,135 → 5,859,513,831 characters (−43,375,304), 2,350,709,056 → 2,333,038,468 tokens (−17,670,588). Every kept row is otherwise identical to v0.2.5.

How the rows are chosen

  • src/clean_eurlex.py gets CANDIDATE_RULES: the (c) sign, photo headings, credits and permissions, stock-photo names, UN ECE regulation titles, headers and bodies, and two European Parliament stub shapes. On the v0.2.5 input they select 683 candidates.
  • Each candidate has one row in the new data/eurlex/eurlex.review.csv (id,decision,reason), pinned by SHA-256. The build fails if a candidate has no review row, if a review row matches no rule, or if a reviewed id is missing from the input or is on the IASB list. It also checks the input's SHA-256, so it refuses anything but the v0.2.5 parquet.
  • One labeller (Claude). Credit candidates: the matched lines were read in every row. UN ECE candidates: the title and header of every row were read, and the rest of each was searched for an annexed regulation body. Parliament stubs: every row was read whole.
decision: reason documents characters tokens
drop: third_party_credit 35 6,951,571 2,706,692
drop: unece_regulation 304 36,138,603 14,841,139
drop: unece_annex 3 231,065 98,483
drop: ep_divider_stub 96 30,274 14,712
drop: ep_discharge_stub 42 23,791 9,562
keep: not_a_credit 80 17,716,994 6,931,659
keep: eu_credit 24 1,682,105 636,400
keep: binary_data 7 9,880,498 4,345,283
keep: legal_argument 3 127,375 51,004
keep: eu_document 85 1,117,394 460,866
keep: international_agreement 2 131,864 48,839
keep: false_match 2 210,298 86,714

Please look at

  • UN ECE is larger than the ask said: 307 rows and 36.4M characters, against "about 280 rows, 33M". That is the widened rule (2A).
  • 3 unece_annex rows are Council decisions, not regulations. Their text is 94–97% the annexed UN ECE Regulations 108 and 109, so they are dropped: eurlex_1876872, eurlex_1877327, eurlex_1898766.
  • 2 treaty texts are kept: the 1958 Agreement Rev.2 and Rev.3 (eurlex_1831087, eurlex_1992860). They are the agreement the EU is party to, not a regulation made under it.
  • Changed from the earlier credit list: the 2026-10-06 evidence listed 33 (c)-sign credits. eurlex_1888527 and eurlex_1900544 are Advocate General's opinions that quote (c) lines as part of the legal argument, so they are kept. eurlex_1825861, a Commission staff working document whose photographs need the rights holder's direct permission, is dropped. The other 3 dropped credits are matched by photo_credit only.

Kept, as decided: rows that cite OECD or IMF data as a source, the 9 ECB codes of conduct, the 80 (c)-sign or photo-rule matches that are not credits (noise, list markers, caption headings), and 24 EU credits.

Files

  • src/clean_eurlex.py: candidate rules, read_review, the review step in clean(), the input pin and new stats (drop_review, drop_review_by_reason).
  • src/test_eurlex_contract.py: fixture tests for the review and the rules; the release test checks the counts, that no dropped id is in the parquet and that every kept id is.
  • data/eurlex/eurlex.review.csv (new), eurlex.parquet, eurlex.stats.json, eurlex.license-evidence.json (new review section; the (c)-sign split now comes from the review).
  • src/sources.py legal_note and the card regenerated from it. The card's filter list shows only the generic steps, so the drops are explained in the licence note.
  • artifacts/source_findings.md: new eurlex section.

Not in this PR: the per-record CC BY 4.0 link for consolidated texts (3A) and the EUR-Lex link for minutes (F3) come in a second PR. README.md still shows CC-BY-4.0 | 243,060 for eurlex (v2#80). eurlex.third-party-scan.json is still the v0.2.5 report.

Checks: full suite 1448 passed, 9 skipped (1457 collected; main collects 1433, and the 24 new eurlex tests are the difference). The eurlex contract tests hash the parquet and recount it against the stats and the evidence. Line endings are kept: sources.py CRLF, the others LF.

🤖 Generated with Claude Code

ppuzio changed pull request status to open
ppuzio changed pull request status to merged
ppuzio deleted the refs/pr/173 ref

Sign up or log in to comment