govpl: drop 188 PAP reprints (gov.pl third-party carve-out), add URL sidecar

#63
by ppuzio - opened
Fabryka AI org
•
edited 2 days ago

What and why

Drops 188 PAP (Polish Press Agency) reprints from govpl and adds a per-row URL sidecar. Tracks slayerlabs/polish-dynaword-v2#51.

gov.pl's copyright page (https://www.gov.pl/web/gov/prawa-autorskie, read 2026-10-06) licenses the site's text under CC BY-SA 4.0 but carves out "utwory, co do których prawa autorskie przysługują osobom trzecim" (works whose copyright belongs to third parties); using those needs the owners' consent. Articles that credit PAP as their source are such works.

documents characters tokens (cl100k proxy)
before (v0.2.5) 88,190 218,099,000 80,666,129
after 88,002 217,515,240 80,445,758
dropped 188 583,760 220,371

release stays 0.2.2. Ids are unchanged: the filter runs on the pinned v0.2.5 Parquet, because a rebuild through build_dynaword.py would renumber ids.

Rules (fetch_govpl.pap_rule)

rule matches example
source_line: Źródło: line naming PAP 163 Źródło: /PAP, MKiDN/
based_on: Na podst. … PAP 22 Na podst. PKP S.A. i PAP (all uw-podlaski)
sign_off: a line holding only (PAP) 2 govpl_29650, govpl_59117
interview: ≥3 lines starting PAP: 1 govpl_82237, a PAP interview with the Prosecutor General
  • Issue rule (?i)\bźr[óo]d[łl]o\s*:\s*/?[^\n]{0,60}\bPAP\b: 154 matches, as in the issue. Every match is a source line in the last 8% of the article (median position 98.8%). None is a photo credit, so the rule was not tightened (0 changed).
  • Hand-check of 20 of the 154 (random.Random(51).sample): 20/20 are text source lines crediting PAP, and 0 are photo credits. 4 credit PAP alone, 14 PAP with the culture ministry (/PAP, MKiDN/, /MKDNiS, PAP/), and 2 PAP with another outlet (Culture.pl, Nowy Napis). Where PAP is credited jointly, part of the text may be the ministry's. PAP's archive is not public, so verbatim PAP authorship was not confirmed.
  • Extensions (34 rows, each read by hand):
    • 9 source lines the issue rule misses: no colon (Źródło PAP, MKiDN), Źródło informacji: PAP/MKIDN, Źródła: PAP, Culture.pl, żródło: / Żródło: / Zródło:, Żródło: Polska Agencja Prasowa, Źródło informacji: PAP MediaRoom.
    • The based_on, sign_off and interview rows above.
    • source_line covers the issue rule; the contract test checks the release against both.
  • Kept: photo credits (fot. PAP, PAP/<photographer>), quotes and mentions ("w rozmowie z PAP", Centrum Prasowe PAP, PAP corporate news). Also kept, borderline:
    • a mid-text (PAP) after one paragraph: govpl_30227, govpl_58869
    • a footnote crediting PAP and the health ministry: govpl_81037
    • a KRRiT report quoting two PAP questions: govpl_86914

Provenance and licence

  • src/clean_govpl.py (new) reads the v0.2.5 Parquet (SHA-256 9c0310fc…) and the 2026-07-19 crawl govpl.jsonl.zst (SHA-256 368259d0…). Both are pinned.
  • It drops rows that pap_rule names, keeps the other rows byte-identical and in order, and writes govpl.parquet, govpl.stats.json and govpl.attribution.jsonl.
  • A rerun from the pinned inputs reproduces all three files byte for byte.
  • fetch_govpl.normalize() applies the same rule to future crawls.
  • URL sidecar (asked in the issue): govpl.attribution.jsonl has one line per row, in Parquet order: id, url, subsite, title, date, license. Rows are matched to the crawl on build_dynaword's dedup key (SHA-1 of the stripped text), and all 88,002 rows matched. For 1,189 rows the same text was fetched from more than one URL; the first URL in fetch order is given.
  • src/sources.py (govpl entry):
    • traceable now cites the copyright page and its carve-out. It drops "same open family as Polish Wikipedia".
    • New legal_note states the PAP filter.
    • provenance names the clean script and the sidecar.
    • Adds custom_datasheet: True, because the template's single build-filter section cannot show the second step.
  • data/govpl/govpl.md is rendered by make_docs.datasheet(), then edited by hand: an Attribution section and a two-step "Filters applied".
  • artifacts/source_findings.md gets an appended govpl entry.
  • Not screened: 710 kept rows carry a Źródło: line naming another source. Most of those seen name government bodies; some name WHO, universities or journals. This needs a separate decision.

Tests

  • New tests in src/test_govpl_contract.py:
    • regex cases: reprint forms match; photo credits and mentions do not
    • normalize() drops a reprint
    • release: 0 rows match the issue rule or pap_rule, and the row count is 88,002
    • stats match the Parquet (count, chars, tokens, drop arithmetic)
    • sidecar ids equal the Parquet ids, and every URL is under https://www.gov.pl/web/<subsite>/
    • the datasheet numbers match the stats
  • The release tests fail against the v0.2.5 Parquet (checked).
  • python -m pytest -q from the repo root:
    • before: 22 failed, 234 passed, 3 errors
    • after: 22 failed, 241 passed, 3 errors
    • The failing set is identical (pre-existing; none is govpl). 13 of 13 govpl tests pass.
  • The baseline run was on 92b36dc. The commit was then rebased onto the current main, 58581da (#61, which changes only the hplt entry in src/sources.py). The after-run on the rebased commit f9e9eee gives the same result and the same failing set.

Sample (python3 src/render_sample.py data/govpl/govpl.parquet -n 3)

id: govpl_55300
source: govpl
added: 2026-07-19
created: 2005-09-26, 2026-07-19
token_count: 404
license: CC-BY-SA-4.0
author: 

O współpracy przy realizacji strategicznych inwestycji

W spotkaniu wzięli udział przedstawiciele: Generalnej Dyrekcji Dróg Krajowych i Autostrad Oddział w Białymstoku, PKP Polskich Linii Kolejowych S.A., Państwowego Gospodarstwa Wodnego Wody Polskie Regionalnego Zarządu Gospodarki Wodnej w Białymstoku, Wojewódzkiego Inspektora Nadzoru Budowlanego w Białymstoku oraz Regionalnej Dyrekcji Ochrony Środowiska w Białymstoku. PUW reprezentowali wojewoda podlaski i pracownicy Wydziału Architektury i Budownictwa oraz Wydziału Nieruchomości i Geodezji.

Celem było wypracowanie modelu współpracy i omówienie najczęściej zgłaszanych problemów przy procedowaniu wniosków w zakresie strategicznych inwestycji realizowanych przez instytucje biorące udział w spotkaniu. Uczestnicy omówili problemy […]
id: govpl_5306
source: govpl
added: 2026-07-19
created: 2005-09-26, 2026-07-19
token_count: 1092
license: CC-BY-SA-4.0
author: 

Wiadukty i tunele zwiększają bezpieczeństwo i poprawiają komunikację

— Inwestycje PKP Polskich Linii Kolejowych SA zwiększają bezpieczeństwo, zapewniają większą dostępność do kolei, a także umożliwiają lepszą komunikację w miastach. Przekłada się to na jakość życia mieszkańców. Poprzez realizację takich zadań jak w Czyżewie czy w Sulejówku, budujemy pozycję kolei jako ekologicznego i bezpiecznego środka transportu — powiedział wiceminister infrastruktury, pełnomocnik rządu ds. przeciwdziałania wykluczeniu komunikacyjnemu Andrzej Bittel.

Wiadukt w Czyżewie na podlaskim odcinku Rail Baltica

W Czyżewie dwupoziomowe skrzyżowanie jest zlokalizowane około 200 m od dawnego przejazdu kolejowo-drogowego i ok. 400 m od stacji kolejowej. Dzięki temu kierowcy nie muszą czekać już przy zamkniętych […]
id: govpl_34091
source: govpl
added: 2026-07-19
created: 2005-09-26, 2026-07-19
token_count: 454
license: CC-BY-SA-4.0
author: 

Ogłoszenia o konkursach na stanowiska kierownicze w Instytutach Polskich

Celem konkursu jest wyłonienie kandydatek i kandydatów wyspecjalizowanych w realizacji zadań dyplomacji kulturalnej i powierzenie misji kierowania IP osobom, posiadającym doświadczenie i osiągnięcia w pracy na rzecz promocji polskiej kultury za granicą. 

MSZ otwiera w ten sposób możliwość poszerzenia kadry dyplomatycznej o osoby niebędące członkami służby zagranicznej, które chciałyby poświęcić kilka lat pracy wspieraniu realizacji polskiej polityki zagranicznej poprzez upowszechnianie za granicą wiedzy o Polsce i jej kulturze. Doświadczenie pracy w IP pozwoli tym osobom na poszerzenie profesjonalnego doświadczenia, co, mamy nadzieję, będzie owocowało również na dalszych etapach ich rozwoju zawodowego.

 

Linki do […]

🤖 Generated with Claude Code

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

Sign up or log in to comment