Manajit Protolaw commited on
Commit
85cdfad
·
1 Parent(s): afbb62f

Organize datasets and model experiments; preserve original checkpoint under uncertain (#1)

Browse files

- Organize datasets and model experiments; preserve original checkpoint under uncertain (96e912a716402577792c054bcc9d8805cc04a259)


Co-authored-by: Almaz Gilmullin <Protolaw@users.noreply.huggingface.co>

.gitattributes CHANGED
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+
37
+ # Keep raw reaction tables in large-file storage.
38
+ *.csv filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,3 +1,68 @@
1
  ---
2
  license: mit
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
  ---
4
+ # SynPlanner Chemformer artifacts
5
+
6
+ Model checkpoints and raw reaction datasets for the Chemformer workflows project.
7
+ The existing model's MIT declaration is preserved in `models/uncertain/README.md`.
8
+ Dataset sources retain their own usage and citation terms.
9
+
10
+ ## Repository layout
11
+
12
+ ```text
13
+ datasets/
14
+ README.md
15
+ artifacts.json
16
+ absynth/
17
+ README.md
18
+ dataset.yaml
19
+ raw/absynth_full_filtered_classed.csv
20
+ uspto_mit/
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
30
+ uspto_synplanner/
31
+ README.md
32
+ random/README.md
33
+ harsh/README.md
34
+ uncertain/
35
+ .gitattributes
36
+ last.ckpt
37
+ hparams.yaml
38
+ README.md
39
+ ```
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.
47
+
48
+ - [AbSynth](datasets/absynth): the supplied raw CSV. The import recipe remains
49
+ unverified; preserve the source export when preparing experiments.
50
+ - [USPTO-MIT](datasets/uspto_mit): the unchanged ZIP downloaded from the original
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
+
59
+ `models/uspto_mit/` and `models/uspto_synplanner/{random,harsh}/` are placeholders.
60
+ Their README files keep these otherwise-empty directories visible on the Hub.
61
+
62
+ The original four files are preserved under [models/uncertain](models/uncertain).
63
+ The checkpoint's dataset, split, and reagent condition are not documented, so
64
+ moving it does not assign it to a benchmark. Its SHA-256 remains
65
+ `649e40511d6632d64e405432d7397d3b9fdb41434442e48e88eba658524f43d1`.
66
+
67
+ A root `.gitattributes` is retained for large-file handling. The original contents
68
+ remain available in `models/uncertain/.gitattributes` as well.
datasets/README.md ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
17
+ Place inputs under `<dataset>/raw/` and generated files under `<dataset>/prepared/`.
18
+ Both are ignored. Pass source/destination paths explicitly to the CLI.
19
+
20
+ `dataset.yaml` has an `import` mapping with:
21
+
22
+ | Setting | Meaning |
23
+ | --- | --- |
24
+ | `input_mode` | `reactants` (ignore reagents) or `separated` (preserve them) |
25
+ | `reaction_column` | Column containing `reactants>reagents>products` or `reactants>>products` |
26
+ | `reactant_column`, `product_column` | Supply both to use separate columns |
27
+ | `reagent_column` | Required for separated mode with separate SMILES columns |
28
+ | `split_column` | Existing train/validation/test labels; defaults to `set` |
29
+ | `default_split` | Explicit assignment if the split column is absent; otherwise null |
30
+ | `id_column` | Optional source identifier retained in the row map |
31
+ | `separator` | Input delimiter for text tables |
32
+ | `remove_atom_maps` | Defaults to true |
33
+
34
+ RDKit-molecule pickles are recognized through `reactants_mol` and `products_mol`.
35
+ Separated mode also requires `reagents_mol`. Blank reagents are valid; unparsable
36
+ nonempty reagents are rejected. No fallback changes the selected input mode.
37
+
38
+ Preparation normalizes validation aliases (`valid`, `validation`) to `val` and
39
+ preserves supplied membership. Invalid splits are rejected. Training data without
40
+ splits must be assigned explicitly; this refactor does not invent or silently
41
+ randomize dataset splits. For custom evaluation only, `predict` defaults missing
42
+ splits to `test` and predicts all supplied valid rows.
43
+
44
+ The prepared pickle contains `reactants_mol`, `products_mol`, `set`, and optionally
45
+ `reagents_mol`. Sidecar `.rows.csv` maps every original positional row to a prepared
46
+ row or rejection reason, preserving optional source IDs. `.report.json` stores the
47
+ source SHA-256, import settings, and split/rejection counts. Keep these sidecars
48
+ with their associated predictions.
49
+
50
+ Before claiming a new dataset is supported, document its source/release/usage
51
+ terms, inspect representative exports, configure columns, preserve its published
52
+ splits, and validate input-mode semantics. The small original capivasertib reaction
53
+ list is retained under `examples/`; its generated predictions are not tracked.
datasets/absynth/README.md ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # absynth
2
+
3
+ The supplied raw export is `raw/absynth_full_filtered_classed.csv`. The Hugging
4
+ Face artifact repository mirrors this file byte-for-byte at the same relative
5
+ path. Its SHA-256 and size are recorded in `../artifacts.json`.
6
+
7
+ Import recipe is a configurable placeholder. Obtain a representative export and confirm its columns and published splits before using it for training; source-specific support has not been validated.
8
+
9
+ Keep source files in `raw/` and derived pickles/reports in `prepared/`; both are ignored.
10
+ Record the dataset release, source URL, acquisition date, and applicable usage terms here when selecting a source.
11
+ Edit `dataset.yaml` to match the export. Paths are passed explicitly to the CLI.
datasets/absynth/dataset.yaml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ dataset: absynth
2
+ status: unverified-export
3
+ import:
4
+ input_mode: reactants
5
+ reaction_column: rxn_smiles
6
+ reactant_column: null
7
+ product_column: null
8
+ reagent_column: null
9
+ split_column: set
10
+ id_column: null
11
+ default_split: null
12
+ separator: ','
13
+ remove_atom_maps: true
datasets/absynth/raw/absynth_full_filtered_classed.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e207a3e91d18a81c997279a079e49b6340cc7fb3fce0bae5ec3f5801f2ce376
3
+ size 22652814
datasets/artifacts.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "files": [
3
+ {
4
+ "path": "datasets/absynth/raw/absynth_full_filtered_classed.csv",
5
+ "bytes": 22652814,
6
+ "sha256": "2e207a3e91d18a81c997279a079e49b6340cc7fb3fce0bae5ec3f5801f2ce376",
7
+ "provenance": "User-supplied local export; source-specific import recipe unverified."
8
+ },
9
+ {
10
+ "path": "datasets/uspto_mit/raw/molecular_transformer_data.zip",
11
+ "bytes": 276751431,
12
+ "sha256": "1724f48b07e1f8d3c7267ab50913c6e684750850a16fbb417961e8130350d0f7",
13
+ "source_url": "https://ibm.box.com/v/MolecularTransformerData"
14
+ }
15
+ ]
16
+ }
datasets/uspto_mit/README.md ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # USPTO-MIT
2
+
3
+ Download the public [Molecular Transformer archive](https://ibm.box.com/v/MolecularTransformerData)
4
+ and prepare its original, non-augmented `MIT_separated` splits:
5
+
6
+ ```bash
7
+ chemformer data download uspto-mit
8
+ chemformer data prepare-uspto-mit --workers 4
9
+ ```
10
+
11
+ Every command also works as `python -m chemformer_workflows ...`. Downloading uses
12
+ only Python's standard library; preparation needs pandas and RDKit. In the code
13
+ checkout, see `README.md` for runtime status and
14
+ `docs/uspto-mit-reproduction.md` for the reproduction procedure.
15
+
16
+ The downloader verifies the full archive before accepting it and reuses a valid
17
+ local copy. Downloading or preparing does not import the Chemformer model.
18
+
19
+ | Property | Pinned value |
20
+ | --- | --- |
21
+ | Box filename | `data.zip` |
22
+ | Box file / version | `344263095532` / `444624691904` |
23
+ | Size | 276,751,431 bytes |
24
+ | SHA-1 (Box metadata) | `18651da54b198a89207c137a92312d318547cdb9` |
25
+ | SHA-256 (verified download) | `1724f48b07e1f8d3c7267ab50913c6e684750850a16fbb417961e8130350d0f7` |
26
+ | Training / validation / test | 409,035 / 30,000 / 40,000 |
27
+
28
+ The archive is stored as `raw/molecular_transformer_data.zip`, alongside its
29
+ local download manifest. The Hugging Face artifact repository mirrors the ZIP
30
+ at the same relative path; `../artifacts.json` records its identity and original
31
+ Box source. Machine-specific download manifests and prepared outputs stay local.
32
+ If the automated Box URL stops working, download `data.zip`
33
+ from the public page, save it under that local name, and rerun the command to
34
+ verify its identity. A changed archive fails verification and needs an explicit
35
+ review of the pinned release.
36
+
37
+ The importer reads only `data/MIT_separated/{src,tgt}-{train,val,test}.txt`.
38
+ It removes tokenization whitespace, parses `reactants>reagents` and products,
39
+ removes atom maps, and preserves every source row and published split. Invalid
40
+ chemistry, unequal source/target lengths, or changed split sizes fail preparation.
41
+ It does not extract arbitrary ZIP paths. The
42
+ [publisher's format description](https://github.com/pschwllr/MolecularTransformer#data)
43
+ distinguishes separated, mixed, and augmented variants. `MIT_mixed` still contains
44
+ reagents and must not be used for the reagent-free ablation. The `_augm` variants
45
+ must not be substituted for this benchmark.
46
+
47
+ The output `prepared/uspto_sep.pickle` contains ordinary RDKit molecules in
48
+ `reactants_mol`, `reagents_mol`, `products_mol`, and the `set` column. Both reagent
49
+ conditions use this same pickle; the chosen upstream data module controls whether
50
+ reagents enter the model. Existing Chemformer pickles remain supported unchanged.
51
+
52
+ Sidecars appended to the pickle filename:
53
+
54
+ - `.rows.csv`: original row, pickle row, and stable `split:line` source IDs.
55
+ - `.reactions.csv`: canonical SMILES, splits, and source IDs; convenient for analysis
56
+ without loading the larger molecule pickle.
57
+ - `.report.json`: archive/member/output checksums, library versions, counts, and
58
+ preparation settings.
59
+ - `.reagents.json`, `.reagent_groups.csv`, `.reagent_examples.csv`: measured
60
+ reagent-association statistics and supporting rows.
61
+
62
+ `raw/` and `prepared/` are ignored by Git. The data and generated reports are not
63
+ included in distributions. Follow the source's usage and citation terms; this
64
+ repository's code license does not grant additional rights to the dataset.
datasets/uspto_mit/dataset.yaml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ dataset: uspto_mit
2
+ status: verified-public-archive
3
+ source:
4
+ url: https://ibm.box.com/v/MolecularTransformerData
5
+ variant: MIT_separated
6
+ augmented: false
7
+ download_command: chemformer data download uspto-mit
8
+ prepare_command: chemformer data prepare-uspto-mit
9
+ # The generic mapping below is for existing exports. The fixed benchmark archive
10
+ # uses its dedicated, strictly validated importer.
11
+ import:
12
+ input_mode: separated
13
+ reaction_column: rxn_smiles
14
+ reactant_column: null
15
+ product_column: null
16
+ reagent_column: null
17
+ split_column: set
18
+ id_column: null
19
+ default_split: null
20
+ separator: ','
21
+ remove_atom_maps: true
datasets/uspto_mit/raw/molecular_transformer_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1724f48b07e1f8d3c7267ab50913c6e684750850a16fbb417961e8130350d0f7
3
+ size 276751431
datasets/uspto_synplanner/README.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # uspto_synplanner
2
+
3
+ Import recipe is a configurable placeholder. Obtain a representative export and confirm its columns and published splits before using it for training; source-specific support has not been validated.
4
+
5
+ Keep source files in `raw/` and derived pickles/reports in `prepared/`; both are ignored.
6
+ Record the dataset release, source URL, acquisition date, and applicable usage terms here when selecting a source.
7
+ Edit `dataset.yaml` to match the export. Paths are passed explicitly to the CLI.
datasets/uspto_synplanner/dataset.yaml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ dataset: uspto_synplanner
2
+ status: unverified-export
3
+ import:
4
+ input_mode: reactants
5
+ reaction_column: rxn_smiles
6
+ reactant_column: null
7
+ product_column: null
8
+ reagent_column: null
9
+ split_column: set
10
+ id_column: null
11
+ default_split: null
12
+ separator: ','
13
+ remove_atom_maps: true
models/README.md ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Model artifacts
2
+
3
+ - `uspto_mit/`: reserved for USPTO-MIT models.
4
+ - `uspto_synplanner/random/`: reserved for the SynPlanner random-split experiment.
5
+ - `uspto_synplanner/harsh/`: reserved for the SynPlanner harsh-split experiment.
6
+ - `uncertain/`: the four original repository files, preserved without changing
7
+ their contents. The checkpoint training dataset and reagent condition are
8
+ unverified, so it has not been assigned to an experiment folder.
9
+
10
+ The original `.gitattributes` is preserved in `uncertain/`. A root copy continues
11
+ handling large files for this repository. The original model card is also
12
+ preserved in `uncertain/README.md`; the root card describes the new organization.
models/uncertain/.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
models/uncertain/README.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ ---
2
+ license: mit
3
+ ---
hparams.yaml → models/uncertain/hparams.yaml RENAMED
File without changes
last.ckpt → models/uncertain/last.ckpt RENAMED
File without changes
models/uspto_mit/README.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # uspto_mit
2
+
3
+ Reserved for USPTO-MIT model checkpoints. No checkpoint has been assigned to this dataset yet.
models/uspto_synplanner/README.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # uspto_synplanner
2
+
3
+ Reserved for models trained on USPTO-SynPlanner. Use random/ and harsh/ for the respective split experiments.
models/uspto_synplanner/harsh/README.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # uspto_synplanner/harsh
2
+
3
+ Reserved for the USPTO-SynPlanner harsh-split experiment. No checkpoint is available yet.
models/uspto_synplanner/random/README.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # uspto_synplanner/random
2
+
3
+ Reserved for the USPTO-SynPlanner random-split experiment. No checkpoint is available yet.