Matthew Ford commited on
Commit
e6d699c
·
1 Parent(s): ca7335c

feat: expand substitution-triplet benchmark 8 -> 20

Browse files

Mine material_profiles (molequles) for trade-name -> SMILES in
load_trade_name_structures, in addition to the empirical corpus formula names.
Resolves proprietary trade materials (Isobutavan, Canthoxal, Neofolione,
Indocolore, Centifolether, Romandolide, etc.) that were previously dropped as
no_identity. Admission count 8 -> 20; all 12 new triplets carry authoritative
Fraterworks preference provenance + verified structural discordance.


Former-commit-id: e00c75ca7f7517f897ed01f53f6465f349a8671c
Former-commit-id: 63b884e7d2ee946a6eb700f450a86fea4cf9609b

data/benchmarks/substitution_triplets/manifest.json CHANGED
@@ -11,13 +11,13 @@
11
  "preference_provenance"
12
  ]
13
  },
14
- "admitted_triplet_count": 8,
15
  "coverage_note": "Most supplier substitutions involve naturals or proprietary bases without a single-structure identity, so the admissible set is bounded by structural identity on both arms. 8 triplets is the honest, verifiable set from this corpus; expand with expert-rated perceptual preferences for publication scale.",
16
  "label_access": "evaluation_only; forbidden in training and model selection",
17
  "schema_version": 1,
18
  "skipped": {
19
- "no_distractor": 2,
20
- "no_identity": 73
21
  },
22
  "status": "complete"
23
  }
 
11
  "preference_provenance"
12
  ]
13
  },
14
+ "admitted_triplet_count": 20,
15
  "coverage_note": "Most supplier substitutions involve naturals or proprietary bases without a single-structure identity, so the admissible set is bounded by structural identity on both arms. 8 triplets is the honest, verifiable set from this corpus; expand with expert-rated perceptual preferences for publication scale.",
16
  "label_access": "evaluation_only; forbidden in training and model selection",
17
  "schema_version": 1,
18
  "skipped": {
19
+ "no_distractor": 3,
20
+ "no_identity": 60
21
  },
22
  "status": "complete"
23
  }
data/benchmarks/substitution_triplets/report.md CHANGED
@@ -1,7 +1,7 @@
1
  # Discordant substitution triplets
2
 
3
- Status: **complete**. Admitted **8** triplets.
4
 
5
- Skipped: {'no_identity': 73, 'no_distractor': 2}.
6
 
7
  Each triplet encodes a supplier-attested perceptual preference whose structurally-closest alternative disagrees — the case where Morgan-style structural ranking fails and perceptual representations (POM) should win.
 
1
  # Discordant substitution triplets
2
 
3
+ Status: **complete**. Admitted **20** triplets.
4
 
5
+ Skipped: {'no_identity': 60, 'no_distractor': 3}.
6
 
7
  Each triplet encodes a supplier-attested perceptual preference whose structurally-closest alternative disagrees — the case where Morgan-style structural ranking fails and perceptual representations (POM) should win.
data/benchmarks/substitution_triplets/triplets.jsonl CHANGED
@@ -1,8 +1,20 @@
1
- {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Alternative to virtually prohibited Lilial and Lyral; muguet volume/structure.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Lilyflore product note", "source_url": "https://fraterworks.com/products/lilyflore"}, "preferred_cas": "285977-85-7", "preferred_structural_key": "285977-85-7", "preferred_substitute": "Lilyflore", "structural": {"discordance": 0.1131, "same_class_distractor": true, "tanimoto_target_distractor": 0.2195, "tanimoto_target_preferred": 0.1064, "target_class": "M"}, "structural_distractor_cas": "SMILES:CC(CC=O)CCCC(C)(C)O", "target": "Lilial", "target_cas": "80-54-6", "triplet_id": "triplet_0000"}
2
- {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Alternative to virtually prohibited Lilial and Lyral.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Lilyflore product note", "source_url": "https://fraterworks.com/products/lilyflore"}, "preferred_cas": "285977-85-7", "preferred_structural_key": "285977-85-7", "preferred_substitute": "Lilyflore", "structural": {"discordance": 0.2377, "same_class_distractor": true, "tanimoto_target_distractor": 0.3488, "tanimoto_target_preferred": 0.1111, "target_class": "M"}, "structural_distractor_cas": "SMILES:CC(CC=O)CCCC(C)(C)O", "target": "Lyral", "target_cas": "31906-04-4", "triplet_id": "triplet_0001"}
3
- {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Softer alternative to Linalool with bergamot/lavender floral facets.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Ethyl Linalool product note", "source_url": "https://fraterworks.com/products/ethyl-linalool"}, "preferred_cas": "10339-55-6", "preferred_structural_key": "10339-55-6", "preferred_substitute": "Ethyl Linalool", "structural": {"discordance": 0.2963, "same_class_distractor": false, "tanimoto_target_distractor": 1.0, "tanimoto_target_preferred": 0.7037, "target_class": "L"}, "structural_distractor_cas": "126-90-9", "target": "Linalool", "target_cas": "78-70-6", "triplet_id": "triplet_0002"}
4
- {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Stable alternative to traditional anisic aldehydes.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Canthoxal product note", "source_url": "https://fraterworks.com/products/canthoxal"}, "preferred_cas": "5462-06-6", "preferred_structural_key": "5462-06-6", "preferred_substitute": "Canthoxal", "structural": {"discordance": 0.0701, "same_class_distractor": true, "tanimoto_target_distractor": 0.5217, "tanimoto_target_preferred": 0.4516, "target_class": "F"}, "structural_distractor_cas": "SMILES:Cc1ccc(C=O)cc1", "target": "Anisic aldehyde", "target_cas": "123-11-5", "triplet_id": "triplet_0003"}
5
- {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Patchone is documented as a patchouli modifier or replacement.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks 4-tert-butylcyclohexanol product note", "source_url": "https://fraterworks.com/products/patchone"}, "preferred_cas": null, "preferred_structural_key": "SMILES:CC(C)(C)C1CCC(O)CC1", "preferred_substitute": "4-tert-butylcyclohexanol", "structural": {"discordance": 0.8684, "same_class_distractor": true, "tanimoto_target_distractor": 1.0, "tanimoto_target_preferred": 0.1316, "target_class": "W"}, "structural_distractor_cas": "5986-55-0", "target": "Patchouli", "target_cas": "8014-09-3", "triplet_id": "triplet_0004"}
6
- {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Ethyl phenyl acetate is documented as a softer replacement for methyl phenyl acetate.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks ethyl phenylacetate product note", "source_url": "https://fraterworks.com/products/ethyl-phenyl-acetate"}, "preferred_cas": null, "preferred_structural_key": "SMILES:CCOC(=O)Cc1ccccc1", "preferred_substitute": "ethyl phenylacetate", "structural": {"discordance": 0.3571, "same_class_distractor": false, "tanimoto_target_distractor": 1.0, "tanimoto_target_preferred": 0.6429, "target_class": null}, "structural_distractor_cas": "SMILES:COC(=O)Cc1ccccc1", "target": "Methyl phenylacetate", "target_cas": null, "triplet_id": "triplet_0005"}
7
- {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Supplier discusses tetrahydrogeraniol as a stable geraniol substitute, while noting added character.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks 3,7-dimethyloctan-1-ol product note", "source_url": "https://fraterworks.com/products/tetrahydrogeraniol"}, "preferred_cas": null, "preferred_structural_key": "SMILES:CC(C)CCCC(C)CCO", "preferred_substitute": "3,7-dimethyloctan-1-ol", "structural": {"discordance": 0.8288, "same_class_distractor": true, "tanimoto_target_distractor": 0.95, "tanimoto_target_preferred": 0.1212, "target_class": "F"}, "structural_distractor_cas": "4602-84-0", "target": "Geraniol", "target_cas": "106-24-1", "triplet_id": "triplet_0006"}
8
- {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Documented alternative to cedarwood in floral bases.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Cedryl acetate product note", "source_url": "https://fraterworks.com/products/cedryl-acetate-crystals"}, "preferred_cas": "5986-38-9", "preferred_structural_key": "SMILES:CC(=O)OC1(C)CCC23CC1C(C)(C)[C@@H]2CC[C@H]3C", "preferred_substitute": "Cedryl acetate", "structural": {"discordance": 0.0387, "same_class_distractor": true, "tanimoto_target_distractor": 0.6176, "tanimoto_target_preferred": 0.5789, "target_class": "W"}, "structural_distractor_cas": "19870-74-7", "target": "Cedarwood Virginia", "target_cas": "8000-27-9", "triplet_id": "triplet_0007"}
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Non-discolouring alternative to vanillin for soap; vanillic gourmand profile.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Isobutavan product note", "source_url": "https://fraterworks.com/products/isobutavan"}, "preferred_cas": "20665-85-4", "preferred_structural_key": "20665-85-4", "preferred_substitute": "Isobutavan", "structural": {"discordance": 0.4595, "same_class_distractor": true, "tanimoto_target_distractor": 1.0, "tanimoto_target_preferred": 0.5405, "target_class": "V"}, "structural_distractor_cas": "SMILES:COc1cc(C=O)ccc1O", "target": "Vanillin", "target_cas": "121-33-5", "triplet_id": "triplet_0000"}
2
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Alternative to virtually prohibited Lilial and Lyral; muguet volume/structure.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Lilyflore product note", "source_url": "https://fraterworks.com/products/lilyflore"}, "preferred_cas": "285977-85-7", "preferred_structural_key": "285977-85-7", "preferred_substitute": "Lilyflore", "structural": {"discordance": 0.1131, "same_class_distractor": true, "tanimoto_target_distractor": 0.2195, "tanimoto_target_preferred": 0.1064, "target_class": "M"}, "structural_distractor_cas": "SMILES:CC(CC=O)CCCC(C)(C)O", "target": "Lilial", "target_cas": "80-54-6", "triplet_id": "triplet_0001"}
3
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Alternative to virtually prohibited Lilial and Lyral.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Lilyflore product note", "source_url": "https://fraterworks.com/products/lilyflore"}, "preferred_cas": "285977-85-7", "preferred_structural_key": "285977-85-7", "preferred_substitute": "Lilyflore", "structural": {"discordance": 0.2377, "same_class_distractor": true, "tanimoto_target_distractor": 0.3488, "tanimoto_target_preferred": 0.1111, "target_class": "M"}, "structural_distractor_cas": "SMILES:CC(CC=O)CCCC(C)(C)O", "target": "Lyral", "target_cas": "31906-04-4", "triplet_id": "triplet_0002"}
4
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Softer alternative to Linalool with bergamot/lavender floral facets.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Ethyl Linalool product note", "source_url": "https://fraterworks.com/products/ethyl-linalool"}, "preferred_cas": "10339-55-6", "preferred_structural_key": "10339-55-6", "preferred_substitute": "Ethyl Linalool", "structural": {"discordance": 0.2963, "same_class_distractor": false, "tanimoto_target_distractor": 1.0, "tanimoto_target_preferred": 0.7037, "target_class": "L"}, "structural_distractor_cas": "126-90-9", "target": "Linalool", "target_cas": "78-70-6", "triplet_id": "triplet_0003"}
5
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Stable alternative to traditional anisic aldehydes.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Canthoxal product note", "source_url": "https://fraterworks.com/products/canthoxal"}, "preferred_cas": "5462-06-6", "preferred_structural_key": "5462-06-6", "preferred_substitute": "Canthoxal", "structural": {"discordance": 0.0701, "same_class_distractor": true, "tanimoto_target_distractor": 0.5217, "tanimoto_target_preferred": 0.4516, "target_class": "F"}, "structural_distractor_cas": "SMILES:Cc1ccc(C=O)cc1", "target": "Anisic aldehyde", "target_cas": "123-11-5", "triplet_id": "triplet_0004"}
6
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "100% natural alternative to synthetics like BHT for antioxidant preservation role.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Tocopherol product note", "source_url": "https://fraterworks.com/products/tocopherol"}, "preferred_cas": "59-02-9", "preferred_structural_key": "59-02-9", "preferred_substitute": "Tocopherol", "structural": {"discordance": 0.1817, "same_class_distractor": true, "tanimoto_target_distractor": 0.2188, "tanimoto_target_preferred": 0.037, "target_class": "B"}, "structural_distractor_cas": "SMILES:CC(=O)c1ccc(C)cc1C", "target": "BHT", "target_cas": "128-37-0", "triplet_id": "triplet_0005"}
7
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Methyl nonyl ketone is documented as an affordable orris replacement or extender.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks 2-undecanone product note", "source_url": "https://fraterworks.com/products/methyl-nonyl-ketone"}, "preferred_cas": null, "preferred_structural_key": "SMILES:CCCCCCCCCC(C)=O", "preferred_substitute": "2-undecanone", "structural": {"discordance": 0.0913, "same_class_distractor": true, "tanimoto_target_distractor": 0.2075, "tanimoto_target_preferred": 0.1163, "target_class": "U"}, "structural_distractor_cas": "SMILES:CC(=O)OC1(C)CCC23CC1C(C)(C)[C@@H]2CC[C@H]3C", "target": "Orris butter", "target_cas": "8002-73-1", "triplet_id": "triplet_0006"}
8
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Patchone is documented as a patchouli modifier or replacement.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks 4-tert-butylcyclohexanol product note", "source_url": "https://fraterworks.com/products/patchone"}, "preferred_cas": null, "preferred_structural_key": "SMILES:CC(C)(C)C1CCC(O)CC1", "preferred_substitute": "4-tert-butylcyclohexanol", "structural": {"discordance": 0.8684, "same_class_distractor": true, "tanimoto_target_distractor": 1.0, "tanimoto_target_preferred": 0.1316, "target_class": "W"}, "structural_distractor_cas": "5986-55-0", "target": "Patchouli", "target_cas": "8014-09-3", "triplet_id": "triplet_0007"}
9
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Direct substitute for benzyl salicylate where allergen labelling is a concern.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Sakura Salicylate product note", "source_url": "https://fraterworks.com/products/sakura-salicylate"}, "preferred_cas": null, "preferred_structural_key": "79915-74-5", "preferred_substitute": "Sakura Salicylate", "structural": {"discordance": 0.0987, "same_class_distractor": false, "tanimoto_target_distractor": 0.625, "tanimoto_target_preferred": 0.5263, "target_class": "N"}, "structural_distractor_cas": "118-61-6", "target": "Benzyl salicylate", "target_cas": "118-58-1", "triplet_id": "triplet_0008"}
10
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Documented modern replacement for restricted methyl heptine carbonate.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Neofolione product note", "source_url": "https://fraterworks.com/products/neofolione"}, "preferred_cas": null, "preferred_structural_key": "111-79-5", "preferred_substitute": "Neofolione", "structural": {"discordance": 0.6389, "same_class_distractor": false, "tanimoto_target_distractor": 1.0, "tanimoto_target_preferred": 0.3611, "target_class": null}, "structural_distractor_cas": "SMILES:CCCCCC#CC(=O)OC", "target": "Methyl heptine carbonate", "target_cas": null, "triplet_id": "triplet_0009"}
11
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Direct replacement for indole where colour matters.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Indocolore product note", "source_url": "https://fraterworks.com/products/indocolore"}, "preferred_cas": null, "preferred_structural_key": "2206-94-2", "preferred_substitute": "Indocolore", "structural": {"discordance": 0.1164, "same_class_distractor": true, "tanimoto_target_distractor": 0.2593, "tanimoto_target_preferred": 0.1429, "target_class": "U"}, "structural_distractor_cas": "SMILES:c1ccc2ncccc2c1", "target": "Indole", "target_cas": "120-72-9", "triplet_id": "triplet_0010"}
12
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Documented rose-oxide enhancer or substitute with improved stability.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Centifolether product note", "source_url": "https://fraterworks.com/products/centifolether"}, "preferred_cas": null, "preferred_structural_key": "120811-92-9", "preferred_substitute": "Centifolether", "structural": {"discordance": 0.9783, "same_class_distractor": false, "tanimoto_target_distractor": 1.0, "tanimoto_target_preferred": 0.0217, "target_class": null}, "structural_distractor_cas": "16409-43-1", "target": "Rose oxide", "target_cas": null, "triplet_id": "triplet_0011"}
13
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Ethyl phenyl acetate is documented as a softer replacement for methyl phenyl acetate.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks ethyl phenylacetate product note", "source_url": "https://fraterworks.com/products/ethyl-phenyl-acetate"}, "preferred_cas": null, "preferred_structural_key": "SMILES:CCOC(=O)Cc1ccccc1", "preferred_substitute": "ethyl phenylacetate", "structural": {"discordance": 0.3571, "same_class_distractor": false, "tanimoto_target_distractor": 1.0, "tanimoto_target_preferred": 0.6429, "target_class": null}, "structural_distractor_cas": "SMILES:COC(=O)Cc1ccccc1", "target": "Methyl phenylacetate", "target_cas": null, "triplet_id": "triplet_0012"}
14
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Documented as functioning more like a coumarin replacement than a coconut material.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Delta Nonalactone product note", "source_url": "https://fraterworks.com/products/delta-nonalactone"}, "preferred_cas": null, "preferred_structural_key": "3301-94-8", "preferred_substitute": "Delta Nonalactone", "structural": {"discordance": 0.107, "same_class_distractor": true, "tanimoto_target_distractor": 0.2, "tanimoto_target_preferred": 0.093, "target_class": "V"}, "structural_distractor_cas": "SMILES:CC(=O)c1ccccc1", "target": "Coumarin", "target_cas": "91-64-5", "triplet_id": "triplet_0013"}
15
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Documented direct replacement for polycyclic musks such as Galaxolide.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Romandolide product note", "source_url": "https://fraterworks.com/products/romandolide%C2%AE"}, "preferred_cas": null, "preferred_structural_key": "236391-76-7", "preferred_substitute": "Romandolide", "structural": {"discordance": 0.0023, "same_class_distractor": true, "tanimoto_target_distractor": 0.0816, "tanimoto_target_preferred": 0.0794, "target_class": "X"}, "structural_distractor_cas": "7779-50-2", "target": "Galaxolide", "target_cas": "1222-05-5", "triplet_id": "triplet_0014"}
16
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Supplier discusses tetrahydrogeraniol as a stable geraniol substitute, while noting added character.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks 3,7-dimethyloctan-1-ol product note", "source_url": "https://fraterworks.com/products/tetrahydrogeraniol"}, "preferred_cas": null, "preferred_structural_key": "SMILES:CC(C)CCCC(C)CCO", "preferred_substitute": "3,7-dimethyloctan-1-ol", "structural": {"discordance": 0.8288, "same_class_distractor": true, "tanimoto_target_distractor": 0.95, "tanimoto_target_preferred": 0.1212, "target_class": "F"}, "structural_distractor_cas": "4602-84-0", "target": "Geraniol", "target_cas": "106-24-1", "triplet_id": "triplet_0015"}
17
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Documented alternative to vanillin, with a shared discolouration caveat.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Veratraldehyde product note", "source_url": "https://fraterworks.com/products/veratraldehyde"}, "preferred_cas": null, "preferred_structural_key": "120-14-9", "preferred_substitute": "Veratraldehyde", "structural": {"discordance": 0.3214, "same_class_distractor": true, "tanimoto_target_distractor": 1.0, "tanimoto_target_preferred": 0.6786, "target_class": "V"}, "structural_distractor_cas": "SMILES:COc1cc(C=O)ccc1O", "target": "Vanillin", "target_cas": "121-33-5", "triplet_id": "triplet_0016"}
18
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Documented replacer for dihydrocoumarin where it is prohibited.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Bicyclononalactone product note", "source_url": "https://fraterworks.com/products/bicyclononalactone"}, "preferred_cas": null, "preferred_structural_key": "4430-31-3", "preferred_substitute": "Bicyclononalactone", "structural": {"discordance": 0.8108, "same_class_distractor": false, "tanimoto_target_distractor": 1.0, "tanimoto_target_preferred": 0.1892, "target_class": null}, "structural_distractor_cas": "SMILES:O=C1CCc2ccccc2O1", "target": "Dihydrocoumarin", "target_cas": null, "triplet_id": "triplet_0017"}
19
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Documented interesting alternative to coumarin in a classic fougere.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Bicyclononalactone product note", "source_url": "https://fraterworks.com/products/bicyclononalactone"}, "preferred_cas": null, "preferred_structural_key": "4430-31-3", "preferred_substitute": "Bicyclononalactone", "structural": {"discordance": 0.0947, "same_class_distractor": true, "tanimoto_target_distractor": 0.2, "tanimoto_target_preferred": 0.1053, "target_class": "V"}, "structural_distractor_cas": "SMILES:CC(=O)c1ccccc1", "target": "Coumarin", "target_cas": "91-64-5", "triplet_id": "triplet_0018"}
20
+ {"label_access": "evaluation_only", "preference_provenance": {"evidence": "Documented alternative to cedarwood in floral bases.", "provenance_flag": "authoritative-supplier-page", "source_name": "Fraterworks Cedryl acetate product note", "source_url": "https://fraterworks.com/products/cedryl-acetate-crystals"}, "preferred_cas": "5986-38-9", "preferred_structural_key": "SMILES:CC(=O)OC1(C)CCC23CC1C(C)(C)[C@@H]2CC[C@H]3C", "preferred_substitute": "Cedryl acetate", "structural": {"discordance": 0.0387, "same_class_distractor": true, "tanimoto_target_distractor": 0.6176, "tanimoto_target_preferred": 0.5789, "target_class": "W"}, "structural_distractor_cas": "19870-74-7", "target": "Cedarwood Virginia", "target_cas": "8000-27-9", "triplet_id": "triplet_0019"}
scripts/build_substitution_triplets.py CHANGED
@@ -66,32 +66,52 @@ def load_registry():
66
 
67
 
68
  def load_trade_name_structures():
69
- """Map trade/material names -> {cas, smiles} from the empirical corpus, so
70
- preferred substitutes given only as trade names (e.g. Lilyflore, Fauxmoss)
71
- can still get a structural identity. User-directed relaxation: allow trade
72
- names even when they lack a single registry CAS, provided the corpus gives
73
- them a parseable SMILES."""
 
74
  out = {}
75
  ds = ROOT / "data/empirical_dataset_v9_plus_wisemoor_clean.repaired.jsonl"
76
- if not ds.exists():
77
- return out
78
- with ds.open() as fh:
79
- for line in fh:
80
- try:
81
- rec = json.loads(line)
82
- except Exception:
83
- continue
84
- for it in rec.get("formula", []):
85
- if not isinstance(it, dict):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  continue
87
- nm = (it.get("name") or "").strip()
88
- cas = (it.get("cas") or "").strip()
89
- smi = (it.get("smiles") or "").strip()
90
- if not nm:
91
  continue
92
- key = nm.lower()
93
- if key not in out and (smi or (cas and not cas.startswith("SMILES:"))):
94
- out[key] = {"cas": cas or None, "smiles": smi or None, "name": nm}
 
 
 
95
  return out
96
 
97
 
 
66
 
67
 
68
  def load_trade_name_structures():
69
+ """Map trade/material names -> {cas, smiles} so preferred substitutes given
70
+ only as trade names (e.g. Lilyflore, Fauxmoss) can still get a structural
71
+ identity. Two sources, first-hit wins:
72
+ 1. the empirical corpus formula ingredient names;
73
+ 2. material_profiles (molequles), which carries name -> smiles/cas for many
74
+ proprietary trade materials absent from the corpus."""
75
  out = {}
76
  ds = ROOT / "data/empirical_dataset_v9_plus_wisemoor_clean.repaired.jsonl"
77
+ if ds.exists():
78
+ with ds.open() as fh:
79
+ for line in fh:
80
+ try:
81
+ rec = json.loads(line)
82
+ except Exception:
83
+ continue
84
+ for it in rec.get("formula", []):
85
+ if not isinstance(it, dict):
86
+ continue
87
+ nm = (it.get("name") or "").strip()
88
+ cas = (it.get("cas") or "").strip()
89
+ smi = (it.get("smiles") or "").strip()
90
+ if not nm:
91
+ continue
92
+ key = nm.lower()
93
+ if key not in out and (smi or (cas and not cas.startswith("SMILES:"))):
94
+ out[key] = {"cas": cas or None, "smiles": smi or None, "name": nm}
95
+
96
+ # material_profiles (molequles): richer trade-name -> structure coverage.
97
+ mp = ROOT / "data/material_profiles_v11_6.jsonl"
98
+ if mp.exists():
99
+ with mp.open() as fh:
100
+ for line in fh:
101
+ try:
102
+ rec = json.loads(line)
103
+ except Exception:
104
  continue
105
+ smi = (rec.get("smiles") or "").strip()
106
+ cas = (rec.get("cas") or "").strip()
107
+ if not smi:
 
108
  continue
109
+ for k in ("name", "material", "material_name"):
110
+ nm = rec.get(k)
111
+ if isinstance(nm, str) and nm.strip():
112
+ key = nm.strip().lower()
113
+ if key not in out:
114
+ out[key] = {"cas": cas or None, "smiles": smi, "name": nm.strip()}
115
  return out
116
 
117