parliamentary: rebuild from IPI PAN's PPC TEI dump, official speakers only (v0.2.6 rights audit)

#108
by ppuzio - opened

Rebuilds parliamentary from IPI PAN's speaker-labelled PPC TEI dump of 2025-05-21 (28 zips, 26,409,547,075 bytes, pinned by size and SHA-256 in src/fetch_parliamentary.py), following the decision on slayerlabs/polish-dynaword-v2#54 (1A / 2A documented / 3A / 4A / 5A). It replaces SpeakLeash's unlabelled PPC_corpus copy shipped up to v0.2.5.

Shard: 348,475 records / 1,606,998,487 cl100k_base tokens / 4,370,190,797 characters, 1919-02-10 to 2025-04-24. The old shard had 324,622 / 1,646,835,986 / 4,492,746,014 and covered 1991–2019.

Scope

  • The whole dump except 2019-2023/sejm/ and 2023-2027/sejm/ (5,940 documents). Those are covered by sejm_api, sejm_committee_transcripts and sejm_interpellations. The Senate of 2019–2025 is kept.

  • Sittings, plenary and committee (43,734 records): the speaker allowlist fails closed. It is the sejm_committee_transcripts rules plus PPC rules, each documented with its evidence in code comments and the card:

    • MPs and senators without a party tag;
    • II RP "P. X" and "S. X" labels;
    • marshals without "Sejmu"/"Senatu";
    • historic government titles;
    • URM secretaries of state;
    • legislative and petitions staff;
    • named committee chairs, only if they are MPs or senators of that term;
    • a person's own name that is not a 1-3 token name ("Piotr van der Coghen", "Jan Bury s. Antoniego"), only if it is, or starts with, an MP's, senator's or marshal's name of that term (decision 1A of 2026-10-08, commit 9dc26cc: 349 persons, 1,036,235 characters kept; 673 persons, 3,074,332 characters, mostly ambassadors, witnesses and foreign MPs, still dropped).

    It keeps 3,024,072,101 of 3,774,774,717 characters of utterance text (80.1%).

  • Interpellations, questions and replies are kept whole: 304,741 records, 298,185 with an author. The 226,062 undated records of terms 3–7 get their term's range.

  • Multi-day sittings (175) get a "first, last" range.

Files

  • parliamentary.attribution.jsonl (LFS): ppc_path, header metadata and kept speaker labels for each record, plus kept and dropped characters.
  • parliamentary.speaker-roles.csv: every role with its decision.
  • parliamentary.stats.json.
  • A hand-written card (custom_datasheet).

Other changes

  • sejm_api novelty check: it compared against the registry created end of parliamentary, which now runs to 2025 because of the Senate. It now uses PARLIAMENTARY_SEJM_END = 2019-11-11 (end of term 8), and the template and card are updated.
  • redact(): the 14-digit REGON check used the wrong weights and read the check digit at index 14, raising IndexError. It is fixed, with a test.
  • clean_sejm_committee_transcripts.roles_table takes precomputed roles.
  • Cards of sejm_committee_transcripts, sejm_interpellations and sejm_api: these no longer call parliamentary plenary-only, or interpellations a new document type.
  • A second PR will re-pin sejm_api_2011_2022 against this shard and rerun its dedup, which uses parliamentary as its reference (5A).

Known limits (all on the card)

  • Pattern-only PII redaction (12,733). A NERGAL pass is needed before release.
  • Dropped officials the rules can't tell apart:
    • bare "Podsekretarz/Sekretarz stanu": 34.09M characters;
    • "Wiceminister": 11.80M;
    • role-less names: 84.06M.
  • The dump has no Sejm interpellations after 2019-04-04 and none from term 9.
  • Not lawyer-signed-off.

Tests

  • src/test_parliamentary_contract.py covers rules, dates, the TEI build on a synthetic dump, the shipped shard against its stats and sidecar, and the card and legal note against the stats.
  • Full suite with GIT_LFS_SKIP_SMUDGE=1: 97 failed / 18 errors, all reading LFS pointers. The same failures occur at af12d0a, apart from test_added_dates[parliamentary], which now passes.

Sample (python3 src/render_sample.py data/parliamentary/parliamentary.parquet -n 3 --max-chars 700)

id: parliamentary_196972-sjm-ppxxx-00014-01
source: parliamentary
added: 2026-06-15
created: 1971-05-20
token_count: 83353
license: public-domain (official documents)
author: 

(Początek posiedzenia o godz. 11)
(Przewodniczą na posiedzeniu Marszałek Sejmu Dyzma Gałaj oraz wicemarszałkowie Andrzej Werblan i Andrzej Benesz)
Otwieram posiedzenie.
Powołuję na sekretarzy posłów Wacława Jagodzińskiego i Stanisława Nowińskiego.
Protokół i listę mówców prowadzi poseł Wacław Jagodziński.
Proszę Posłów Sekretarzy o zajęcie miejsc przy stole prezydialnym.
Protokół 13 posiedzenia Sejmu uważam za przyjęty, gdyż nie wniesiono do niego żadnych poprawek.
Prezydium Sejmu usprawiedliwia nieobecność na posiedzeniu tych posłów, których nazwiska będą umieszczone w załączniku do protokołu dzisiejszego posiedzenia.
Ustalony w dniu 11 bm. przez Prezydium Sejmu porządek dzienny […]
id: parliamentary_201115-sjm-ioxxx-05116-02
source: parliamentary
added: 2026-06-15
created: 2011-11-08, 2015-11-11
token_count: 3562
license: public-domain (official documents)
author: Joanna Berdzik - podsekretarz stanu w Ministerstwie Edukacji Narodowej

Szanowna Pani Marszałek! odpowiadając na interpelację pana posła Bogdana Józefa Rzońcy (nr SPS-023-5116/12) w sprawie wzrostu bariery w nauczaniu języka angielskiego na wsi i w mieście uprzejmie wyjaśniam.
Raport ˝Angielski - czyja szansa?˝, na który powołuje się pan poseł, został opracowany przez Europejski Fundusz Rozwoju Wsi Polskiej i dotyczy nauczania języka angielskiego na terenach wiejskich. W pracach nad raportem wykorzystano m.in. wyniki egzaminów gimnazjalnych z języka angielskiego, publikowane przez Centralną Komisję Egzaminacyjną.
Na podstawie badań sondażowych w raporcie wskazano kilka podstawowych barier w nauczaniu języka angielskiego na terenach wiejskich (bariery […]
id: parliamentary_202327-snt-pcpxx-00047-01
source: parliamentary
added: 2026-06-15
created: 2025-03-11
token_count: 7057
license: public-domain (official documents)
author: 

(Początek posiedzenia 11 marca o godzinie 14 minut 03)
(Posiedzeniu przewodniczy przewodniczący Komisji Samorządu Terytorialnego i Administracji Państwowej Zygmunt Frankiewicz)
Dzień dobry państwu.
Otwieram wspólne posiedzenie Komisji Praw Człowieka i Praworządności oraz Komisji Samorządu Terytorialnego i Administracji Państwowej.
Witam państwa w imieniu pana przewodniczącego Marcina Karpińskiego i swoim własnym.
Czy na sali są osoby, które zawodowo trudnią się działalnością lobbingową? Nie ma takich osób.
Posiedzenie jest nagrywane i transmitowane.
W porządku obrad jest rozpatrzenie ustawy o zmianie ustawy o udzielaniu cudzoziemcom ochrony na terytorium Rzeczypospolitej Polskiej. Czy do […]

🤖 Generated with Claude Code

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

Sign up or log in to comment