ilkhamfy commited on
Commit
b9e4bcf
·
verified ·
1 Parent(s): 03df354

Add LICENCE_REMEDIATION.md

Browse files
Files changed (1) hide show
  1. LICENCE_REMEDIATION.md +134 -0
LICENCE_REMEDIATION.md ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # IRexp licence remediation (Track 1)
2
+
3
+ **Date:** 2026-08-26
4
+ **Branch:** `cursor/irexp-licence-remediation-9a67`
5
+ **Audit:** `docs/irexp_scientific_data_audit.md` (§C)
6
+
7
+ ## Problem
8
+
9
+ PMC Open Access is **not** uniformly CC-BY. A prior blanket CC-BY claim (~19% NC/empty in a 200-PMCID sample) was incorrect for NOTICE / README / HF / Zenodo framing. Chemotion CC-BY-SA-4.0 was already correct.
10
+
11
+ ## What we did
12
+
13
+ 1. **`scripts/join_pmc_licences.py`** — extract unique `PMC:*` accessions from `data/irexp/irexp.jsonl.gz`, batch-query Europe PMC (`resultType=core` → `license`), cache hits, classify, stamp every record, write segregated pools.
14
+ 2. **`scripts/split_license_pools.py`** — uses stamped `license_pool` / `license` (not DOI-prefix → CC-BY). Keeps `pool_of()` as provenance-only (`pmc` vs `chemotion`) for manuscript gate A.
15
+ 3. Stamped full corpus + pool files under `data/irexp/`.
16
+ 4. Honest updates: `data/NOTICE`, `README.md`, `.zenodo.json`, `data/irexp_release/README_HF.md`, minimal `docs/PAPER.md`.
17
+
18
+ ## Classification policy
19
+
20
+ | Europe PMC / Chemotion | `license` | `license_pool` | Zenodo / Sci Data |
21
+ |---|---|---|---|
22
+ | `cc by`, versioned BY | CC-BY | **commercial** | **Primary redistributable** |
23
+ | `cc0` / public domain | CC0 | **commercial** | Primary |
24
+ | `cc by-nc`, `cc by-nc-nd`, `cc by-nc-sa` | CC-BY-NC* | **non_commercial** | Held-aside file |
25
+ | `cc by-sa` (PMC) | CC-BY-SA | **sharealike** | With Chemotion SA file |
26
+ | Chemotion RADAR4Chem | CC-BY-SA-4.0 | **sharealike** | SA file |
27
+ | `cc by-nd` | CC-BY-ND | **other** | Held aside (ND vs derived extracts) |
28
+ | Missing `license` field | EMPTY | **empty_unknown** | **Exclude from commercial pool** |
29
+ | No EPMC hit | UNKNOWN | **empty_unknown** | **Exclude from commercial pool** |
30
+
31
+ **Recommendation (implemented):** ship Sci Data / Zenodo **commercial-use pool** as the primary artifact; keep NC in a clearly labelled file; exclude empty/unknown from the commercial deposit; keep Chemotion (+ rare PMC SA) as a separate ShareAlike file.
32
+
33
+ ## Counts (Europe PMC join, 2026-08-26)
34
+
35
+ ### Records (n = 121,233)
36
+
37
+ | Pool | Records | % of corpus |
38
+ |---|---:|---:|
39
+ | **commercial** (CC-BY + CC0) | **87,617** | 72.3% |
40
+ | non_commercial (NC*) | 20,938 | 17.3% |
41
+ | sharealike (Chemotion 1,888 + PMC SA 9) | 1,897 | 1.6% |
42
+ | empty_unknown | 10,781 | 8.9% |
43
+ | other | 0 | 0.0% |
44
+ | **Total** | **121,233** | 100% |
45
+
46
+ ### By `license` label (records)
47
+
48
+ | license | Records |
49
+ |---|---:|
50
+ | CC-BY | 87,588 |
51
+ | EMPTY | 10,664 |
52
+ | CC-BY-NC | 10,546 |
53
+ | CC-BY-NC-ND | 9,663 |
54
+ | CC-BY-SA-4.0 (Chemotion) | 1,888 |
55
+ | CC-BY-NC-SA | 729 |
56
+ | UNKNOWN | 117 |
57
+ | CC0 | 29 |
58
+ | CC-BY-SA (PMC) | 9 |
59
+
60
+ ### Unique PMCIDs (15,416 articles)
61
+
62
+ | license | Articles |
63
+ |---|---:|
64
+ | CC-BY | 11,967 |
65
+ | CC-BY-NC | 1,235 |
66
+ | CC-BY-NC-ND | 1,190 |
67
+ | EMPTY | 864 |
68
+ | CC-BY-NC-SA | 134 |
69
+ | UNKNOWN | 21 |
70
+ | CC0 | 4 |
71
+ | CC-BY-SA | 1 |
72
+
73
+ Provenance totals unchanged: **119,345** PMC-sourced + **1,888** Chemotion.
74
+
75
+ ## Artefacts
76
+
77
+ | Path | Role |
78
+ |---|---|
79
+ | `scripts/join_pmc_licences.py` | Join + stamp + write pools |
80
+ | `scripts/split_license_pools.py` | Report / re-materialise from stamps |
81
+ | `data/irexp/irexp.jsonl.gz` | Full corpus **with** `license*` fields |
82
+ | `data/irexp/pmc_licence_lookup.jsonl.gz` | Per-PMCID cache |
83
+ | `data/irexp/pmc_licence_summary.json` | Machine-readable counts |
84
+ | `data/irexp/licence_pools/irexp_commercial.jsonl.gz` | Zenodo primary (87,617) |
85
+ | `data/irexp/licence_pools/irexp_non_commercial.jsonl.gz` | NC held aside |
86
+ | `data/irexp/licence_pools/irexp_sharealike.jsonl.gz` | Chemotion + PMC SA |
87
+ | `data/irexp/licence_pools/irexp_empty_unknown.jsonl.gz` | Excluded from commercial |
88
+ | `data/irexp/licence_pools/irexp_other.jsonl.gz` | Empty placeholder (0 rows) |
89
+
90
+ Re-run:
91
+
92
+ ```bash
93
+ python scripts/join_pmc_licences.py # network; resumable via cache
94
+ python scripts/split_license_pools.py # report
95
+ ```
96
+
97
+ ## Hugging Face re-upload (no credentials in-repo)
98
+
99
+ Public dataset: https://huggingface.co/datasets/ilkhamfy/IRexp
100
+
101
+ Previous card/tags overclaimed PMC as CC-BY. After this branch merges:
102
+
103
+ 1. Ensure `HF_TOKEN` with write access to `ilkhamfy/IRexp` (or a staging fork).
104
+ 2. Update local card: `data/irexp_release/README_HF.md` (already multi-licence).
105
+ 3. Upload stamped files + commercial primary, e.g.:
106
+
107
+ ```bash
108
+ # Preferred: repo helper (requires HF_TOKEN)
109
+ HF_TOKEN=hf_... python scripts/publish_hf.py
110
+
111
+ # Or huggingface-cli
112
+ huggingface-cli upload ilkhamfy/IRexp \
113
+ data/irexp/licence_pools/irexp_commercial.jsonl.gz \
114
+ data/irexp_commercial.jsonl.gz
115
+ huggingface-cli upload ilkhamfy/IRexp \
116
+ data/irexp/irexp.jsonl.gz data/irexp.jsonl.gz
117
+ huggingface-cli upload ilkhamfy/IRexp \
118
+ data/irexp_release/README_HF.md README.md
119
+ ```
120
+
121
+ 4. Set dataset card `license` list to reflect **cc-by-4.0** (commercial primary) **and** **cc-by-sa-4.0** (Chemotion/SA pool); document NC/empty as non-redistributed or separate configs.
122
+ 5. Add a card warning: full `irexp.jsonl.gz` is multi-licence; commercial training should use `license_pool == "commercial"` or the commercial file only.
123
+
124
+ If `HF_TOKEN` is unavailable in this environment, ship the files above and run the upload from a machine with Hub credentials.
125
+
126
+ ## Zenodo
127
+
128
+ `.zenodo.json` describes a **multi-licence** deposit: primary file = commercial CC-BY pool; Chemotion/SA as a second file under CC-BY-SA-4.0; NC and empty/unknown not in the commercial artifact (may be uploaded as restricted/supplementary with clear labels). Zenodo’s single `license` metadata field is set to `cc-by-4.0` for the **primary** commercial artifact; description text states the SA companion and exclusions.
129
+
130
+ ## Manuscript / gates
131
+
132
+ - Full corpus count remains 121,233; PMC/Chemotion provenance counts unchanged → `check_manuscript.py` gate A still passes via `pool_of` provenance split.
133
+ - Filter commercial rows at release time; do not shrink the on-disk research corpus.
134
+ - `docs/paper.tex` intentionally untouched (Track 1 rule).