biblioteka_nauki: drop 4,142 reviewed rows, add per-record licence basis (v2#111)

#186
by ppuzio - opened
5 hidden commits · view all commits
Fabryka AI org
•
edited 2 days ago

biblioteka_nauki: drop 4,142 reviewed rows, add per-record licence basis (v2#111)

Drops 4,142 rows chosen by a pinned review table: 41,985 → 37,843 documents, 1,739,004,913 → 1,534,529,869 characters (−204,475,044), 669,909,430 → 590,924,796 tokens (−78,984,634, 11.8%). Every kept row is byte-identical to main. The sidecar gains licence_basis, licence_basis_url and licence_basis_date for each record.

How the rows are chosen

  • data/biblioteka_nauki/biblioteka_nauki.review.csv (id,decision,reason) lists every row a rule nominated, drop or keep (4,205 rows: 4,142 drop, 63 keep). It is pinned by SHA-256. The build refuses an input that is not the pinned v0.2.5 parquet, a licence file that is not the pinned one, and any review that differs from what the rules propose.
  • Five rules nominate rows, in this order: printed licence note, prior publication (reprints, translations, republication by permission), file is another work, restriction notice, and created earlier than the licence version. A row dropped by an earlier rule keeps that reason; a row only kept by an earlier rule is dropped by a later one.
  • Only the rule names and the reasons are general. The ids of the hand-read rows are in HAND in src/licence_basis_biblioteka_nauki.py. One labeller (Claude).
  • One command rebuilds the parquet, sidecar, stats, evidence and card tables from the v0.2.5 parquet: python3 src/clean_biblioteka_nauki.py --input <v0.2.5 parquet>. The build was run twice and gave the same bytes.
decision: reason documents characters tokens
drop: created_before_licence_version 3,957 181,784,176 70,103,154
drop: restriction_notice_no_cc_note 97 14,700,907 5,882,338
drop: reprint_or_prior_publication 30 1,475,398 531,012
drop: translation_of_earlier_publication 17 902,932 346,552
drop: file_is_another_work 16 1,237,708 455,178
drop: republished_by_permission 11 1,359,754 504,063
drop: api_flagged_reprint_translation 5 2,189,037 844,892
drop: translation_title_marker 5 119,365 47,745
drop: printed_licence_nc_or_nd 4 705,767 269,700
drop, total 4,142 204,475,044 78,984,634
keep: 12 reasons 63 6,979,532 2,827,293

Please look at

  • The year rule is a lower bound. 3,989 rows have a created start year earlier than the first year of their label's licence version (2.0: 2004; 3.0 and 3.0-PL: 2007; 4.0: 2013). Journal adoption years could not be obtained, so articles from before a journal adopted Creative Commons, but after the version existed, may remain. The Polish port years of 3.0-PL and the platform's current licence may also differ from those at publication. A seeded sample of 100 of the rows: in 90 the year is printed in the first 8,000 or last 5,000 characters; in the other 10 the text cites no later year than created.
  • Overlap of the year rule with the others: 32 of the 3,989 are also nominated by an earlier drop rule and keep that reason (restriction notice 26, another work 3, NC/ND 1, prior publication 1, translation 1). 7 were kept by an earlier rule and are dropped here (restriction notice beside a CC note 5, not a notice 1, printed SA on a BY label 1). So 3,957 carry the year reason, 3,950 of them in no other rule's list.
  • The 97 restriction-notice rows are the weakest evidence. The text prints a restriction clause (for example, reprinting without permission is forbidden) and no Creative Commons note. A bare "all rights reserved" is kept (5 rows). No journal or publisher page was read for them.
  • Licence basis: file_note for 2,657 records (the text prints the label's licence), depositor for 35,186 (the licence field of the upstream API). None has publisher or none. A publisher check was not done.
  • Rows read and kept: 63 nominated rows, for example articles that discuss a licence, texts that are garbled but are the right work, and translations of CC-licensed originals.

Files

  • src/licence_basis_biblioteka_nauki.py (new rules, HAND, REASONS, final_reasons, evidence), src/clean_biblioteka_nauki.py (pins, review step, stats, sidecar, evidence).
  • src/licence_basis.py, src/test_licence_basis.py: the first-year table of the licence versions (RELEASE: 2.0 2004, 3.0 and 3.0-PL 2007, 4.0 2013), release_year and created_year, with tests. They live here, not in the stage, so that other stages (the open_icm_pl PR follows) apply the same years.
  • src/test_licence_basis_biblioteka_nauki.py, src/test_biblioteka_nauki_contract.py: rule tests on fixtures, and release tests that recount the shipped files against the review, stats and evidence.
  • data/biblioteka_nauki/: review.csv (new), licence-basis.json (new), license-evidence.json, parquet, attribution, stats, card.
  • src/sources.py entry, src/biblioteka_nauki_overlap.py (docstring), artifacts/source_findings.md (new section).

Not in this PR: README.md row counts (v2#80). The NERGAL pass is unchanged. The overlap audits of other sources read the Hub revision of main and are not rerun here.

Checks: full suite from the repo root passes on this commit alone (1759 passed, 9 skipped, 138 subtests passed, after the rebase onto main f38dfeb). The rebuilt parquet, sidecar, stats and licence-basis.json are byte-identical to the committed ones. Line endings are kept: sources.py CRLF, the rest LF.

🤖 Generated with Claude Code

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

Sign up or log in to comment