Skip to content

Commit fd0a41b

Browse files
feat(data): add clean PlantMolecularTasteDB loader; document FartDB exclusion
Diligence on richer taste data, with the licensing line held: - EXCLUDE FartDB (HuggingFace, ~31k tastants, the largest public set): MIT badge over a composite of FlavorDB (CC-BY-NC-SA) + SciFinder (CAS, proprietary) + Tas2R-DB (ACS). The badge can't relicense data FartLabs doesn't own — the same trap as OpenPOM's GS-LF. Documented in SOURCES.md / DATA-SOURCES.md. - ADD PlantMolecularTasteDB (Gradinaru 2022, Frontiers Pharmacol., CC-BY): taste- active phytochemicals — clean, and exactly the natural-product space a flavor house cares about. `load_pmtdb` wired into build_taste_dataset.py, reusing the tolerant `_find` + `parse_taste_column` logic (skips cleanly until the file is dropped in; columns marked [VERIFY] per issue #25). No data committed (gitignored as always); this readies the next clean taste source for a drop-in retrain. Signed-off-by: Austin L. <86896075+rvnminers-A-and-N@users.noreply.github.com>
1 parent 52dedf3 commit fd0a41b

3 files changed

Lines changed: 43 additions & 3 deletions

File tree

docs/DATA-SOURCES.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ What feeds the models, what each source unlocks, its license, and how to get it.
1212
| Source | Unlocks | License | Status | How to get |
1313
|--------|---------|---------|--------|-----------|
1414
| **ChemTastesDB v2.0** | sweet/bitter/umami training + sour/salty rule data (primary) | CC-BY-4.0 | ✅ in use | Zenodo record `14963136`, direct download (see `training/SETUP.md`). Column mapping verified. |
15+
| **PlantMolecularTasteDB** | more sweet/bitter/umami/sour — **natural-product / phytochemical** tastants (complements ChemTastesDB; squarely a flavor house's world) | **CC-BY** (Frontiers 2022 article + supplementary) | 🟡 candidate (clean) | Gradinaru et al., *Front. Pharmacol.* `10.3389/fphar.2021.751712` — supplementary data (CC-BY) → `pmtdb_taste.csv` (SMILES + taste). `load_pmtdb` merges it; verify columns/provenance on obtain (#25). |
16+
| **FartDB** | largest public tastant set (~31k molecules) | **MIT badge — composite NOT clean** |**excluded** | HuggingFace `FartLabs/FartDB` is labeled MIT, but it composites **FlavorDB (CC-BY-NC-SA)** + **SciFinder (CAS, proprietary)** + Tas2R-DB (ACS). The MIT badge can't relicense data FartLabs doesn't own — the **OpenPOM GS-LF trap again**. NonCommercial/proprietary upstream → not usable commercially. |
1517
| **cosylab/bittersweet** | more sweet/bitter volume | AGPL-3.0 | ⬜ to get | `git clone github.com/cosylabiiit/bittersweet``bittersweet/data/*.tsv`. AGPL: keep a CC-BY-clean build with `INCLUDE_COSYLAB=False`, or opt in deliberately. |
1618
| **FlavorDB** | ~25k molecules taste+odor + natural-source mapping | **CC BY-NC-SA 3.0** | ❌ skip | NonCommercial — incompatible with a commercial product. |
1719
| **UMP442 / BIOPEP-UWM** | more umami examples | none / unclear | ❌ skip | BIOPEP-UWM is web-only; the `Shoombuatong/Dataset-Code` repost has **no LICENSE** (all-rights-reserved) and is umami *peptide* data (different class from our small-molecule head). |
@@ -29,8 +31,11 @@ What feeds the models, what each source unlocks, its license, and how to get it.
2931
loaders (the `[VERIFY]` markers) — see issue **#25**. ChemTastesDB's mapping is
3032
resolved (both the coarse `Class taste` and the granular `Taste` columns are parsed).
3133
- **Suggested priority.** (1) `Taste`-column mining — **done** ✅ → (2) SweetenersDB
32-
intensity head — **done** ✅ → (3) aroma model (see the data caveat below) →
33-
(4) cosylab — **skip** (AGPL). **FlavorDB is CC BY-NC-SA (NonCommercial) — skip.**
34+
intensity head — **done** ✅ → (3) **PlantMolecularTasteDB** (CC-BY phytochemicals —
35+
the next clean taste add; loader wired, just obtain the file) → (4) aroma model (see
36+
the data caveat below) → (5) cosylab — **skip** (AGPL). **FlavorDB is CC BY-NC-SA
37+
(NonCommercial) — skip. FartDB (~31k) is excluded — MIT badge over an NC/proprietary
38+
composite (FlavorDB + SciFinder); the same "downloadable ≠ usable" trap as GS-LF.**
3439
- **Aroma data — COMMERCIAL-CLEAN ONLY (decision).** Every *rich* odor-descriptor set
3540
(Leffingwell, GoodScents, Arctander, Flavornet © Datu Inc., FlavorDB / FooDB NC) is
3641
restricted or NonCommercial — **we do NOT use any of them, not even for the demo**,

docs/SOURCES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ record of provenance, not legal advice. Get an IP/OSS-license review before ship
3636
- **ChemTastesDB** — Rojas et al., curated taste dataset (sweet/bitter/umami/sour/salty/tasteless). Zenodo, DOI 10.5281/zenodo.5747393 (and the extended record). License **CC-BY-4.0** (commercially clean with attribution).
3737
- **cosylab BitterSweet** — Bagler lab (IIIT-Delhi). Code **AGPL-3.0** (bind-aware: train-your-own-on-data is the safe pattern; `INCLUDE_COSYLAB=False` drops it for clean licensing).
3838
- **FlavorDB** — Bagler lab (IIIT-Delhi); taste + odor + natural-source associations. License **CC BY-NC-SA 3.0** (NonCommercial) — incompatible with a commercial product; **not used**.
39+
- **FartDB** — FartLabs (HuggingFace), ~31k tastants behind the 2025 *npj Science of Food* "FART" model — the largest public tastant set. Repo labeled **MIT**, but it **composites FlavorDB (CC-BY-NC-SA) + SciFinder (CAS, proprietary) + Tas2R-DB (ACS)**; the MIT badge cannot relicense data the authors don't own. **Excluded** (NonCommercial/proprietary upstream) — the same "downloadable ≠ usable" trap as OpenPOM's GS-LF.
3940
- **SweetenersDB v2.0** — Bouysset et al. (2020) *Food Chem.*, building on Chéron et al. (2017); relative-to-sucrose sweetness *intensity* for the regressor. Released **MIT** by the authors' own lab (ChemSenSim, `github.com/chemosim-lab/SweetenersDB`) — the paywall is only on the journal article, not the authors' own data. **In use.**
41+
- **PlantMolecularTasteDB** — Gradinaru et al. (2022), *Frontiers in Pharmacology* (DOI 10.3389/fphar.2021.751712), **CC-BY**; taste-active phytochemicals (natural-product tastants). A clean candidate to extend the taste heads into the natural-product space a flavor house cares about — loader (`load_pmtdb`) wired; obtain the CC-BY supplementary and verify columns before merging.
4042
- **BitterDB** *(future)* — bitterness intensity, if/when added.
4143
- **UMP442 / BIOPEP-UWM** — umami references. BIOPEP-UWM is web-only; the GitHub repost `Shoombuatong/Dataset-Code` carries **no license** (all-rights-reserved) and is umami *peptide* data (a different class from our small-molecule head). **Not used.**
4244

training/build_taste_dataset.py

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@
99
Inputs (download what you have; loaders skip cleanly if a file is absent):
1010
- ChemTastesDB_database.xlsx Zenodo, CC-BY-4.0 10 classes, 4075 molecules
1111
- bittersweet/data/*.tsv cosylab, AGPL-3.0 sweet/bitter [optional]
12-
- flavordb_taste.csv FlavorDB export SMILES + taste [OBTAIN]
12+
- flavordb_taste.csv FlavorDB export SMILES + taste [OBTAIN — NC, skip]
13+
- pmtdb_taste.csv PlantMolecularTasteDB phytochemical taste[OBTAIN — CC-BY]
1314
- umami_list.csv UMP442/BIOPEP-UWM umami SMILES [OBTAIN]
1415
- sweeteners_db.csv Cheron SweetenersDB sweetness intensity[OBTAIN]
1516
17+
Note: FartDB (HuggingFace, ~31k tastants) looks tempting but is EXCLUDED — its MIT
18+
badge sits on a composite of FlavorDB (CC-BY-NC-SA) + SciFinder (proprietary), which
19+
the badge cannot relicense (same trap as OpenPOM's GS-LF). See docs/DATA-SOURCES.md.
20+
1621
Outputs:
1722
- taste_master.parquet inchikey, smiles, {sweet,bitter,umami,sour,salty}=1/0/NaN,
1823
multitaste flag, n_sources
@@ -42,6 +47,7 @@
4247
FLAVORDB_CSV = Path("flavordb_taste.csv")
4348
UMAMI_CSV = Path("umami_list.csv")
4449
SWEETENERS_CSV = Path("sweeteners_db.csv")
50+
PMTDB_CSV = Path("pmtdb_taste.csv")
4551

4652

4753
def canon(smiles):
@@ -227,6 +233,32 @@ def load_flavordb(path):
227233
return pd.DataFrame(rows)
228234

229235

236+
def load_pmtdb(path):
237+
"""PlantMolecularTasteDB (Gradinaru et al. 2022, Frontiers Pharmacol., CC-BY) —
238+
taste-active PHYTOCHEMICALS (natural products), complementing ChemTastesDB with
239+
the natural-product space a flavor house cares about. SMILES + a taste descriptor
240+
column parsed onto the basic tastes; non-basic descriptors (astringent/pungent/
241+
cooling) are ignored (chemesthesis, not basic taste).
242+
[VERIFY columns against the exported supplementary file — see issue #25.]
243+
"""
244+
if not path.exists():
245+
print(" [skip] pmtdb")
246+
return pd.DataFrame()
247+
df = pd.read_csv(path)
248+
sc = _find(df, ["smiles", "canonical smiles", "isomeric smiles"])
249+
tc = _find(df, ["taste", "tastes", "taste class", "class", "taste_modality"])
250+
rows = []
251+
for _, r in df.iterrows():
252+
ik, cs = canon(r[sc])
253+
if ik is None:
254+
continue
255+
labels = parse_taste_column(r[tc])
256+
if labels:
257+
rows.append(_row(ik, cs, "pmtdb", labels))
258+
print(f" pmtdb: {len(rows)}")
259+
return pd.DataFrame(rows)
260+
261+
230262
def reconcile(df):
231263
def agg(s):
232264
v = s.dropna().values
@@ -266,6 +298,7 @@ def build_intensity(path):
266298
load_chemtastes(CHEMTASTES_XLSX),
267299
load_cosylab(COSYLAB_DIR),
268300
load_flavordb(FLAVORDB_CSV),
301+
load_pmtdb(PMTDB_CSV),
269302
load_single_taste_csv(UMAMI_CSV, "umami", "ump442"),
270303
]
271304
parts = [p for p in parts if not p.empty]

0 commit comments

Comments
 (0)