plwiki_talk: drop file-link residue (v2#116), label by contribution date (v2#110)
Cleans the plwiki_talk text (v2#116, option A, with category lines kept) and relabels it by contribution date (v2#110, option B). This PR carries the code for both talk sources; the plwiki_user_talk data follows in its own PR.
Labels per record (43,054 documents, 55,564,235 tokens; was 43,054 / 55,568,733)
| label | documents | tokens | share |
|---|---|---|---|
CC-BY-SA-3.0 |
32,089 | 31,783,490 | 57.2% |
CC-BY-SA-3.0 AND CC-BY-SA-4.0 |
8,528 | 20,829,485 | 37.5% |
CC-BY-SA-4.0 |
2,437 | 2,951,260 | 5.3% |
Before (by last revision): 3.0 17,990 / 4.0 25,064. Every 3.0 row stays 3.0. Of the 4.0 rows, 14,099 are now 3.0, 8,528 both and 2,437 stay 4.0. Basis per row: the stub dump plwiki-20261001-stub-meta-history.xml.gz (sha1 47fd7549…), plus 21,270 pre-cutoff revisions converted with the talk builders' own steps and compared word by word with the shipped text. 9 pages edited after the cutoff are no longer in the dump and are labelled both; 3 pre-cutoff texts are hidden (both). Each sidecar line gains license_basis and pre_cutoff_revid.
Cleanup (v2#116): clean_plwiki_talk.py retext changed 536 rows and removed 14,575 characters and 4,498 tokens. No row fell under 500 characters and none repeats another. Kategoria: lines stay, since the talk pages discuss categories. 36 rows keep options glued to a word or quoted file-link syntax (listed in the findings).
Code:
- Both talk builders end with
drop_residue(text, categories=False)after the PII redaction, and drop a record left under 500 characters (too_little_text_after_residue_cleanup). A rebuild still labels by last revision, sorelabelfollows it. clean_plwiki_talk.pygainsretextandrelabel;wiki_history.py's talk converter ends with the samedrop_residue, andcomparerefuses a talk release thatretextwould still change.drop_residuecleans each line to a fixed point (left|150px right|150pxleft a line a rule drops), also removes an option run's last markup or position word before a caption (65px|rightUlmer Münster→Ulmer Münster), and keeps| link=* http://...list items.sources.py: both talk sources' licence and traceable-basis text by contribution.
The released wikinews, wikivoyage and wikibooks texts are fixed points of the new rules, so their contract tests pass. A retext from their pre-cleanup data would now remove option words from 105 more rows (1,920 characters); those releases are unchanged here.
Tests: the talk and wiki_history tests pass, and so do the wikinews, wikivoyage and wikibooks contract tests, run on their released data with the new rules. The four plwiki_user_talk contract tests fail until its data PR is merged too. The full suite shows no new failures against the baseline, which comes from LFS-pointer shards in the worktree. A rerun of retext and relabel changes nothing. README, CHANGELOG and totals are left to v2#80. Details are in artifacts/source_findings.md.
🤖 Generated with Claude Code
refs/pr/135 ref