Skip to content

feat(training): GRAS cross-check from FDA SAF (public domain) - #57

Merged
rvnminers-A-and-N merged 1 commit into
mainfrom
feat/gras-fda-saf-fetcher
Jun 29, 2026
Merged

rvnminers-A-and-N merged 1 commit into
mainfrom
feat/gras-fda-saf-fetcher

Conversation

@rvnminers-A-and-N

Copy link
Copy Markdown
Collaborator

The second clean data win — built and tested.

The FDA "Substances Added to Food" (SAF) inventory is a US-government work in the public domain. training/build_gras_reference.py downloads it, parses the cp1252 CSV (4-line preamble, comma-delimited), extracts CAS numbers, resolves them to InChIKey via PubChem, and writes gras_reference.parquet — the table predict.py cross-checks for "is this a recognized food ingredient at all?" (a defensive signal, never a clearance).

Tested live on the real SAF: 3,971 rows → 3,969 valid CAS, resolving correctly (styrene → PPBRXRYQALVLMV…, etc.; the few misses are obscure extracts with no single structure). ruff clean. Full build ~20 min; data is gitignored, only the fetcher is committed.

With this, both data-gated features that can be filled with commercial-clean data are now buildable: measured BP/VP (PubChem, #56) and GRAS (FDA SAF). Quantitative dosing + RI remain customer/licensed (documented).

…AF (public domain)

The second clean data win. The FDA "Substances Added to Food" (SAF) inventory is a
US-government work in the public domain; build_gras_reference.py downloads it, parses
the cp1252 CSV, extracts CAS numbers, resolves them to InChIKey via PubChem, and writes
gras_reference.parquet — the table predict.py cross-checks for "is this a recognized
food ingredient?" (defensive signal, never a clearance).

Tested end-to-end on the live SAF: 3,971 rows -> 3,969 valid CAS, resolving cleanly
(styrene, anisole, benzyl alcohol, ...). Full build ~20 min, run locally; data is
gitignored, only the fetcher is committed.

Signed-off-by: Austin L. <86896075+rvnminers-A-and-N@users.noreply.github.com>
@rvnminers-A-and-N
rvnminers-A-and-N merged commit b415d43 into main Jun 29, 2026
3 checks passed
@rvnminers-A-and-N
rvnminers-A-and-N deleted the feat/gras-fda-saf-fetcher branch June 29, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant