Archive original USPTO-SynPlanner data and add extraction-retained final dataset

#3
by Protolaw - opened
README.md CHANGED
@@ -21,9 +21,17 @@ datasets/
21
  README.md
22
  dataset.yaml
23
  raw/molecular_transformer_data.zip
24
- uspto_synplanner/
25
  README.md
26
- dataset.yaml
 
 
 
 
 
 
 
 
27
  models/
28
  README.md
29
  uspto_mit/README.md
@@ -40,7 +48,7 @@ models/
40
 
41
  ## Datasets
42
 
43
- Raw files use the same relative paths and bytes as the local project.
44
  [datasets/artifacts.json](datasets/artifacts.json) records their sizes and SHA-256
45
  hashes. Prepared data, generated outputs, and machine-specific manifests are not
46
  published here.
@@ -51,8 +59,10 @@ published here.
51
  [MolecularTransformerData source](https://ibm.box.com/v/MolecularTransformerData).
52
  The ZIP includes several variants; the documented benchmark uses non-augmented
53
  `MIT_separated` with 409,035 training, 30,000 validation, and 40,000 test rows.
54
- - [USPTO-SynPlanner](datasets/uspto_synplanner): reserved for future data; no raw
55
- files have been uploaded yet.
 
 
56
 
57
  ## Models
58
 
 
21
  README.md
22
  dataset.yaml
23
  raw/molecular_transformer_data.zip
24
+ uspto_synplan/
25
  README.md
26
+ uspto_synplan_old/
27
+ README.md
28
+ dataset.yaml
29
+ uspto_synplan.smi.zip
30
+ uspto_synplan_final/
31
+ README.md
32
+ passed_reactions.smi.zip
33
+ rules_extraction.yaml
34
+ provenance.json
35
  models/
36
  README.md
37
  uspto_mit/README.md
 
48
 
49
  ## Datasets
50
 
51
+ Raw source artifacts and their dataset versions are documented below.
52
  [datasets/artifacts.json](datasets/artifacts.json) records their sizes and SHA-256
53
  hashes. Prepared data, generated outputs, and machine-specific manifests are not
54
  published here.
 
59
  [MolecularTransformerData source](https://ibm.box.com/v/MolecularTransformerData).
60
  The ZIP includes several variants; the documented benchmark uses non-augmented
61
  `MIT_separated` with 409,035 training, 30,000 validation, and 40,000 test rows.
62
+ - [USPTO-SynPlanner](datasets/uspto_synplan): `uspto_synplan_old` preserves
63
+ the original 973,640 reactions; `uspto_synplan_final` contains the 851,479
64
+ original records supporting templates retained after extraction filtering and
65
+ popularity ≥3. The dataset README documents their exact relationship.
66
 
67
  ## Models
68
 
datasets/README.md CHANGED
@@ -1,16 +1,19 @@
1
- # Local dataset conventions
2
 
3
  The code repository tracks acquisition notes, file identities, and import settings.
4
  The [Hugging Face artifact repository](https://huggingface.co/Manajit/SynplannerChemformer/tree/main/datasets)
5
- mirrors the corresponding raw data paths:
6
 
7
  - `absynth/raw/absynth_full_filtered_classed.csv`: the supplied AbSynth export.
8
  - `uspto_mit/raw/molecular_transformer_data.zip`: the original archive from
9
  [MolecularTransformerData](https://ibm.box.com/v/MolecularTransformerData).
10
- - `uspto_synplanner/`: documentation and settings only; raw data will be added later.
 
 
 
11
 
12
  `artifacts.json` records sizes, SHA-256 hashes, and known acquisition sources.
13
- `uspto_mit` supports existing Chemformer pickles. The `uspto_synplanner` and
14
  `absynth` import recipes still need source-specific validation. No downloads happen
15
  implicitly. The raw data remains ignored in the code repository.
16
 
 
1
+ # Datasets and preparation conventions
2
 
3
  The code repository tracks acquisition notes, file identities, and import settings.
4
  The [Hugging Face artifact repository](https://huggingface.co/Manajit/SynplannerChemformer/tree/main/datasets)
5
+ contains these raw data paths:
6
 
7
  - `absynth/raw/absynth_full_filtered_classed.csv`: the supplied AbSynth export.
8
  - `uspto_mit/raw/molecular_transformer_data.zip`: the original archive from
9
  [MolecularTransformerData](https://ibm.box.com/v/MolecularTransformerData).
10
+ - [uspto_synplan/](uspto_synplan): `uspto_synplan_old` archives the original
11
+ 973,640 reactions and historical metadata; `uspto_synplan_final` contains
12
+ 851,479 source reactions retained after SynPlanner extraction filtering and
13
+ template popularity ≥3. See its README for selection details and counts.
14
 
15
  `artifacts.json` records sizes, SHA-256 hashes, and known acquisition sources.
16
+ `uspto_mit` supports existing Chemformer pickles. The historical `uspto_synplanner` and
17
  `absynth` import recipes still need source-specific validation. No downloads happen
18
  implicitly. The raw data remains ignored in the code repository.
19
 
datasets/artifacts.json CHANGED
@@ -11,6 +11,18 @@
11
  "bytes": 276751431,
12
  "sha256": "1724f48b07e1f8d3c7267ab50913c6e684750850a16fbb417961e8130350d0f7",
13
  "source_url": "https://ibm.box.com/v/MolecularTransformerData"
 
 
 
 
 
 
 
 
 
 
 
 
14
  }
15
  ]
16
  }
 
11
  "bytes": 276751431,
12
  "sha256": "1724f48b07e1f8d3c7267ab50913c6e684750850a16fbb417961e8130350d0f7",
13
  "source_url": "https://ibm.box.com/v/MolecularTransformerData"
14
+ },
15
+ {
16
+ "path": "datasets/uspto_synplan/uspto_synplan_old/uspto_synplan.smi.zip",
17
+ "bytes": 78640103,
18
+ "sha256": "8d567a31386327302b8f3dd861bb322a9d4d0e8e1e78cf17853278d4d285888d",
19
+ "provenance": "Original 973,640-reaction archive; moved unchanged from datasets/uspto_synplanner at c612c234ed708c164bf058cd0367d98c804460c5"
20
+ },
21
+ {
22
+ "path": "datasets/uspto_synplan/uspto_synplan_final/passed_reactions.smi.zip",
23
+ "bytes": 67627732,
24
+ "sha256": "cd2192c45d402ed9d7343e07dea6c2631b4a818fe653eaa07dd861af975b06ff",
25
+ "provenance": "851,479 original source records supporting 11,424 retained SynPlanner templates with popularity >=3; see datasets/uspto_synplan/README.md"
26
  }
27
  ]
28
  }
datasets/uspto_synplan/README.md ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # USPTO-SynPlanner: original and extraction-retained reactions
2
+
3
+ These are two versions of the same reaction corpus. The final version is a
4
+ subset of the old version selected using the saved SynPlanner extraction results.
5
+
6
+ | Version | Reaction records | File | Meaning |
7
+ | --- | ---: | --- | --- |
8
+ | [uspto_synplan_old](uspto_synplan_old) | 973,640 | `uspto_synplan.smi.zip` → `uspto_synplan.smi` | Original filtered corpus, before rule-extraction filtering and the template popularity cutoff |
9
+ | [uspto_synplan_final](uspto_synplan_final) | 851,479 | `passed_reactions.smi.zip` → `passed_reactions.smi` | Reactions supporting templates retained after extraction filtering with popularity **≥3** |
10
+
11
+ ## How the versions are related
12
+
13
+ The old archive is preserved byte for byte from
14
+ `datasets/uspto_synplanner/uspto_synplan.smi.zip` at Hub revision
15
+ `c612c234ed708c164bf058cd0367d98c804460c5`. Its decompressed file is byte-identical
16
+ to the extraction input, `03_filtration/all/unfailed_filtered.smi`.
17
+ The original `README.md` and `dataset.yaml` are also archived unchanged in
18
+ `uspto_synplan_old`; they are historical placeholder import metadata, not a
19
+ validated recipe for loading this SMILES file.
20
+
21
+ SynPlanner was run with `04_extraction/all/pop_3_new/rules_extraction.yaml` and
22
+ wrote `uspto_rules.tsv`, `uspto_rules.audit.tsv`, and `uspto_rules_policy_data.tsv`.
23
+ The extraction configuration is preserved in
24
+ [uspto_synplan_final/rules_extraction.yaml](uspto_synplan_final/rules_extraction.yaml).
25
+ It uses `min_popularity: 3`, which means an inclusive **≥3**, not strictly >3.
26
+ Other settings include single-product reactions, no multicenter rules, ignored
27
+ stereochemistry during extraction, and a one-atom rule environment.
28
+
29
+ The final file was recovered without rerunning extraction: take the union of
30
+ `reaction_indices` from all 11,424 retained templates in `uspto_rules.tsv`, then
31
+ copy the corresponding original input records in their original order. Indices
32
+ are zero-based over non-empty input records. The union contains exactly 851,479
33
+ distinct source indices. For this run, each retained reaction has one recorded
34
+ retained-template association.
35
+
36
+ The output preserves the original complete reaction lines, including atom maps,
37
+ CXSMILES extensions, source identifiers and other metadata. No canonicalization,
38
+ deduplication, new atom mapping, stereochemistry removal or train/validation/test
39
+ split was performed during recovery. Duplicate chemistry on distinct input rows
40
+ is not collapsed. The extraction's `ignore_stereo` setting concerns templates;
41
+ it does not strip stereochemistry from these copied source records.
42
+
43
+ ## Accounting for the excluded reactions
44
+
45
+ | Outcome | Reaction records |
46
+ | --- | ---: |
47
+ | Retained after all filters, template popularity ≥3 | 851,479 |
48
+ | Below minimum template popularity | 29,475 |
49
+ | Multiple reaction centers | 51,455 |
50
+ | Reactor validation failed | 26,511 |
51
+ | Multiple products | 14,126 |
52
+ | Standardization errors | 587 |
53
+ | No rules extracted | 7 |
54
+ | **Total original input** | **973,640** |
55
+
56
+ All 122,161 excluded input records appear in the saved audit. Their indices are
57
+ disjoint from the retained indices, and together these sets cover the complete
58
+ input. The audit's original reaction strings were checked against the input.
59
+ The generated final file was also verified byte for byte against the complement
60
+ of the audit, using SHA-256.
61
+
62
+ Template counts and reaction counts are different: the run reports 65,531 unique
63
+ extracted templates, of which 29,214 failed reactor validation, 24,893 fell below
64
+ minimum popularity and 11,424 were retained. The 24,893 low-popularity templates
65
+ account for 29,475 rejected reaction records, not 24,893 reactions.
66
+
67
+ ## Integrity and use
68
+
69
+ Decompressed file SHA-256 values:
70
+
71
+ | File | Bytes | SHA-256 |
72
+ | --- | ---: | --- |
73
+ | `uspto_synplan_old/uspto_synplan.smi` | 432,334,623 | `fe00835cfb2d5938701ac79666d209bc2fde7f395e221b7e0b301f36491b9079` |
74
+ | `uspto_synplan_final/passed_reactions.smi` | 373,856,455 | `b3a4482563b23fad070845fbfe6f4b7782a0773c4ace434a2fa697cf65dd7784` |
75
+
76
+ Archive hashes and sizes are listed in [../artifacts.json](../artifacts.json).
77
+ The final version also includes [provenance.json](uspto_synplan_final/provenance.json)
78
+ with identities of the source, extraction outputs and recovered data.
79
+
80
+ Use `uspto_synplan_final` for experiments intended to match this retained
81
+ SynPlanner template vocabulary. Use `uspto_synplan_old` to reproduce the broader
82
+ pre-extraction corpus. Neither file supplies a train/validation/test split;
83
+ Chemformer preprocessing and split generation are separate steps. Dataset usage
84
+ and citation terms remain those of the original sources; this reorganization
85
+ does not assign a new dataset license or change model checkpoints.
datasets/uspto_synplan/uspto_synplan_final/README.md ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # USPTO-SynPlanner final: 851,479 reactions
2
+
3
+ `passed_reactions.smi.zip` contains `passed_reactions.smi`: the original source
4
+ records supporting the 11,424 templates retained by the saved SynPlanner run,
5
+ with **template popularity ≥3**. This is a subset of the 973,640-reaction corpus
6
+ archived in [../uspto_synplan_old](../uspto_synplan_old).
7
+
8
+ See the [parent README](../README.md) for the exact selection procedure, exclusion
9
+ counts, original dataset location, and integrity checks. The original source
10
+ record contents and order are preserved; no dataset split is included.
11
+
12
+ - `rules_extraction.yaml`: the extraction configuration used by the original run.
13
+ - `provenance.json`: source and extraction-output identities, counts, and hashes.
14
+
15
+ Unzip the archive and pass the `.smi` file explicitly to the Chemformer
16
+ SynPlanner preparation workflow. Keep generated representations and splits
17
+ separate from this recovered source dataset.
datasets/uspto_synplan/uspto_synplan_final/passed_reactions.smi.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cd2192c45d402ed9d7343e07dea6c2631b4a818fe653eaa07dd861af975b06ff
3
+ size 67627732
datasets/uspto_synplan/uspto_synplan_final/provenance.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset": "uspto_synplan_final",
3
+ "parent": {
4
+ "path": "datasets/uspto_synplan/uspto_synplan_old/uspto_synplan.smi.zip",
5
+ "original_hub_path": "datasets/uspto_synplanner/uspto_synplan.smi.zip",
6
+ "original_hub_revision": "c612c234ed708c164bf058cd0367d98c804460c5",
7
+ "decompressed": {
8
+ "member": "uspto_synplan.smi",
9
+ "sha256": "fe00835cfb2d5938701ac79666d209bc2fde7f395e221b7e0b301f36491b9079",
10
+ "records": 973640,
11
+ "bytes": 432334623
12
+ }
13
+ },
14
+ "output": {
15
+ "path": "datasets/uspto_synplan/uspto_synplan_final/passed_reactions.smi.zip",
16
+ "archive_sha256": "cd2192c45d402ed9d7343e07dea6c2631b4a818fe653eaa07dd861af975b06ff",
17
+ "archive_bytes": 67627732,
18
+ "member": "passed_reactions.smi",
19
+ "sha256": "b3a4482563b23fad070845fbfe6f4b7782a0773c4ace434a2fa697cf65dd7784",
20
+ "records": 851479,
21
+ "bytes": 373856455
22
+ },
23
+ "selection": {
24
+ "min_popularity_inclusive": 3,
25
+ "retained_templates": 11424,
26
+ "index_base": 0,
27
+ "index_unit": "non-empty input record",
28
+ "method": "Union reaction_indices in retained uspto_rules.tsv; copy original records in input order",
29
+ "preserves_record_bytes": true,
30
+ "deduplicates_chemistry": false,
31
+ "splits_assigned": false,
32
+ "extraction_rerun": false
33
+ },
34
+ "excluded_reactions": {
35
+ "BelowMinPopularity": 29475,
36
+ "MultiCenter": 51455,
37
+ "ReactorValidationFailed": 26511,
38
+ "SkippedMultiProduct": 14126,
39
+ "StandardizationError": 587,
40
+ "NoRulesExtracted": 7
41
+ },
42
+ "extraction_artifacts": [
43
+ {
44
+ "name": "rules_extraction.yaml",
45
+ "sha256": "1a5a48d16d29e8b2f9e9280a03b8e2f73de144c49d61d5ec77d54b86022ab36c",
46
+ "bytes": 472
47
+ },
48
+ {
49
+ "name": "uspto_rules.tsv",
50
+ "sha256": "8c6deb65c823fb5d997a202974b0c48e826524027694ac7409dcfbbc0db98932",
51
+ "bytes": 7113184
52
+ },
53
+ {
54
+ "name": "uspto_rules.audit.tsv",
55
+ "sha256": "a8a22e0c027a4c6220dd7d841fbc7e7cae0b64e27b393e7f688300949078170e",
56
+ "bytes": 73617742
57
+ },
58
+ {
59
+ "name": "uspto_rules_policy_data.tsv",
60
+ "sha256": "9fa30011478ffb57287a9d87f7c56cfd61a6fe23e4e66f6621d6935c56b908b5",
61
+ "bytes": 42588725
62
+ }
63
+ ]
64
+ }
datasets/uspto_synplan/uspto_synplan_final/rules_extraction.yaml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ min_popularity: 3
2
+ single_product_only: True
3
+ ignore_stereo: True
4
+ worker_timeout_per_reaction: 10.0
5
+ environment_atom_count: 1
6
+ multicenter_rules: False
7
+ include_rings: False
8
+ include_func_groups: False
9
+ keep_leaving_groups: True
10
+ keep_incoming_groups: False
11
+ keep_reagents: False
12
+ atom_info_retention:
13
+ reaction_center:
14
+ neighbors: False
15
+ implicit_hydrogens: False
16
+ ring_sizes: False
17
+ environment:
18
+ neighbors: False
19
+ implicit_hydrogens: False
20
+ ring_sizes: False
datasets/{uspto_synplanner → uspto_synplan/uspto_synplan_old}/README.md RENAMED
File without changes
datasets/{uspto_synplanner → uspto_synplan/uspto_synplan_old}/dataset.yaml RENAMED
File without changes
datasets/{uspto_synplanner → uspto_synplan/uspto_synplan_old}/uspto_synplan.smi.zip RENAMED
File without changes