From cbee0e05b24b5e3878ad4a9acc58f50cc2a577d1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2026 17:19:10 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v6.0.0) - [github.com/psf/black-pre-commit-mirror: 24.4.2 → 26.5.1](https://github.com/psf/black-pre-commit-mirror/compare/24.4.2...26.5.1) - [github.com/astral-sh/ruff-pre-commit: v0.5.1 → v0.16.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.1...v0.16.0) - [github.com/rbubley/mirrors-prettier: v3.3.2 → v3.9.6](https://github.com/rbubley/mirrors-prettier/compare/v3.3.2...v3.9.6) - [github.com/google/yamlfmt: v0.13.0 → v0.21.0](https://github.com/google/yamlfmt/compare/v0.13.0...v0.21.0) - [github.com/pappasam/toml-sort: v0.23.1 → v0.24.4](https://github.com/pappasam/toml-sort/compare/v0.23.1...v0.24.4) - [github.com/codespell-project/codespell: v2.3.0 → v2.4.3](https://github.com/codespell-project/codespell/compare/v2.3.0...v2.4.3) - [github.com/sqlfluff/sqlfluff: 3.1.0 → 4.2.2](https://github.com/sqlfluff/sqlfluff/compare/3.1.0...4.2.2) - [github.com/hadolint/hadolint: v2.13.0-beta → v2.14.0](https://github.com/hadolint/hadolint/compare/v2.13.0-beta...v2.14.0) - [github.com/jsh9/markdown-toc-creator: 0.0.6 → 0.1.3](https://github.com/jsh9/markdown-toc-creator/compare/0.0.6...0.1.3) - [github.com/python-poetry/poetry: 1.8.0 → 2.4.1](https://github.com/python-poetry/poetry/compare/1.8.0...2.4.1) - [github.com/pre-commit/mirrors-mypy: v1.10.1 → v2.3.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.1...v2.3.0) - [github.com/srstevenson/nb-clean: 3.3.0 → 4.0.1](https://github.com/srstevenson/nb-clean/compare/3.3.0...4.0.1) - [github.com/abravalheri/validate-pyproject: v0.18 → v0.25](https://github.com/abravalheri/validate-pyproject/compare/v0.18...v0.25) --- .pre-commit-config.yaml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a794fa2f9..ff28e2d91 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ default_language_version: python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v6.0.0 hooks: - id: check-added-large-files - id: check-byte-order-marker @@ -21,20 +21,20 @@ repos: - id: trailing-whitespace exclude: .gitignore - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.4.2 + rev: 26.5.1 hooks: - id: black-jupyter - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.1 + rev: v0.16.0 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - repo: https://github.com/rbubley/mirrors-prettier - rev: v3.3.2 + rev: v3.9.6 hooks: - id: prettier - repo: https://github.com/google/yamlfmt - rev: v0.13.0 + rev: v0.21.0 hooks: - id: yamlfmt - repo: https://github.com/Yelp/detect-secrets @@ -42,25 +42,25 @@ repos: hooks: - id: detect-secrets - repo: https://github.com/pappasam/toml-sort - rev: v0.23.1 + rev: v0.24.4 hooks: - id: toml-sort-fix exclude: poetry.lock - repo: https://github.com/codespell-project/codespell - rev: v2.3.0 + rev: v2.4.3 hooks: - id: codespell additional_dependencies: [".[toml]"] - repo: https://github.com/sqlfluff/sqlfluff - rev: 3.1.0 + rev: 4.2.2 hooks: - id: sqlfluff-fix - repo: https://github.com/hadolint/hadolint - rev: v2.13.0-beta + rev: v2.14.0 hooks: - id: hadolint-docker - repo: https://github.com/jsh9/markdown-toc-creator - rev: 0.0.6 + rev: 0.1.3 hooks: - id: markdown-toc-creator - repo: https://github.com/jumanjihouse/pre-commit-hooks @@ -68,22 +68,22 @@ repos: hooks: - id: check-mailmap - repo: https://github.com/python-poetry/poetry - rev: 1.8.0 + rev: 2.4.1 hooks: - id: poetry-check - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.10.1 + rev: v2.3.0 hooks: - id: mypy additional_dependencies: - types-requests - repo: https://github.com/srstevenson/nb-clean - rev: 3.3.0 + rev: 4.0.1 hooks: - id: nb-clean args: [--preserve-cell-outputs, --remove-empty-cells] - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.18 + rev: v0.25 hooks: - id: validate-pyproject additional_dependencies: From 94d84a938ae0f1aa95171dc388220f2ea0050599 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2026 17:19:51 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- code_of_conduct.md | 22 ++ data/natural/preprocess_msds.py | 3 +- data/tabular/RedDB/transform.py | 64 ++--- data/tabular/SIDER/transform.py | 6 +- data/tabular/ames_mutagenicity/transform.py | 40 +-- data/tabular/bio_ner/transform.py | 2 +- .../bioavailability_ma_et_al/transform.py | 40 +-- .../transform.py | 48 ++-- data/tabular/buchwald_hartwig/transform.py | 2 +- data/tabular/carcinogens/transform.py | 40 +-- .../transform.py | 42 +-- data/tabular/chebi_20/transform.py | 22 +- .../tabular/chem_caption_smarts/preprocess.py | 1 + data/tabular/chem_caption_smarts/transform.py | 2 +- .../chemcaption_fragments/transform.py | 2 +- data/tabular/chemcaption_rdkit/preprocess.py | 2 +- data/tabular/chemcaption_rdkit/transform.py | 2 +- .../transform.py | 42 +-- data/tabular/clintox/transform.py | 44 +-- .../transform.py | 40 +-- .../transform.py | 40 +-- .../transform.py | 40 +-- .../transform.py | 42 +-- .../transform.py | 44 +-- .../transform.py | 42 +-- .../transform.py | 42 +-- .../transform.py | 42 +-- .../drug_induced_liver_injury/transform.py | 36 +-- .../fda_adverse_reactions/transform.py | 2 +- data/tabular/freesolv/transform.py | 62 ++-- data/tabular/half_life_obach/transform.py | 2 +- data/tabular/herg_blockers/transform.py | 38 +-- data/tabular/herg_central_inhib/transform.py | 38 +-- data/tabular/herg_karim_et_al/transform.py | 38 +-- data/tabular/hiv/transform.py | 42 +-- .../human_intestinal_absorption/transform.py | 40 +-- data/tabular/iupac_goldbook/transform.py | 24 +- .../transform.py | 42 +-- data/tabular/ld50_catmos/meta.yaml | 271 +++++++++--------- .../transform.py | 42 +-- .../transform.py | 42 +-- data/tabular/mol_repr_transl/transform.py | 24 +- .../example_processing_and_templates.ipynb | 19 +- data/tabular/mona/transform.py | 33 ++- data/tabular/nlmchem/transform.py | 16 +- data/tabular/nr_ahr_tox21/transform.py | 40 +-- data/tabular/nr_ar_lbd_tox21/transform.py | 40 +-- data/tabular/nr_ar_tox21/transform.py | 40 +-- data/tabular/nr_aromatase_tox21/transform.py | 40 +-- data/tabular/nr_er_lbd_tox21/transform.py | 40 +-- data/tabular/nr_er_tox21/transform.py | 40 +-- data/tabular/nr_ppar_gamma_tox21/transform.py | 40 +-- data/tabular/ocp/transform.py | 4 +- .../orbnet_denali/develop_transform.ipynb | 14 +- .../orexin1_receptor_butkiewicz/transform.py | 40 +-- .../transform.py | 40 +-- data/tabular/pampa_ncats/transform.py | 40 +-- data/tabular/peptides_hemolytic/transform.py | 40 +-- data/tabular/peptides_nonfouling/transform.py | 40 +-- data/tabular/peptides_soluble/transform.py | 40 +-- .../transform.py | 42 +-- .../sarscov2_3clpro_diamond/transform.py | 42 +-- .../sarscov2_vitro_touret/transform.py | 40 +-- .../transform.py | 40 +-- data/tabular/skin_reaction/transform.py | 38 +-- data/tabular/sr_are_tox21/transform.py | 40 +-- data/tabular/sr_atad5_tox21/transform.py | 44 +-- data/tabular/sr_hse_tox21/transform.py | 40 +-- data/tabular/sr_mmp_tox21/transform.py | 40 +-- data/tabular/sr_p53_tox21/transform.py | 40 +-- data/tabular/suzuki_miyaura_sach/transform.py | 2 +- data/tabular/train_test_split.py | 10 +- .../transform.py | 42 +-- .../transform.py | 2 +- data/text_sampling/preprocess_kg.py | 172 +++++------ data/text_sampling/text_sampling.py | 40 +-- data/train_test_split.py | 10 +- docs/CONTRIBUTING.md | 18 ++ docs/api/meta_yaml_augmentor.md | 20 ++ docs/api/meta_yaml_generator.md | 14 + docs/api/sampler.md | 23 ++ docs/api/sampler_cli.md | 26 ++ experiments/README.md | 13 + experiments/ablations/continued_pretrain.py | 41 ++- experiments/configs/data_configs/hf_data.yml | 2 +- experiments/data/prepare_gptneox_chemrxiv.py | 6 +- experiments/data/split_data.py | 2 +- experiments/scripts/run_tune.py | 2 +- src/chemnlp/data/constants.py | 30 +- src/chemnlp/data/meta_yaml_augmentor.py | 4 +- src/chemnlp/data/meta_yaml_generator.py | 5 +- src/chemnlp/data/sampler.py | 47 ++- src/chemnlp/data/sampler_cli.py | 20 +- src/chemnlp/data/split.py | 3 +- src/chemnlp/data/utils.py | 13 +- src/chemnlp/data_val/validate.py | 2 +- tests/data/test_sampler.py | 8 +- tests/data/test_sampler_cli.py | 8 +- tests/test_ner.py | 2 +- 99 files changed, 1623 insertions(+), 1477 deletions(-) diff --git a/code_of_conduct.md b/code_of_conduct.md index 8b4fcfd34..f6e93cd9e 100644 --- a/code_of_conduct.md +++ b/code_of_conduct.md @@ -1,5 +1,27 @@ # Contributor Covenant Code of Conduct + + +______________________________________________________________________ + +**Table of Contents** + +- [Our Pledge](#our-pledge) +- [Our Standards](#our-standards) +- [Enforcement Responsibilities](#enforcement-responsibilities) +- [Scope](#scope) +- [Enforcement](#enforcement) +- [Enforcement Guidelines](#enforcement-guidelines) + - [1. Correction](#1-correction) + - [2. Warning](#2-warning) + - [3. Temporary Ban](#3-temporary-ban) + - [4. Permanent Ban](#4-permanent-ban) +- [Attribution](#attribution) + +______________________________________________________________________ + + + ## Our Pledge We as members, contributors, and leaders pledge to make participation in our diff --git a/data/natural/preprocess_msds.py b/data/natural/preprocess_msds.py index 9669f0069..9d8157121 100644 --- a/data/natural/preprocess_msds.py +++ b/data/natural/preprocess_msds.py @@ -44,6 +44,5 @@ def get_text(d, text="", level=1, linebreaks=2): print(f"Output file already exists, please check: {path_jsonl_out}") else: with open(path_jsonl_out, "a") as fout: - for sample in data: - fout.write(json.dumps(sample) + "\n") + fout.writelines(json.dumps(sample) + "\n" for sample in data) print(f"JSONL saved to: {path_jsonl_out}") diff --git a/data/tabular/RedDB/transform.py b/data/tabular/RedDB/transform.py index 442422a1b..678e58c42 100644 --- a/data/tabular/RedDB/transform.py +++ b/data/tabular/RedDB/transform.py @@ -214,46 +214,46 @@ def read_dataset(): journal = {Nature Scientific Data}""", ], "templates": [ - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solubilityAqSolPred__names__noun} of {solubilityAqSolPred#} {solubilityAqSolPred__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {molecularSurface__names__noun} of {molecularSurface#} {molecularSurface__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {reactionFieldEnergy__names__noun} of {reactionFieldEnergy#} {reactionFieldEnergy__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solventAccessSurface__names__noun} of {solventAccessSurface#} {solventAccessSurface__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {cavityEnergy__names__noun} of {cavityEnergy#} {cavityEnergy__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {gasEnergy__names__noun} of {gasEnergy#} {gasEnergy__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {gasHomo__names__noun} of {gasHomo#} {gasHomo__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {gasLumo__names__noun} of {gasLumo#} {gasLumo__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solutionEnergy__names__noun} of {solutionEnergy#} {solutionEnergy__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solutionLumo__names__noun} of {solutionLumo#} {solutionLumo__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {nuclearRepulsionEnergy__names__noun} of {nuclearRepulsionEnergy#} {nuclearRepulsionEnergy__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {optGasEnergy__names__noun} of {optGasEnergy#} {optGasEnergy__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {optGasHomo__names__noun} of {optGasHomo#} {optGasHomo__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {optGasLumo__names__noun} of {optGasLumo#} {optGasLumo__units}.""" # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solubilityAqSolPred__names__noun} of {solubilityAqSolPred#} {solubilityAqSolPred__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {molecularSurface__names__noun} of {molecularSurface#} {molecularSurface__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {reactionFieldEnergy__names__noun} of {reactionFieldEnergy#} {reactionFieldEnergy__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solventAccessSurface__names__noun} of {solventAccessSurface#} {solventAccessSurface__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {cavityEnergy__names__noun} of {cavityEnergy#} {cavityEnergy__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {gasEnergy__names__noun} of {gasEnergy#} {gasEnergy__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {gasHomo__names__noun} of {gasHomo#} {gasHomo__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {gasLumo__names__noun} of {gasLumo#} {gasLumo__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solutionEnergy__names__noun} of {solutionEnergy#} {solutionEnergy__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solutionLumo__names__noun} of {solutionLumo#} {solutionLumo__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {nuclearRepulsionEnergy__names__noun} of {nuclearRepulsionEnergy#} {nuclearRepulsionEnergy__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {optGasEnergy__names__noun} of {optGasEnergy#} {optGasEnergy__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {optGasHomo__names__noun} of {optGasHomo#} {optGasHomo__units}.""", # noqa: E501 - """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {optGasLumo__names__noun} of {optGasLumo#} {optGasLumo__units}.""", # noqa: E501 + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solubilityAqSolPred__names__noun} of {solubilityAqSolPred#} {solubilityAqSolPred__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {molecularSurface__names__noun} of {molecularSurface#} {molecularSurface__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {reactionFieldEnergy__names__noun} of {reactionFieldEnergy#} {reactionFieldEnergy__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solventAccessSurface__names__noun} of {solventAccessSurface#} {solventAccessSurface__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {cavityEnergy__names__noun} of {cavityEnergy#} {cavityEnergy__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {gasEnergy__names__noun} of {gasEnergy#} {gasEnergy__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {gasHomo__names__noun} of {gasHomo#} {gasHomo__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {gasLumo__names__noun} of {gasLumo#} {gasLumo__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solutionEnergy__names__noun} of {solutionEnergy#} {solutionEnergy__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {solutionLumo__names__noun} of {solutionLumo#} {solutionLumo__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {nuclearRepulsionEnergy__names__noun} of {nuclearRepulsionEnergy#} {nuclearRepulsionEnergy__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {optGasEnergy__names__noun} of {optGasEnergy#} {optGasEnergy__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {optGasHomo__names__noun} of {optGasHomo#} {optGasHomo__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} {#representation of |!}{SMILES#} has a {optGasLumo__names__noun} of {optGasLumo#} {optGasLumo__units}.""" + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solubilityAqSolPred__names__noun} of {solubilityAqSolPred#} {solubilityAqSolPred__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {molecularSurface__names__noun} of {molecularSurface#} {molecularSurface__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {reactionFieldEnergy__names__noun} of {reactionFieldEnergy#} {reactionFieldEnergy__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solventAccessSurface__names__noun} of {solventAccessSurface#} {solventAccessSurface__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {cavityEnergy__names__noun} of {cavityEnergy#} {cavityEnergy__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {gasEnergy__names__noun} of {gasEnergy#} {gasEnergy__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {gasHomo__names__noun} of {gasHomo#} {gasHomo__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {gasLumo__names__noun} of {gasLumo#} {gasLumo__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solutionEnergy__names__noun} of {solutionEnergy#} {solutionEnergy__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {solutionLumo__names__noun} of {solutionLumo#} {solutionLumo__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {nuclearRepulsionEnergy__names__noun} of {nuclearRepulsionEnergy#} {nuclearRepulsionEnergy__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {optGasEnergy__names__noun} of {optGasEnergy#} {optGasEnergy__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {optGasHomo__names__noun} of {optGasHomo#} {optGasHomo__units}.""", + """The {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} {#representation of |!}{InChI#} has a {optGasLumo__names__noun} of {optGasLumo#} {optGasLumo__units}.""", """Task: Please {#give me|create|generate!} a {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} based on the {#text |!}description{# below|!}. Description: It has an {solubilityAqSolPred__names__noun} {solubilityAqSolPred#} {solubilityAqSolPred__units} and a {cavityEnergy__names__noun} of {cavityEnergy#} {cavityEnergy__units}. - Result: {SMILES#}""", # noqa: E501 + Result: {SMILES#}""", """Task: Please {#give me|create|generate!} a {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} based on the {#text |!}description{# below|!}. Description: It has an {solubilityAqSolPred__names__noun} {solubilityAqSolPred#} {solubilityAqSolPred__units} and a {cavityEnergy__names__noun} of {cavityEnergy#} {cavityEnergy__units}. - Result: {InChI#}""", # noqa: E501 + Result: {InChI#}""", """Task: Please {#give me|create|generate!} a {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description} based on the {#text |!}description{# below|!}. Description: It has an {solutionLumo__names__noun} {solutionLumo#} {solutionLumo__units} and a {solutionHomo__names__noun} of {solutionHomo#} {solutionHomo__units}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", """Task: Please {#give me|create|generate!} a {#molecule|compound|chemical|molecular species|chemical compound!} with the {InChI__description} based on the {#text |!}description{# below|!}. Description: It has an {solutionLumo__names__noun} {solutionLumo#} {solutionLumo__units} and a {solutionHomo__names__noun} of {solutionHomo#} {solutionHomo__units}. -Result: {InChI#}""", # noqa: E501 +Result: {InChI#}""", ], } diff --git a/data/tabular/SIDER/transform.py b/data/tabular/SIDER/transform.py index 0f4494872..9e2af58d2 100644 --- a/data/tabular/SIDER/transform.py +++ b/data/tabular/SIDER/transform.py @@ -74,19 +74,19 @@ def write_meta(column_ids: pd.Index, descriptions: List[str], num_points: int) - ] templates = [ - "The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description}" # noqa: E501 + "The {#molecule|compound|chemical|molecular species|chemical compound!} with the {SMILES__description}" + " {#representation of |!}{SMILES#} is {" + col_id + "#not a &a }" + "{#potential cause|potential reason!} for {" + col_id - + "__names__noun}." # noqa: E501 + + "__names__noun}." for col_id in column_ids[1:] ] meta = { "name": "SIDER", # unique identifier, we will also use this for directory names - "description": f"""Database of marketed drugs and adverse drug reactions (ADR), grouped into {len(column_ids[1:])} system organ classes.""", # noqa: E501 + "description": f"""Database of marketed drugs and adverse drug reactions (ADR), grouped into {len(column_ids[1:])} system organ classes.""", "identifiers": [ { "id": "SMILES", # column name diff --git a/data/tabular/ames_mutagenicity/transform.py b/data/tabular/ames_mutagenicity/transform.py index 1d0949254..e65d4c8b7 100644 --- a/data/tabular/ames_mutagenicity/transform.py +++ b/data/tabular/ames_mutagenicity/transform.py @@ -122,16 +122,16 @@ def get_and_transform_data(): journal = {Journal of Chemical Information and Modeling}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {mutagenic#no &NULL}{mutagenic__names__adjective} properties.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {mutagenic#no &NULL}{mutagenic__names__adjective} {#properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that is {mutagenic#not &NULL}identified as {mutagenic__names__adjective}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {mutagenic#not &NULL}{mutagenic__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {mutagenic#no &NULL}{mutagenic__names__adjective} properties.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {mutagenic#no &NULL}{mutagenic__names__adjective} {#properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} represents a molecule that is {mutagenic#not &NULL}identified as {mutagenic__names__adjective}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {mutagenic#not &NULL}{mutagenic__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {mutagenic__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {mutagenic#False&True}""", # noqa: E501 +Result: {mutagenic#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {mutagenic__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -139,58 +139,58 @@ def get_and_transform_data(): Result: This molecule is {mutagenic#not &NULL}{mutagenic__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {mutagenic#not &NULL}{mutagenic__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {mutagenic__names__adjective}? -Assistant: {mutagenic#No&Yes}, this molecule is {mutagenic#not &NULL}{mutagenic__names__adjective}.""", # noqa: E501 +Assistant: {mutagenic#No&Yes}, this molecule is {mutagenic#not &NULL}{mutagenic__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {mutagenic__names__adjective}? -Assistant: {mutagenic#No&Yes}, it is {mutagenic#not &NULL}{mutagenic__names__adjective}.""", # noqa: E501 +Assistant: {mutagenic#No&Yes}, it is {mutagenic#not &NULL}{mutagenic__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {mutagenic#not &NULL}{mutagenic__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {mutagenic#not &NULL}{mutagenic__names__adjective}? -Assistant: This is a molecule that is {mutagenic#not &NULL}{mutagenic__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {mutagenic#not &NULL}{mutagenic__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {mutagenic#not &NULL}be {mutagenic__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {mutagenic#not &NULL}{mutagenic__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {mutagenic#not &NULL}{mutagenic__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {mutagenic#not &NULL}be {mutagenic__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {mutagenic#not &NULL}{mutagenic__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {mutagenic#not &NULL}{mutagenic__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {mutagenic__names__adjective}:{mutagenic#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {mutagenic__names__adjective}:{mutagenic#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {mutagenic__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{mutagenic#False&True}""", # noqa: E501 - # noqa: E501 """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. +Result:{mutagenic#False&True}""", + # Description: A molecule that is {mutagenic__names__adjective}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {mutagenic__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {mutagenic%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {mutagenic__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {mutagenic%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {mutagenic#not &NULL}{mutagenic__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%mutagenic%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {mutagenic#not &NULL}{mutagenic__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%mutagenic%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/bio_ner/transform.py b/data/tabular/bio_ner/transform.py index 4b264b073..d98e0eefa 100644 --- a/data/tabular/bio_ner/transform.py +++ b/data/tabular/bio_ner/transform.py @@ -33,7 +33,7 @@ """Task: Please carry out the {#named entity recognition (NER)|named entity recognition|NER!} task for the the text below. Text: {Sentence#}. Constrain: Please, {#only |!}list the entities in the form NER entity, span start, span end, and type {#in separate lines |!}with a high probability of being in the text. -Result: {entity_1#}""", # noqa: E501 +Result: {entity_1#}""", ], } diff --git a/data/tabular/bioavailability_ma_et_al/transform.py b/data/tabular/bioavailability_ma_et_al/transform.py index ac9db02bd..446c156ae 100644 --- a/data/tabular/bioavailability_ma_et_al/transform.py +++ b/data/tabular/bioavailability_ma_et_al/transform.py @@ -119,17 +119,17 @@ def get_and_transform_data(): journal = {Journal of Pharmaceutical and Biomedical Analysis}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} has a {bioavailable#low&high} {bioavailable__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation of |!}{SMILES#}, the molecule has a {bioavailable#low&high} {bioavailable__names__noun}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that has a {bioavailable#low&high} {bioavailable__names__noun}.", # noqa: E501 + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} has a {bioavailable#low&high} {bioavailable__names__noun}.", + "Based on the {SMILES__description} {#representation of |!}{SMILES#}, the molecule has a {bioavailable#low&high} {bioavailable__names__noun}.", + "The {SMILES__description} {SMILES#} represents a molecule that has a {bioavailable#low&high} {bioavailable__names__noun}.", "The {SMILES__description} {SMILES#} has a {bioavailable#low&high} {bioavailable__names__noun}.", - "The molecule with the {SMILES__description} {SMILES#} has a {bioavailable#low&high} {bioavailable__names__noun}.", # noqa: E501 + "The molecule with the {SMILES__description} {SMILES#} has a {bioavailable#low&high} {bioavailable__names__noun}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: Predict if the molecule has a low or high {bioavailable__names__noun}? {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "low" or "high" without using any {#other|additional!} words. -Result: {bioavailable#low&high}""", # noqa: E501 +Result: {bioavailable#low&high}""", """Task: Please classify a molecule based on the description. Description: Predict if the molecule has a low or high {bioavailable__names__noun}? {#Molecule |!}{SMILES__description}: {SMILES#} @@ -137,58 +137,58 @@ def get_and_transform_data(): Result: This molecule has a {bioavailable#low&high} {bioavailable__names__noun}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that has a {bioavailable#low&high} {bioavailable__names__noun}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} has a low or high {bioavailable__names__noun}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, this molecule has a {bioavailable#low&high} {bioavailable__names__noun}.""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, this molecule has a {bioavailable#low&high} {bioavailable__names__noun}.""", """User: Has the molecule with the {SMILES__description} {SMILES#} a low or high {bioavailable__names__noun}? -Assistant: It has a {bioavailable#low&high} {bioavailable__names__noun}.""", # noqa: E501 +Assistant: It has a {bioavailable#low&high} {bioavailable__names__noun}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that has a {bioavailable#low&high} {bioavailable__names__noun}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that has a {bioavailable#low&high} {bioavailable__names__noun}? -Assistant: {#Ok, this|This!} is a molecule that has a {bioavailable#low&high} {bioavailable__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok, this|This!} is a molecule that has a {bioavailable#low&high} {bioavailable__names__noun}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should have a {bioavailable#low&high} {bioavailable__names__noun}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} has a {bioavailable#low&high} {bioavailable__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} has a {bioavailable#low&high} {bioavailable__names__noun}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should have a {bioavailable#low&high} {bioavailable__names__noun}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} has a {bioavailable#low&high} {bioavailable__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} has a {bioavailable#low&high} {bioavailable__names__noun}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {bioavailable__names__adjective}?{bioavailable#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {bioavailable__names__adjective}?{bioavailable#no&yes}", """Task: Please classify a molecule based on the description. Description: Predict if the molecule has a low or high {bioavailable__names__noun}? {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "low" or "high" without using any {#other|additional!} words. -Result:{bioavailable#low&high}""", # noqa: E501 - # noqa: E501 """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. +Result:{bioavailable#low&high}""", + # Description: A molecule that has a {bioavailable#low&high} {bioavailable__names__noun}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Has the molecule with the {SMILES__description} {#representation of |!}{SMILES#} a high {bioavailable__names__noun}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {bioavailable%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Has the molecule with the {SMILES__description} {#representation of |!}{SMILES#} a high {bioavailable__names__noun}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {bioavailable%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules have a high {bioavailable__names__noun}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%bioavailable%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules have a high {bioavailable__names__noun}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%bioavailable%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/blood_brain_barrier_martins_et_al/transform.py b/data/tabular/blood_brain_barrier_martins_et_al/transform.py index 003c48733..54b1b5dcc 100644 --- a/data/tabular/blood_brain_barrier_martins_et_al/transform.py +++ b/data/tabular/blood_brain_barrier_martins_et_al/transform.py @@ -138,80 +138,80 @@ def get_and_transform_data(): journal = {Chemical Science}""", ], "templates": [ - "The molecule with the {SMILES__description} {SMILES#} is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that is {penetrate_BBB#not &NULL}identified as {penetrate_BBB__names__adjective}.", # noqa: E501 - "The molecule represented with the {SMILES__description} {SMILES#} is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}.", # noqa: E501 - "{SMILES#} represents a molecule that is {penetrate_BBB#not &NULL}identified as {penetrate_BBB__names__adjective}.", # noqa: E501 - "{SMILES#} represents a molecule that is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}.", # noqa: E501 + "The molecule with the {SMILES__description} {SMILES#} is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}.", + "The {SMILES__description} {SMILES#} represents a molecule that is {penetrate_BBB#not &NULL}identified as {penetrate_BBB__names__adjective}.", + "The molecule represented with the {SMILES__description} {SMILES#} is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}.", + "{SMILES#} represents a molecule that is {penetrate_BBB#not &NULL}identified as {penetrate_BBB__names__adjective}.", + "{SMILES#} represents a molecule that is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}.", "{SMILES#} is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}.", - "The {#molecule |!}{SMILES__description} {SMILES#} is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}.", # noqa: E501 + "The {#molecule |!}{SMILES__description} {SMILES#} is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {penetrate_BBB__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {penetrate_BBB#False&True}""", # noqa: E501 +Result: {penetrate_BBB#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {penetrate_BBB__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}.""", # noqa: E501 +Result: This molecule is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}.""", """Task: Please {#give me|create|generate!} the {SMILES__description} of {#molecule|chemical|chemical structure!} based on the {#text |!}description{# below|!}. Description: A molecule that is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {penetrate_BBB__names__adjective}? -Assistant: {penetrate_BBB#No&Yes}, this molecule is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}.""", # noqa: E501 +Assistant: {penetrate_BBB#No&Yes}, this molecule is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {penetrate_BBB__names__adjective}? -Assistant: {penetrate_BBB#No&Yes}, it is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}.""", # noqa: E501 +Assistant: {penetrate_BBB#No&Yes}, it is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}? -Assistant: This is a molecule that is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} the {SMILES__description} of a molecule. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {penetrate_BBB#not &NULL}be {penetrate_BBB__names__adjective}. -Assistant: Got it, this {SMILES__description} is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: Got it, this {SMILES__description} is {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {penetrate_BBB__names__adjective}:{penetrate_BBB#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {penetrate_BBB__names__adjective}:{penetrate_BBB#no&yes}", # todo: check if we go for multiple choice only and remove the benchmarking template above and below """Task: Please classify a molecule based on the description. Description: A molecule that is {penetrate_BBB__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{penetrate_BBB#False&True}""", # noqa: E501 - # noqa: E501 """Task: Please {#give me|create|generate!} a molecule {SMILES__description} based on the {#text |!}description{# below|!}. +Result:{penetrate_BBB#False&True}""", + # Description: A molecule that is {penetrate_BBB__names__adjective}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} of {SMILES#} {penetrate_BBB__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {penetrate_BBB%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%penetrate_BBB%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} of {SMILES#} {penetrate_BBB__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {penetrate_BBB%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {penetrate_BBB#not &NULL}{penetrate_BBB__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%penetrate_BBB%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/buchwald_hartwig/transform.py b/data/tabular/buchwald_hartwig/transform.py index ab6c4e151..5fbf1e517 100644 --- a/data/tabular/buchwald_hartwig/transform.py +++ b/data/tabular/buchwald_hartwig/transform.py @@ -78,7 +78,7 @@ def generate_buchwald_hartwig_rxns(df): and https://github.com/rxn4chemistry/rxn_yields/blob/master/rxn_yields/data.py """ df = df.copy() - fwd_template = "[F,Cl,Br,I]-[c;H0;D3;+0:1](:[c,n:2]):[c,n:3].[NH2;D1;+0:4]-[c:5]>>[c,n:2]:[c;H0;D3;+0:1](:[c,n:3])-[NH;D2;+0:4]-[c:5]" # noqa + fwd_template = "[F,Cl,Br,I]-[c;H0;D3;+0:1](:[c,n:2]):[c,n:3].[NH2;D1;+0:4]-[c:5]>>[c,n:2]:[c;H0;D3;+0:1](:[c,n:3])-[NH;D2;+0:4]-[c:5]" methylaniline = "Cc1ccc(N)cc1" pd_catalyst = "O=S(=O)(O[Pd]1~[NH2]C2C=CC=CC=2C2C=CC=CC1=2)C(F)(F)F" methylaniline_mol = Chem.MolFromSmiles(methylaniline) diff --git a/data/tabular/carcinogens/transform.py b/data/tabular/carcinogens/transform.py index 62aef4568..59aa648a1 100644 --- a/data/tabular/carcinogens/transform.py +++ b/data/tabular/carcinogens/transform.py @@ -136,17 +136,17 @@ def get_and_transform_data(): journal = {Journal of Chemical Information and Modeling}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {carcinogen#no &NULL}{carcinogen__names__adjective} {#properties|effects!}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {carcinogen#no &NULL}{carcinogen__names__adjective} {#effects|properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that is {carcinogen#not &NULL}identified as {carcinogen__names__adjective}.", # noqa: E501 + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {carcinogen#no &NULL}{carcinogen__names__adjective} {#properties|effects!}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {carcinogen#no &NULL}{carcinogen__names__adjective} {#effects|properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} represents a molecule that is {carcinogen#not &NULL}identified as {carcinogen__names__adjective}.", "The {SMILES__description} {SMILES#} is {carcinogen#not &NULL}{carcinogen__names__adjective}.", - "The {#molecule |!}{SMILES__description} {SMILES#} is {carcinogen#not &NULL}{carcinogen__names__adjective}.", # noqa: E501 not all variables need to be used + "The {#molecule |!}{SMILES__description} {SMILES#} is {carcinogen#not &NULL}{carcinogen__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {carcinogen__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {carcinogen#False&True}""", # noqa: E501 +Result: {carcinogen#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {carcinogen__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -154,58 +154,58 @@ def get_and_transform_data(): Result: This molecule is {carcinogen#not &NULL}{carcinogen__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {carcinogen#not &NULL}{carcinogen__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {carcinogen__names__adjective}? -Assistant: {carcinogen#No&Yes}, this molecule is {carcinogen#not &NULL}{carcinogen__names__adjective}.""", # noqa: E501 +Assistant: {carcinogen#No&Yes}, this molecule is {carcinogen#not &NULL}{carcinogen__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {carcinogen__names__adjective}? -Assistant: {carcinogen#No&Yes}, it is {carcinogen#not &NULL}{carcinogen__names__adjective}.""", # noqa: E501 +Assistant: {carcinogen#No&Yes}, it is {carcinogen#not &NULL}{carcinogen__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {carcinogen#not &NULL}{carcinogen__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {carcinogen#not &NULL}{carcinogen__names__adjective}? -Assistant: This is a molecule that is {carcinogen#not &NULL}{carcinogen__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {carcinogen#not &NULL}{carcinogen__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {carcinogen#not &NULL}be {carcinogen__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {carcinogen#not &NULL}{carcinogen__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {carcinogen#not &NULL}{carcinogen__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {carcinogen#not &NULL}be {carcinogen__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {carcinogen#not &NULL}{carcinogen__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {carcinogen#not &NULL}{carcinogen__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {carcinogen__names__adjective}:{carcinogen#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {carcinogen__names__adjective}:{carcinogen#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {carcinogen__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{carcinogen#False&True}""", # noqa: E501 - # noqa: E501 """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. +Result:{carcinogen#False&True}""", + # Description: A molecule that is {carcinogen__names__adjective}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {carcinogen__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {carcinogen%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {carcinogen__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {carcinogen%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {carcinogen#not &NULL}{carcinogen__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%carcinogen%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {carcinogen#not &NULL}{carcinogen__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%carcinogen%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/cav3_t-type_calcium_channels_butkiewicz/transform.py b/data/tabular/cav3_t-type_calcium_channels_butkiewicz/transform.py index 5b2a89c2a..0bb77b778 100644 --- a/data/tabular/cav3_t-type_calcium_channels_butkiewicz/transform.py +++ b/data/tabular/cav3_t-type_calcium_channels_butkiewicz/transform.py @@ -138,74 +138,74 @@ def get_and_transform_data(): journal = {Chemical Science}}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {activity_cav3_t_type_calcium_channels#no &NULL}{activity_cav3_t_type_calcium_channels__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {activity_cav3_t_type_calcium_channels#no &NULL}{activity_cav3_t_type_calcium_channels__names__noun}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {activity_cav3_t_type_calcium_channels#no &NULL}{activity_cav3_t_type_calcium_channels__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {activity_cav3_t_type_calcium_channels#no &NULL}{activity_cav3_t_type_calcium_channels__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {activity_cav3_t_type_calcium_channels#no &NULL}{activity_cav3_t_type_calcium_channels__names__noun}.", + "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {activity_cav3_t_type_calcium_channels#no &NULL}{activity_cav3_t_type_calcium_channels__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_cav3_t_type_calcium_channels__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {activity_cav3_t_type_calcium_channels#False&True}""", # noqa: E501 +Result: {activity_cav3_t_type_calcium_channels#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_cav3_t_type_calcium_channels__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}.""", # noqa: E501 +Result: This molecule is {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {activity_cav3_t_type_calcium_channels__names__gerund}? -Assistant: {activity_cav3_t_type_calcium_channels#No&Yes}, this molecule is {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}.""", # noqa: E501 +Assistant: {activity_cav3_t_type_calcium_channels#No&Yes}, this molecule is {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {activity_cav3_t_type_calcium_channels__names__gerund}? -Assistant: {activity_cav3_t_type_calcium_channels#No&Yes}, it is {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}.""", # noqa: E501 +Assistant: {activity_cav3_t_type_calcium_channels#No&Yes}, it is {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}? -Assistant: This is a molecule that is {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {activity_cav3_t_type_calcium_channels#not &NULL}be {activity_cav3_t_type_calcium_channels__names__gerund}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {activity_cav3_t_type_calcium_channels#not &NULL}be {activity_cav3_t_type_calcium_channels__names__gerund}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {activity_cav3_t_type_calcium_channels__names__gerund}:{activity_cav3_t_type_calcium_channels#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {activity_cav3_t_type_calcium_channels__names__gerund}:{activity_cav3_t_type_calcium_channels#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_cav3_t_type_calcium_channels__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{activity_cav3_t_type_calcium_channels#False&True}""", # noqa: E501 +Result:{activity_cav3_t_type_calcium_channels#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_cav3_t_type_calcium_channels__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result:This molecule is {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}.""", # noqa: E501 - # noqa: E501 """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. +Result:This molecule is {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}.""", + # Description: A molecule that is {activity_cav3_t_type_calcium_channels__names__gerund}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {activity_cav3_t_type_calcium_channels__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {activity_cav3_t_type_calcium_channels%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%activity_cav3_t_type_calcium_channels%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_cav3_t_type_calcium_channels#not &NULL}{activity_cav3_t_type_calcium_channels__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%activity_cav3_t_type_calcium_channels%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/chebi_20/transform.py b/data/tabular/chebi_20/transform.py index ec9f0b68a..f80003c73 100644 --- a/data/tabular/chebi_20/transform.py +++ b/data/tabular/chebi_20/transform.py @@ -84,41 +84,41 @@ url = "https://aclanthology.org/2022.emnlp-main.26", pages = "375--413", abstract = "We present MolT5 - a self-supervised learning framework for pretraining models on a vast amount of unlabeled natural language text and molecule strings. MolT5 allows for new, useful, and challenging analogs of traditional vision-language tasks, such as molecule captioning and text-based de novo molecule generation (altogether: translation between molecules and language), which we explore for the first time. Since MolT5 pretrains models on single-modal data, it helps overcome the chemistry domain shortcoming of data scarcity. Furthermore, we consider several metrics, including a new cross-modal embedding-based metric, to evaluate the tasks of molecule captioning and text-based molecule generation. Our results show that MolT5-based models are able to generate outputs, both molecules and captions, which in many cases are high quality.", - }""", # noqa + }""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} can be described {#by|as!}:\n{description#}", # noqa - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule can be described {#by|as!}:\n{description#}", # noqa + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} can be described {#by|as!}:\n{description#}", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule can be described {#by|as!}:\n{description#}", """Task: Please create a {#text |!}description for a molecule{# based on its representation|!}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question with {#full|complete!} sentences. -Result: {description#}""", # noqa +Result: {description#}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: {description#} -Result: {SMILES#}""", # noqa +Result: {SMILES#}""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule based in this description: {description#} -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that can be described {#by|as!}: {description#} -Assistant: This is a molecule that fits {#your|this!} description: {SMILES#}""", # noqa +Assistant: This is a molecule that fits {#your|this!} description: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule can be described {#by|as!}: {description#} -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} fits {#your|this!} description: {SMILES#}""", # noqa +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} fits {#your|this!} description: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule can be described {#by|as!}: {description#} -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} fits {#your|this!} description: {SMILES#}""", # noqa +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} fits {#your|this!} description: {SMILES#}""", """Task: Please create a {#text |!}description for a molecule{# based on its representation|!}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question with {#full|complete!} sentences. -Result:{description#}""", # noqa +Result:{description#}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: {description#} -Result:{SMILES#}""", # noqa +Result:{SMILES#}""", ], } diff --git a/data/tabular/chem_caption_smarts/preprocess.py b/data/tabular/chem_caption_smarts/preprocess.py index 06eeafe4e..d1d3351e5 100644 --- a/data/tabular/chem_caption_smarts/preprocess.py +++ b/data/tabular/chem_caption_smarts/preprocess.py @@ -1,5 +1,6 @@ # flake8: noqa """Preprocess the raw outputs from the text-output of chem-caption to a tabular dataset.""" + from glob import glob import pandas as pd diff --git a/data/tabular/chem_caption_smarts/transform.py b/data/tabular/chem_caption_smarts/transform.py index 7259da626..5e12df6a4 100644 --- a/data/tabular/chem_caption_smarts/transform.py +++ b/data/tabular/chem_caption_smarts/transform.py @@ -4,7 +4,7 @@ def process(): # get the smarts config df = pd.read_parquet( - "https://huggingface.co/datasets/kjappelbaum/chemnlp-chem-caption/resolve/main/smarts/train-00000-of-00001-71cef18c6383b463.parquet" # noqa + "https://huggingface.co/datasets/kjappelbaum/chemnlp-chem-caption/resolve/main/smarts/train-00000-of-00001-71cef18c6383b463.parquet" ) df["completion_labels"] = df["completion_labels"].astype(str) df["completion_labels"] = df["completion_labels"].str.replace( diff --git a/data/tabular/chemcaption_fragments/transform.py b/data/tabular/chemcaption_fragments/transform.py index bde0e5566..fe17d3a21 100644 --- a/data/tabular/chemcaption_fragments/transform.py +++ b/data/tabular/chemcaption_fragments/transform.py @@ -3,7 +3,7 @@ def process(): df = pd.read_parquet( - "https://huggingface.co/datasets/kjappelbaum/chemnlp-chem-caption/resolve/main/smarts/train-00000-of-00001-71cef18c6383b463.parquet?download=true" # noqa + "https://huggingface.co/datasets/kjappelbaum/chemnlp-chem-caption/resolve/main/smarts/train-00000-of-00001-71cef18c6383b463.parquet?download=true" ) df.dropna(inplace=True) print(len(df)) diff --git a/data/tabular/chemcaption_rdkit/preprocess.py b/data/tabular/chemcaption_rdkit/preprocess.py index 4d05334c0..11f135e38 100644 --- a/data/tabular/chemcaption_rdkit/preprocess.py +++ b/data/tabular/chemcaption_rdkit/preprocess.py @@ -20,7 +20,7 @@ allowed_multi_output_features = [ "['rotable_proportion', 'non_rotable_proportion']", - "['num_unspecified_bond', 'num_single_bonds', 'num_double_bonds', 'num_triple_bonds', 'num_quadruple_bonds', 'num_quintuple_bonds', 'num_hextuple_bonds', 'num_oneandahalf_bonds', 'num_twoandahalf_bonds', 'num_threeandahalf_bonds', 'num_fourandahalf_bonds', 'num_fiveandahalf_bonds', 'num_aromatic_bonds', 'num_ionic_bonds', 'num_hydrogen_bonds', 'num_threecenter_bonds', 'num_dativeone_bonds', 'num_dative_bonds', 'num_other_bonds', 'num_zero_bonds', 'num_bonds']", # noqa + "['num_unspecified_bond', 'num_single_bonds', 'num_double_bonds', 'num_triple_bonds', 'num_quadruple_bonds', 'num_quintuple_bonds', 'num_hextuple_bonds', 'num_oneandahalf_bonds', 'num_twoandahalf_bonds', 'num_threeandahalf_bonds', 'num_fourandahalf_bonds', 'num_fiveandahalf_bonds', 'num_aromatic_bonds', 'num_ionic_bonds', 'num_hydrogen_bonds', 'num_threecenter_bonds', 'num_dativeone_bonds', 'num_dative_bonds', 'num_other_bonds', 'num_zero_bonds', 'num_bonds']", "['carbon_mass', 'hydrogen_mass', 'nitrogen_mass', 'oxygen_mass']", "['num_carbon_atoms', 'num_hydrogen_atoms', 'num_nitrogen_atoms', 'num_oxygen_atoms']", "['npr1_value', 'npr2_value']", diff --git a/data/tabular/chemcaption_rdkit/transform.py b/data/tabular/chemcaption_rdkit/transform.py index 5448be304..b27672b00 100644 --- a/data/tabular/chemcaption_rdkit/transform.py +++ b/data/tabular/chemcaption_rdkit/transform.py @@ -4,7 +4,7 @@ def process(): df = pd.read_parquet( - "https://huggingface.co/datasets/kjappelbaum/chemnlp-chem-caption/resolve/main/rdkit_feat/train-00000-of-00001-7cea16ab26bf74cf.parquet?download=true" # noqa + "https://huggingface.co/datasets/kjappelbaum/chemnlp-chem-caption/resolve/main/rdkit_feat/train-00000-of-00001-7cea16ab26bf74cf.parquet?download=true" ) df["num_bonds_simple"] = df[ [ diff --git a/data/tabular/choline_transporter_butkiewicz/transform.py b/data/tabular/choline_transporter_butkiewicz/transform.py index b4a74553c..77cf0a9f7 100644 --- a/data/tabular/choline_transporter_butkiewicz/transform.py +++ b/data/tabular/choline_transporter_butkiewicz/transform.py @@ -148,74 +148,74 @@ def get_and_transform_data(): journal = {Chemical Science}}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {activity_choline_transporter#no &NULL}{activity_choline_transporter__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {activity_choline_transporter#no &NULL}{activity_choline_transporter__names__noun}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {activity_choline_transporter#no &NULL}{activity_choline_transporter__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {activity_choline_transporter#no &NULL}{activity_choline_transporter__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {activity_choline_transporter#no &NULL}{activity_choline_transporter__names__noun}.", + "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {activity_choline_transporter#no &NULL}{activity_choline_transporter__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_choline_transporter__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {activity_choline_transporter#False&True}""", # noqa: E501 +Result: {activity_choline_transporter#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_choline_transporter__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}.""", # noqa: E501 +Result: This molecule is {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {activity_choline_transporter__names__gerund}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {activity_choline_transporter__names__gerund}? -Assistant: {activity_choline_transporter#No&Yes}, this molecule is {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}.""", # noqa: E501 +Assistant: {activity_choline_transporter#No&Yes}, this molecule is {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {activity_choline_transporter__names__gerund}? -Assistant: {activity_choline_transporter#No&Yes}, it is {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}.""", # noqa: E501 +Assistant: {activity_choline_transporter#No&Yes}, it is {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}? -Assistant: This is a molecule that is {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {activity_choline_transporter#not &NULL}be {activity_choline_transporter__names__gerund}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {activity_choline_transporter#not &NULL}be {activity_choline_transporter__names__gerund}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {activity_choline_transporter__names__gerund}:{activity_choline_transporter#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {activity_choline_transporter__names__gerund}:{activity_choline_transporter#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_choline_transporter__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{activity_choline_transporter#False&True}""", # noqa: E501 +Result:{activity_choline_transporter#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_choline_transporter__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result:This molecule is {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}.""", # noqa: E501 - # noqa: E501 """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. +Result:This molecule is {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}.""", + # Description: A molecule that is {activity_choline_transporter__names__gerund}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {activity_choline_transporter__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {activity_choline_transporter%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%activity_choline_transporter%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_choline_transporter#not &NULL}{activity_choline_transporter__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%activity_choline_transporter%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/clintox/transform.py b/data/tabular/clintox/transform.py index 5376d76a3..d14ed2ce9 100644 --- a/data/tabular/clintox/transform.py +++ b/data/tabular/clintox/transform.py @@ -55,8 +55,8 @@ def get_and_transform_data(): ], "uris": [ "http://purl.bioontology.org/ontology/MESH/Q000633", - "https://ncit.nci.nih.gov/ncitbrowser/ConceptReport.jsp?dictionary=NCI_Thesaurus&ns=ncit&code=C27990", # noqa: E501 - "https://ncit.nci.nih.gov/ncitbrowser/ConceptReport.jsp?dictionary=NCI_Thesaurus&ns=ncit&code=C27955", # noqa: E501 + "https://ncit.nci.nih.gov/ncitbrowser/ConceptReport.jsp?dictionary=NCI_Thesaurus&ns=ncit&code=C27990", + "https://ncit.nci.nih.gov/ncitbrowser/ConceptReport.jsp?dictionary=NCI_Thesaurus&ns=ncit&code=C27955", ], }, ], @@ -101,16 +101,16 @@ def get_and_transform_data(): journal = {Cell Chemical Biology}}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {clinical_toxicity#no &NULL}{clinical_toxicity__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {clinical_toxicity#no &NULL}{clinical_toxicity__names__adjective} {#properties|characteristics|features|traits!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that is {clinical_toxicity#not &NULL}identified as {clinical_toxicity__names__adjective}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {clinical_toxicity#not &NULL}{clinical_toxicity__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {clinical_toxicity#no &NULL}{clinical_toxicity__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {clinical_toxicity#no &NULL}{clinical_toxicity__names__adjective} {#properties|characteristics|features|traits!}.", + "The {SMILES__description} {SMILES#} represents a molecule that is {clinical_toxicity#not &NULL}identified as {clinical_toxicity__names__adjective}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {clinical_toxicity#not &NULL}{clinical_toxicity__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {clinical_toxicity__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {clinical_toxicity#False&True}""", # noqa: E501 +Result: {clinical_toxicity#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {clinical_toxicity__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -118,58 +118,58 @@ def get_and_transform_data(): Result: This molecule is {clinical_toxicity#not &NULL}{clinical_toxicity__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {clinical_toxicity__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {clinical_toxicity__names__adjective}? -Assistant: {clinical_toxicity#No&Yes}, this molecule is {clinical_toxicity#not &NULL}{clinical_toxicity__names__adjective}.""", # noqa: E501 +Assistant: {clinical_toxicity#No&Yes}, this molecule is {clinical_toxicity#not &NULL}{clinical_toxicity__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {clinical_toxicity__names__adjective}? -Assistant: {clinical_toxicity#No&Yes}, it is {clinical_toxicity#not &NULL}{clinical_toxicity__names__adjective}.""", # noqa: E501 +Assistant: {clinical_toxicity#No&Yes}, it is {clinical_toxicity#not &NULL}{clinical_toxicity__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {clinical_toxicity#not &NULL}{clinical_toxicity__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {clinical_toxicity#not &NULL}{clinical_toxicity__names__adjective}? -Assistant: This is a molecule that is {clinical_toxicity#not &NULL}{clinical_toxicity__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {clinical_toxicity#not &NULL}{clinical_toxicity__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {clinical_toxicity#not &NULL}be {clinical_toxicity__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {clinical_toxicity#not &NULL}{clinical_toxicity__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {clinical_toxicity#not &NULL}{clinical_toxicity__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {clinical_toxicity#not &NULL}be {clinical_toxicity__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {clinical_toxicity#not &NULL}{clinical_toxicity__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {clinical_toxicity#not &NULL}{clinical_toxicity__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {clinical_toxicity__names__adjective}:{clinical_toxicity#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {clinical_toxicity__names__adjective}:{clinical_toxicity#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {clinical_toxicity__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{clinical_toxicity#False&True}""", # noqa: E501 - # noqa: E501 """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. +Result:{clinical_toxicity#False&True}""", + # Description: A molecule that is {clinical_toxicity__names__adjective}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {clinical_toxicity__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {clinical_toxicity%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {clinical_toxicity__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {clinical_toxicity%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {clinical_toxicity#not &NULL}{clinical_toxicity__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%clinical_toxicity%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {clinical_toxicity#not &NULL}{clinical_toxicity__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%clinical_toxicity%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/cyp2c9_substrate_carbonmangels/transform.py b/data/tabular/cyp2c9_substrate_carbonmangels/transform.py index 7bc96bee1..d73e46c83 100644 --- a/data/tabular/cyp2c9_substrate_carbonmangels/transform.py +++ b/data/tabular/cyp2c9_substrate_carbonmangels/transform.py @@ -141,16 +141,16 @@ def get_and_transform_data(): journal = {Journal of Chemical Information and Modeling}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {CYP2C9_Substrate#not &NULL}a {CYP2C9_Substrate__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {CYP2C9_Substrate#not &NULL}{CYP2C9_Substrate__names__verb}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that is {CYP2C9_Substrate#not &NULL}identified as a {CYP2C9_Substrate__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {CYP2C9_Substrate#not &NULL}{CYP2C9_Substrate__names__verb}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {CYP2C9_Substrate#not &NULL}a {CYP2C9_Substrate__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {CYP2C9_Substrate#not &NULL}{CYP2C9_Substrate__names__verb}.", + "The {SMILES__description} {SMILES#} represents a molecule that is {CYP2C9_Substrate#not &NULL}identified as a {CYP2C9_Substrate__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {CYP2C9_Substrate#not &NULL}{CYP2C9_Substrate__names__verb}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is a {CYP2C9_Substrate__names__noun}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -esult: {CYP2C9_Substrate#False&True}""", # noqa: E501 +esult: {CYP2C9_Substrate#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP2C9_Substrate__names__verb}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -158,58 +158,58 @@ def get_and_transform_data(): Result: This molecule is {CYP2C9_Substrate#not &NULL}a {CYP2C9_Substrate__names__noun}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is a {CYP2C9_Substrate__names__noun}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is a {CYP2C9_Substrate__names__noun}? -Assistant: {CYP2C9_Substrate#No&Yes}, this molecule is {CYP2C9_Substrate#not &NULL}{CYP2C9_Substrate__names__verb}.""", # noqa: E501 +Assistant: {CYP2C9_Substrate#No&Yes}, this molecule is {CYP2C9_Substrate#not &NULL}{CYP2C9_Substrate__names__verb}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {CYP2C9_Substrate__names__verb}? -Assistant: {CYP2C9_Substrate#No&Yes}, it is {CYP2C9_Substrate#not &NULL}a {CYP2C9_Substrate__names__noun}.""", # noqa: E501 +Assistant: {CYP2C9_Substrate#No&Yes}, it is {CYP2C9_Substrate#not &NULL}a {CYP2C9_Substrate__names__noun}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is a {CYP2C9_Substrate#not &NULL}{CYP2C9_Substrate__names__noun}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {CYP2C9_Substrate#not &NULL}{CYP2C9_Substrate__names__verb}? -Assistant: This is a molecule that is {CYP2C9_Substrate#not &NULL}a {CYP2C9_Substrate__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {CYP2C9_Substrate#not &NULL}a {CYP2C9_Substrate__names__noun}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {CYP2C9_Substrate#not &NULL}be {CYP2C9_Substrate__names__verb}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {CYP2C9_Substrate#not &NULL}{CYP2C9_Substrate__names__verb}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {CYP2C9_Substrate#not &NULL}{CYP2C9_Substrate__names__verb}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {CYP2C9_Substrate#not &NULL}be a {CYP2C9_Substrate__names__noun}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {CYP2C9_Substrate#not &NULL}a {CYP2C9_Substrate__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {CYP2C9_Substrate#not &NULL}a {CYP2C9_Substrate__names__noun}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} a {CYP2C9_Substrate__names__noun}:{CYP2C9_Substrate#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} a {CYP2C9_Substrate__names__noun}:{CYP2C9_Substrate#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is a {CYP2C9_Substrate__names__noun}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{CYP2C9_Substrate#False&True}""", # noqa: E501 - # noqa: E501 """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. +Result:{CYP2C9_Substrate#False&True}""", + # Description: A molecule that is {CYP2C9_Substrate__names__verb}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {CYP2C9_Substrate__names__verb}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {CYP2C9_Substrate%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} a {CYP2C9_Substrate__names__noun}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {CYP2C9_Substrate%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {CYP2C9_Substrate#not &NULL}a {CYP2C9_Substrate__names__noun}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%CYP2C9_Substrate%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {CYP2C9_Substrate#not &NULL}{CYP2C9_Substrate__names__verb}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%CYP2C9_Substrate%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/cyp2d6_substrate_carbonmangels/transform.py b/data/tabular/cyp2d6_substrate_carbonmangels/transform.py index abfeffddf..0a609413f 100644 --- a/data/tabular/cyp2d6_substrate_carbonmangels/transform.py +++ b/data/tabular/cyp2d6_substrate_carbonmangels/transform.py @@ -142,16 +142,16 @@ def get_and_transform_data(): journal = {Journal of Chemical Information and Modeling}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {CYP2D6_Substrate#not &NULL}a {CYP2D6_Substrate__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {CYP2D6_Substrate#not &NULL}{CYP2D6_Substrate__names__verb}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that is {CYP2D6_Substrate#not &NULL}identified as a {CYP2D6_Substrate__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {CYP2D6_Substrate#not &NULL}{CYP2D6_Substrate__names__verb}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {CYP2D6_Substrate#not &NULL}a {CYP2D6_Substrate__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {CYP2D6_Substrate#not &NULL}{CYP2D6_Substrate__names__verb}.", + "The {SMILES__description} {SMILES#} represents a molecule that is {CYP2D6_Substrate#not &NULL}identified as a {CYP2D6_Substrate__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {CYP2D6_Substrate#not &NULL}{CYP2D6_Substrate__names__verb}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is a {CYP2D6_Substrate__names__noun}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -esult: {CYP2D6_Substrate#False&True}""", # noqa: E501 +esult: {CYP2D6_Substrate#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP2D6_Substrate__names__verb}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -159,58 +159,58 @@ def get_and_transform_data(): Result: This molecule is {CYP2D6_Substrate#not &NULL}a {CYP2D6_Substrate__names__noun}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is a {CYP2D6_Substrate__names__noun}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is a {CYP2D6_Substrate__names__noun}? -Assistant: {CYP2D6_Substrate#No&Yes}, this molecule is {CYP2D6_Substrate#not &NULL}{CYP2D6_Substrate__names__verb}.""", # noqa: E501 +Assistant: {CYP2D6_Substrate#No&Yes}, this molecule is {CYP2D6_Substrate#not &NULL}{CYP2D6_Substrate__names__verb}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {CYP2D6_Substrate__names__verb}? -Assistant: {CYP2D6_Substrate#No&Yes}, it is {CYP2D6_Substrate#not &NULL}a {CYP2D6_Substrate__names__noun}.""", # noqa: E501 +Assistant: {CYP2D6_Substrate#No&Yes}, it is {CYP2D6_Substrate#not &NULL}a {CYP2D6_Substrate__names__noun}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is a {CYP2D6_Substrate#not &NULL}{CYP2D6_Substrate__names__noun}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {CYP2D6_Substrate#not &NULL}{CYP2D6_Substrate__names__verb}? -Assistant: This is a molecule that is {CYP2D6_Substrate#not &NULL}a {CYP2D6_Substrate__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {CYP2D6_Substrate#not &NULL}a {CYP2D6_Substrate__names__noun}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {CYP2D6_Substrate#not &NULL}be {CYP2D6_Substrate__names__verb}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {CYP2D6_Substrate#not &NULL}{CYP2D6_Substrate__names__verb}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {CYP2D6_Substrate#not &NULL}{CYP2D6_Substrate__names__verb}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {CYP2D6_Substrate#not &NULL}be a {CYP2D6_Substrate__names__noun}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {CYP2D6_Substrate#not &NULL}a {CYP2D6_Substrate__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {CYP2D6_Substrate#not &NULL}a {CYP2D6_Substrate__names__noun}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} a {CYP2D6_Substrate__names__noun}:{CYP2D6_Substrate#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} a {CYP2D6_Substrate__names__noun}:{CYP2D6_Substrate#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is a {CYP2D6_Substrate__names__noun}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{CYP2D6_Substrate#False&True}""", # noqa: E501 - # noqa: E501 """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. +Result:{CYP2D6_Substrate#False&True}""", + # Description: A molecule that is {CYP2D6_Substrate__names__verb}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {CYP2D6_Substrate__names__verb}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {CYP2D6_Substrate%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} a {CYP2D6_Substrate__names__noun}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {CYP2D6_Substrate%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {CYP2D6_Substrate#not &NULL}a {CYP2D6_Substrate__names__noun}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%CYP2D6_Substrate%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {CYP2D6_Substrate#not &NULL}{CYP2D6_Substrate__names__verb}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%CYP2D6_Substrate%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/cyp3a4_substrate_carbonmangels/transform.py b/data/tabular/cyp3a4_substrate_carbonmangels/transform.py index 0b1ae2aa3..bf09abd52 100644 --- a/data/tabular/cyp3a4_substrate_carbonmangels/transform.py +++ b/data/tabular/cyp3a4_substrate_carbonmangels/transform.py @@ -143,16 +143,16 @@ def get_and_transform_data(): journal = {Journal of Chemical Information and Modeling}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {CYP3A4_Substrate#not &NULL}a {CYP3A4_Substrate__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {CYP3A4_Substrate#not &NULL}{CYP3A4_Substrate__names__verb}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that is {CYP3A4_Substrate#not &NULL}identified as a {CYP3A4_Substrate__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {CYP3A4_Substrate#not &NULL}{CYP3A4_Substrate__names__verb}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {CYP3A4_Substrate#not &NULL}a {CYP3A4_Substrate__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {CYP3A4_Substrate#not &NULL}{CYP3A4_Substrate__names__verb}.", + "The {SMILES__description} {SMILES#} represents a molecule that is {CYP3A4_Substrate#not &NULL}identified as a {CYP3A4_Substrate__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {CYP3A4_Substrate#not &NULL}{CYP3A4_Substrate__names__verb}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is a {CYP3A4_Substrate__names__noun}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -esult: {CYP3A4_Substrate#False&True}""", # noqa: E501 +esult: {CYP3A4_Substrate#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP3A4_Substrate__names__verb}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -160,58 +160,58 @@ def get_and_transform_data(): Result: This molecule is {CYP3A4_Substrate#not &NULL}a {CYP3A4_Substrate__names__noun}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is a {CYP3A4_Substrate__names__noun}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is a {CYP3A4_Substrate__names__noun}? -Assistant: {CYP3A4_Substrate#No&Yes}, this molecule is {CYP3A4_Substrate#not &NULL}{CYP3A4_Substrate__names__verb}.""", # noqa: E501 +Assistant: {CYP3A4_Substrate#No&Yes}, this molecule is {CYP3A4_Substrate#not &NULL}{CYP3A4_Substrate__names__verb}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {CYP3A4_Substrate__names__verb}? -Assistant: {CYP3A4_Substrate#No&Yes}, it is {CYP3A4_Substrate#not &NULL}a {CYP3A4_Substrate__names__noun}.""", # noqa: E501 +Assistant: {CYP3A4_Substrate#No&Yes}, it is {CYP3A4_Substrate#not &NULL}a {CYP3A4_Substrate__names__noun}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is a {CYP3A4_Substrate#not &NULL}{CYP3A4_Substrate__names__noun}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {CYP3A4_Substrate#not &NULL}{CYP3A4_Substrate__names__verb}? -Assistant: This is a molecule that is {CYP3A4_Substrate#not &NULL}a {CYP3A4_Substrate__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {CYP3A4_Substrate#not &NULL}a {CYP3A4_Substrate__names__noun}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {CYP3A4_Substrate#not &NULL}be {CYP3A4_Substrate__names__verb}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {CYP3A4_Substrate#not &NULL}{CYP3A4_Substrate__names__verb}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {CYP3A4_Substrate#not &NULL}{CYP3A4_Substrate__names__verb}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {CYP3A4_Substrate#not &NULL}be a {CYP3A4_Substrate__names__noun}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {CYP3A4_Substrate#not &NULL}a {CYP3A4_Substrate__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {CYP3A4_Substrate#not &NULL}a {CYP3A4_Substrate__names__noun}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} a {CYP3A4_Substrate__names__noun}:{CYP3A4_Substrate#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} a {CYP3A4_Substrate__names__noun}:{CYP3A4_Substrate#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is a {CYP3A4_Substrate__names__noun}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{CYP3A4_Substrate#False&True}""", # noqa: E501 - # noqa: E501 """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. +Result:{CYP3A4_Substrate#False&True}""", + # Description: A molecule that is {CYP3A4_Substrate__names__verb}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {CYP3A4_Substrate__names__verb}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {CYP3A4_Substrate%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} a {CYP3A4_Substrate__names__noun}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {CYP3A4_Substrate%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {CYP3A4_Substrate#not &NULL}a {CYP3A4_Substrate__names__noun}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%CYP3A4_Substrate%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {CYP3A4_Substrate#not &NULL}{CYP3A4_Substrate__names__verb}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%CYP3A4_Substrate%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/cyp_p450_1a2_inhibition_veith_et_al/transform.py b/data/tabular/cyp_p450_1a2_inhibition_veith_et_al/transform.py index 54887d69e..a8b0e89fc 100644 --- a/data/tabular/cyp_p450_1a2_inhibition_veith_et_al/transform.py +++ b/data/tabular/cyp_p450_1a2_inhibition_veith_et_al/transform.py @@ -117,80 +117,80 @@ def get_and_transform_data(): journal = {Nature Biotechnology}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {CYP1A2_inhibition#no &NULL}{CYP1A2_inhibition__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {CYP1A2_inhibition#no &NULL}{CYP1A2_inhibition__names__noun}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {CYP1A2_inhibition#no &NULL}{CYP1A2_inhibition__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {CYP1A2_inhibition#no &NULL}{CYP1A2_inhibition__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {CYP1A2_inhibition#no &NULL}{CYP1A2_inhibition__names__noun}.", + "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {CYP1A2_inhibition#no &NULL}{CYP1A2_inhibition__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP1A2_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {CYP1A2_inhibition#False&True}""", # noqa: E501 +Result: {CYP1A2_inhibition#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP1A2_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}.""", # noqa: E501 +Result: This molecule is {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {CYP1A2_inhibition__names__gerund}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {CYP1A2_inhibition__names__gerund}? -Assistant: {CYP1A2_inhibition#No&Yes}, this molecule is {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}.""", # noqa: E501 +Assistant: {CYP1A2_inhibition#No&Yes}, this molecule is {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {CYP1A2_inhibition__names__gerund}? -Assistant: {CYP1A2_inhibition#No&Yes}, it is {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}.""", # noqa: E501 +Assistant: {CYP1A2_inhibition#No&Yes}, it is {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}? -Assistant: This is a molecule that is {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {CYP1A2_inhibition#not &NULL}be {CYP1A2_inhibition__names__gerund}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {CYP1A2_inhibition#not &NULL}be {CYP1A2_inhibition__names__gerund}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {CYP1A2_inhibition__names__gerund}:{CYP1A2_inhibition#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {CYP1A2_inhibition__names__gerund}:{CYP1A2_inhibition#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP1A2_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{CYP1A2_inhibition#False&True}""", # noqa: E501 +Result:{CYP1A2_inhibition#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP1A2_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result:This molecule is {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}.""", # noqa: E501 +Result:This molecule is {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}.""", # noqa: E501"""Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. # Description: A molecule that is {CYP1A2_inhibition__names__gerund}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {CYP1A2_inhibition__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {CYP1A2_inhibition%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {CYP1A2_inhibition__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {CYP1A2_inhibition%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%CYP1A2_inhibition%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {CYP1A2_inhibition#not &NULL}{CYP1A2_inhibition__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%CYP1A2_inhibition%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/cyp_p450_2c19_inhibition_veith_et_al/transform.py b/data/tabular/cyp_p450_2c19_inhibition_veith_et_al/transform.py index 86d582887..d982ee996 100644 --- a/data/tabular/cyp_p450_2c19_inhibition_veith_et_al/transform.py +++ b/data/tabular/cyp_p450_2c19_inhibition_veith_et_al/transform.py @@ -117,80 +117,80 @@ def get_and_transform_data(): journal = {Nature Biotechnology}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {CYP2C19_inhibition#no &NULL}{CYP2C19_inhibition__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {CYP2C19_inhibition#no &NULL}{CYP2C19_inhibition__names__noun}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {CYP2C19_inhibition#no &NULL}{CYP2C19_inhibition__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {CYP2C19_inhibition#no &NULL}{CYP2C19_inhibition__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {CYP2C19_inhibition#no &NULL}{CYP2C19_inhibition__names__noun}.", + "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {CYP2C19_inhibition#no &NULL}{CYP2C19_inhibition__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP2C19_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {CYP2C19_inhibition#False&True}""", # noqa: E501 +Result: {CYP2C19_inhibition#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP2C19_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}.""", # noqa: E501 +Result: This molecule is {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {CYP2C19_inhibition__names__gerund}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {CYP2C19_inhibition__names__gerund}? -Assistant: {CYP2C19_inhibition#No&Yes}, this molecule is {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}.""", # noqa: E501 +Assistant: {CYP2C19_inhibition#No&Yes}, this molecule is {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {CYP2C19_inhibition__names__gerund}? -Assistant: {CYP2C19_inhibition#No&Yes}, it is {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}.""", # noqa: E501 +Assistant: {CYP2C19_inhibition#No&Yes}, it is {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}? -Assistant: This is a molecule that is {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {CYP2C19_inhibition#not &NULL}be {CYP2C19_inhibition__names__gerund}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {CYP2C19_inhibition#not &NULL}be {CYP2C19_inhibition__names__gerund}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {CYP2C19_inhibition__names__gerund}:{CYP2C19_inhibition#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {CYP2C19_inhibition__names__gerund}:{CYP2C19_inhibition#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP2C19_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{CYP2C19_inhibition#False&True}""", # noqa: E501 +Result:{CYP2C19_inhibition#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP2C19_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result:This molecule is {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}.""", # noqa: E501 - # noqa: E501 """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. +Result:This molecule is {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}.""", + # Description: A molecule that is {CYP2C19_inhibition__names__gerund}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {CYP2C19_inhibition__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {CYP2C19_inhibition%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {CYP2C19_inhibition__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {CYP2C19_inhibition%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%CYP2C19_inhibition%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {CYP2C19_inhibition#not &NULL}{CYP2C19_inhibition__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%CYP2C19_inhibition%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/cyp_p450_2c9_inhibition_veith_et_al/transform.py b/data/tabular/cyp_p450_2c9_inhibition_veith_et_al/transform.py index 9ee86b2e9..c308b4178 100644 --- a/data/tabular/cyp_p450_2c9_inhibition_veith_et_al/transform.py +++ b/data/tabular/cyp_p450_2c9_inhibition_veith_et_al/transform.py @@ -114,80 +114,80 @@ def get_and_transform_data(): journal = {Nature Biotechnology}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {CYP2C9_inhibition#no &NULL}{CYP2C9_inhibition__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {CYP2C9_inhibition#no &NULL}{CYP2C9_inhibition__names__noun}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {CYP2C9_inhibition#no &NULL}{CYP2C9_inhibition__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {CYP2C9_inhibition#no &NULL}{CYP2C9_inhibition__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {CYP2C9_inhibition#no &NULL}{CYP2C9_inhibition__names__noun}.", + "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {CYP2C9_inhibition#no &NULL}{CYP2C9_inhibition__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP2C9_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {CYP2C9_inhibition#False&True}""", # noqa: E501 +Result: {CYP2C9_inhibition#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP2C9_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}.""", # noqa: E501 +Result: This molecule is {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {CYP2C9_inhibition__names__gerund}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {CYP2C9_inhibition__names__gerund}? -Assistant: {CYP2C9_inhibition#No&Yes}, this molecule is {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}.""", # noqa: E501 +Assistant: {CYP2C9_inhibition#No&Yes}, this molecule is {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {CYP2C9_inhibition__names__gerund}? -Assistant: {CYP2C9_inhibition#No&Yes}, it is {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}.""", # noqa: E501 +Assistant: {CYP2C9_inhibition#No&Yes}, it is {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}? -Assistant: This is a molecule that is {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {CYP2C9_inhibition#not &NULL}be {CYP2C9_inhibition__names__gerund}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {CYP2C9_inhibition#not &NULL}be {CYP2C9_inhibition__names__gerund}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {CYP2C9_inhibition__names__gerund}:{CYP2C9_inhibition#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {CYP2C9_inhibition__names__gerund}:{CYP2C9_inhibition#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP2C9_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{CYP2C9_inhibition#False&True}""", # noqa: E501 +Result:{CYP2C9_inhibition#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP2C9_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result:This molecule is {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}.""", # noqa: E501 +Result:This molecule is {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}.""", # noqa: E501"""Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. # Description: A molecule that is {CYP2C9_inhibition__names__gerund}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {CYP2C9_inhibition__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {CYP2C9_inhibition%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {CYP2C9_inhibition__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {CYP2C9_inhibition%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%CYP2C9_inhibition%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {CYP2C9_inhibition#not &NULL}{CYP2C9_inhibition__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%CYP2C9_inhibition%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/cyp_p450_2d6_inhibition_veith_et_al/transform.py b/data/tabular/cyp_p450_2d6_inhibition_veith_et_al/transform.py index a904e9c98..838467d4c 100644 --- a/data/tabular/cyp_p450_2d6_inhibition_veith_et_al/transform.py +++ b/data/tabular/cyp_p450_2d6_inhibition_veith_et_al/transform.py @@ -116,80 +116,80 @@ def get_and_transform_data(): journal = {Nature Biotechnology}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {CYP2D6_inhibition#no &NULL}{CYP2D6_inhibition__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {CYP2D6_inhibition#no &NULL}{CYP2D6_inhibition__names__noun}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {CYP2D6_inhibition#no &NULL}{CYP2D6_inhibition__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {CYP2D6_inhibition#no &NULL}{CYP2D6_inhibition__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {CYP2D6_inhibition#no &NULL}{CYP2D6_inhibition__names__noun}.", + "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {CYP2D6_inhibition#no &NULL}{CYP2D6_inhibition__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP2D6_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {CYP2D6_inhibition#False&True}""", # noqa: E501 +Result: {CYP2D6_inhibition#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP2D6_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}.""", # noqa: E501 +Result: This molecule is {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {CYP2D6_inhibition__names__gerund}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {CYP2D6_inhibition__names__gerund}? -Assistant: {CYP2D6_inhibition#No&Yes}, this molecule is {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}.""", # noqa: E501 +Assistant: {CYP2D6_inhibition#No&Yes}, this molecule is {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {CYP2D6_inhibition__names__gerund}? -Assistant: {CYP2D6_inhibition#No&Yes}, it is {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}.""", # noqa: E501 +Assistant: {CYP2D6_inhibition#No&Yes}, it is {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}? -Assistant: This is a molecule that is {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {CYP2D6_inhibition#not &NULL}be {CYP2D6_inhibition__names__gerund}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {CYP2D6_inhibition#not &NULL}be {CYP2D6_inhibition__names__gerund}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {CYP2D6_inhibition__names__gerund}:{CYP2D6_inhibition#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {CYP2D6_inhibition__names__gerund}:{CYP2D6_inhibition#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP2D6_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{CYP2D6_inhibition#False&True}""", # noqa: E501 +Result:{CYP2D6_inhibition#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP2D6_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result:This molecule is {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}.""", # noqa: E501 +Result:This molecule is {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}.""", # noqa: E501"""Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. # Description: A molecule that is {CYP2D6_inhibition__names__gerund}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {CYP2D6_inhibition__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {CYP2D6_inhibition%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {CYP2D6_inhibition__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {CYP2D6_inhibition%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%CYP2D6_inhibition%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {CYP2D6_inhibition#not &NULL}{CYP2D6_inhibition__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%CYP2D6_inhibition%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/cyp_p450_3a4_inhibition_veith_et_al/transform.py b/data/tabular/cyp_p450_3a4_inhibition_veith_et_al/transform.py index 15522c946..4bdacda9e 100644 --- a/data/tabular/cyp_p450_3a4_inhibition_veith_et_al/transform.py +++ b/data/tabular/cyp_p450_3a4_inhibition_veith_et_al/transform.py @@ -117,80 +117,80 @@ def get_and_transform_data(): journal = {Nature Biotechnology}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {CYP3A4_inhibition#no &NULL}{CYP3A4_inhibition__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {CYP3A4_inhibition#no &NULL}{CYP3A4_inhibition__names__noun}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {CYP3A4_inhibition#no &NULL}{CYP3A4_inhibition__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {CYP3A4_inhibition#no &NULL}{CYP3A4_inhibition__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {CYP3A4_inhibition#no &NULL}{CYP3A4_inhibition__names__noun}.", + "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {CYP3A4_inhibition#no &NULL}{CYP3A4_inhibition__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP3A4_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {CYP3A4_inhibition#False&True}""", # noqa: E501 +Result: {CYP3A4_inhibition#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP3A4_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}.""", # noqa: E501 +Result: This molecule is {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {CYP3A4_inhibition__names__gerund}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {CYP3A4_inhibition__names__gerund}? -Assistant: {CYP3A4_inhibition#No&Yes}, this molecule is {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}.""", # noqa: E501 +Assistant: {CYP3A4_inhibition#No&Yes}, this molecule is {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {CYP3A4_inhibition__names__gerund}? -Assistant: {CYP3A4_inhibition#No&Yes}, it is {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}.""", # noqa: E501 +Assistant: {CYP3A4_inhibition#No&Yes}, it is {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}? -Assistant: This is a molecule that is {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {CYP3A4_inhibition#not &NULL}be {CYP3A4_inhibition__names__gerund}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {CYP3A4_inhibition#not &NULL}be {CYP3A4_inhibition__names__gerund}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {CYP3A4_inhibition__names__gerund}:{CYP3A4_inhibition#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {CYP3A4_inhibition__names__gerund}:{CYP3A4_inhibition#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP3A4_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{CYP3A4_inhibition#False&True}""", # noqa: E501 +Result:{CYP3A4_inhibition#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {CYP3A4_inhibition__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result:This molecule is {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}.""", # noqa: E501 +Result:This molecule is {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}.""", # noqa: E501"""Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. # Description: A molecule that is {CYP3A4_inhibition__names__gerund}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {CYP3A4_inhibition__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {CYP3A4_inhibition%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {CYP3A4_inhibition__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {CYP3A4_inhibition%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%CYP3A4_inhibition%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {CYP3A4_inhibition#not &NULL}{CYP3A4_inhibition__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%CYP3A4_inhibition%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/drug_induced_liver_injury/transform.py b/data/tabular/drug_induced_liver_injury/transform.py index ea97bcf89..dfe7086f7 100644 --- a/data/tabular/drug_induced_liver_injury/transform.py +++ b/data/tabular/drug_induced_liver_injury/transform.py @@ -118,16 +118,16 @@ def get_and_transform_data(): journal = {Journal of Chemical Information and Modeling}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|causes|displays!} {liver_injury#no &NULL}{liver_injury__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule causes {liver_injury#no &NULL}{liver_injury__names__noun}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that is {liver_injury#not &NULL}identified as causing a {liver_injury__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is causing {liver_injury#no &NULL}{liver_injury__names__noun}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|causes|displays!} {liver_injury#no &NULL}{liver_injury__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule causes {liver_injury#no &NULL}{liver_injury__names__noun}.", + "The {SMILES__description} {SMILES#} represents a molecule that is {liver_injury#not &NULL}identified as causing a {liver_injury__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is causing {liver_injury#no &NULL}{liver_injury__names__noun}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that {#shows|causes!} {liver_injury__names__noun}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {liver_injury#False&True}""", # noqa: E501 +Result: {liver_injury#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that {#shows|causes!} {liver_injury__names__noun}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -135,55 +135,55 @@ def get_and_transform_data(): Result: This molecule is {liver_injury#not &NULL}causing {liver_injury__names__noun}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that {#shows|causes!} {liver_injury__names__noun}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} {#shows|causes!} a {liver_injury__names__noun}? -Assistant: {liver_injury#No&Yes}, this molecule is {liver_injury#not &NULL}causing a {liver_injury__names__noun}.""", # noqa: E501 +Assistant: {liver_injury#No&Yes}, this molecule is {liver_injury#not &NULL}causing a {liver_injury__names__noun}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} causing a {liver_injury__names__noun}? -Assistant: {liver_injury#No&Yes}, it is {liver_injury#not &NULL}causing a {liver_injury__names__noun}.""", # noqa: E501 +Assistant: {liver_injury#No&Yes}, it is {liver_injury#not &NULL}causing a {liver_injury__names__noun}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {liver_injury#not &NULL}{#showing|causing!} a {liver_injury__names__noun}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {liver_injury#not &NULL}{#showing|causing!} a {liver_injury__names__noun}. -Assistant: This is a molecule that is {liver_injury#not &NULL}causing a {liver_injury__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {liver_injury#not &NULL}causing a {liver_injury__names__noun}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {liver_injury#not &NULL}be causing a {liver_injury__names__noun}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {liver_injury#not &NULL}causing a {liver_injury__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {liver_injury#not &NULL}causing a {liver_injury__names__noun}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {liver_injury#not &NULL}be causing a {liver_injury__names__noun}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {liver_injury#not &NULL}causing a {liver_injury__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {liver_injury#not &NULL}causing a {liver_injury__names__noun}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} causing a {liver_injury__names__noun}:{liver_injury#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} causing a {liver_injury__names__noun}:{liver_injury#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that {#shows|causes!} a {liver_injury__names__noun}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{liver_injury#False&True}""", # noqa: E501 +Result:{liver_injury#False&True}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} causing a {liver_injury__names__noun}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {liver_injury%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} causing a {liver_injury__names__noun}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {liver_injury%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {liver_injury#not &NULL} causing a {liver_injury__names__noun}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%liver_injury%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {liver_injury#not &NULL} causing a {liver_injury__names__noun}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%liver_injury%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/fda_adverse_reactions/transform.py b/data/tabular/fda_adverse_reactions/transform.py index 41ed9868d..a91b4170c 100644 --- a/data/tabular/fda_adverse_reactions/transform.py +++ b/data/tabular/fda_adverse_reactions/transform.py @@ -7,7 +7,7 @@ molecule = new_client.molecule -DATASET_URL = "ftp://ftp.ebi.ac.uk/pub/databases/opentargets/platform/23.02/output/etl/json/fda/significantAdverseDrugReactions" # noqa +DATASET_URL = "ftp://ftp.ebi.ac.uk/pub/databases/opentargets/platform/23.02/output/etl/json/fda/significantAdverseDrugReactions" DOWNLOAD_FOLDER = "./fda/significantAdverseDrugReactions" EBI_URL = "https://www.ebi.ac.uk/chembl/api/data/molecule/{}" diff --git a/data/tabular/freesolv/transform.py b/data/tabular/freesolv/transform.py index 8a0860534..3c784790a 100644 --- a/data/tabular/freesolv/transform.py +++ b/data/tabular/freesolv/transform.py @@ -135,87 +135,87 @@ def get_and_transform_data(): year={2013}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} has a {exp_value__names__noun} of {exp_value#} {exp_value__units}.", # noqa: E501 - "Based on the {SMILES__description} {#representation of |!}{SMILES#}, the molecule has a {exp_value__names__noun} of {exp_value#} {exp_value__units}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is representing!} a molecule {#that has a|with a!} {exp_value__names__noun} of {exp_value#} {exp_value__units}.", # noqa: E501 - "The molecule with the {SMILES__description} {SMILES#} has a {exp_value__names__noun} of {exp_value#} {exp_value__units}.", # noqa: E501 + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} has a {exp_value__names__noun} of {exp_value#} {exp_value__units}.", + "Based on the {SMILES__description} {#representation of |!}{SMILES#}, the molecule has a {exp_value__names__noun} of {exp_value#} {exp_value__units}.", + "The {SMILES__description} {SMILES#} {#represents|is representing!} a molecule {#that has a|with a!} {exp_value__names__noun} of {exp_value#} {exp_value__units}.", + "The molecule with the {SMILES__description} {SMILES#} has a {exp_value__names__noun} of {exp_value#} {exp_value__units}.", # GAFF - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} has a {GAFF__names__noun} of {GAFF#} {GAFF__units}.", # noqa: E501 - "Based on the {SMILES__description} {#representation of |!}{SMILES#}, the molecule has a {GAFF__names__noun} of {GAFF#} {GAFF__units}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is representing!} a molecule {#that has a|with a!} {GAFF__names__noun} of {GAFF#} {GAFF__units}.", # noqa: E501 + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} has a {GAFF__names__noun} of {GAFF#} {GAFF__units}.", + "Based on the {SMILES__description} {#representation of |!}{SMILES#}, the molecule has a {GAFF__names__noun} of {GAFF#} {GAFF__units}.", + "The {SMILES__description} {SMILES#} {#represents|is representing!} a molecule {#that has a|with a!} {GAFF__names__noun} of {GAFF#} {GAFF__units}.", "The molecule with the {SMILES__description} {SMILES#} has a {GAFF__names__noun} of {GAFF#} {GAFF__units}.", # Instruction tuning text templates """Task: Please predict a molecule feature based on the description. Description: Predict the {exp_value__names__noun} in {exp_value__units}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must answer with a numeric value in {exp_value__units} without using any {#other|additional!} words. -Result: {exp_value#} {exp_value__units}""", # noqa: E501 +Result: {exp_value#} {exp_value__units}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that has {exp_value__names__noun} of {exp_value#} {exp_value__units}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # GAFF """Task: Please predict a molecule feature based on the description. Description: Predict the {GAFF__names__noun} in {GAFF__units}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must answer with a numeric value in {GAFF__units} without using any {#other|additional!} words. -Result: {GAFF#} {GAFF__units}""", # noqa: E501 +Result: {GAFF#} {GAFF__units}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that has {GAFF__names__noun} of {GAFF#} {GAFF__units}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} the {exp_value__names__noun} in {exp_value__units} of the molecule with the {SMILES__description} {SMILES#}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, this molecule has a {exp_value__names__noun} of {exp_value#} {exp_value__units}.""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, this molecule has a {exp_value__names__noun} of {exp_value#} {exp_value__units}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that has a {exp_value__names__noun} of {exp_value#} {exp_value__units}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that has a {exp_value__names__noun} of {exp_value#} {exp_value__units}. -Assistant: This is a molecule that has a {exp_value__names__noun} of {exp_value#} {exp_value__units}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that has a {exp_value__names__noun} of {exp_value#} {exp_value__units}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should have a {exp_value__names__noun} of {exp_value#} {exp_value__units}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} represents a molecule that has a {exp_value__names__noun} of {exp_value#} {exp_value__units}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} represents a molecule that has a {exp_value__names__noun} of {exp_value#} {exp_value__units}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should have a {exp_value__names__noun} of {exp_value#} {exp_value__units}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} represents a molecule that has a {exp_value__names__noun} of {exp_value#} {exp_value__units}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} represents a molecule that has a {exp_value__names__noun} of {exp_value#} {exp_value__units}: {SMILES#}""", # GAFF """User: Can you {#tell me|derive|estimate!} the {GAFF__names__noun} in {GAFF__units} of the molecule with the {SMILES__description} {SMILES#}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, this molecule has a {GAFF__names__noun} of {GAFF#} {GAFF__units}.""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, this molecule has a {GAFF__names__noun} of {GAFF#} {GAFF__units}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that has a {GAFF__names__noun} of {GAFF#} {GAFF__units}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that has a {GAFF__names__noun} of {GAFF#} {GAFF__units}. -Assistant: This is a molecule that has a {GAFF__names__noun} of {GAFF#} {GAFF__units}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that has a {GAFF__names__noun} of {GAFF#} {GAFF__units}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should have a {GAFF__names__noun} of {GAFF#} {GAFF__units}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} represents a molecule that has a {GAFF__names__noun} of {GAFF#} {GAFF__units}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} represents a molecule that has a {GAFF__names__noun} of {GAFF#} {GAFF__units}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should have a {GAFF__names__noun} of {GAFF#} {GAFF__units}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} represents a molecule that has a {GAFF__names__noun} of {GAFF#} {GAFF__units}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} represents a molecule that has a {GAFF__names__noun} of {GAFF#} {GAFF__units}: {SMILES#}""", # Benchmarking text templates - "The {exp_value__names__noun} of the molecule with the {SMILES__description} {SMILES#} is:{exp_value#} {exp_value__units}", # noqa: E501 - "The {exp_value__names__noun} of the {SMILES__description} {SMILES#} is:{exp_value#} {exp_value__units}", # noqa: E501 - "The {exp_value__names__noun} of the molecule {SMILES__description} {SMILES#} is:{exp_value#} {exp_value__units}", # noqa: E501 + "The {exp_value__names__noun} of the molecule with the {SMILES__description} {SMILES#} is:{exp_value#} {exp_value__units}", + "The {exp_value__names__noun} of the {SMILES__description} {SMILES#} is:{exp_value#} {exp_value__units}", + "The {exp_value__names__noun} of the molecule {SMILES__description} {SMILES#} is:{exp_value#} {exp_value__units}", """Task: Please predict a molecule feature based on the description. Description: Predict the {exp_value__names__noun} in {exp_value__units} of a molecule. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must answer with a numeric value in {exp_value__units} without using any {#other|additional!} words. -Result:{exp_value#} {exp_value__units}""", # noqa: E501 +Result:{exp_value#} {exp_value__units}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that has {exp_value__names__noun} of {exp_value#} {exp_value__units}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", # GAFF - "The {GAFF__names__noun} of the molecule with the {SMILES__description} {SMILES#} is:{GAFF#} {GAFF__units}", # noqa: E501 - "The {GAFF__names__noun} of the {SMILES__description} {SMILES#} is:{GAFF#} {GAFF__units}", # noqa: E501 - "The {GAFF__names__noun} of the molecule {SMILES__description} {SMILES#} is:{GAFF#} {GAFF__units}", # noqa: E501 + "The {GAFF__names__noun} of the molecule with the {SMILES__description} {SMILES#} is:{GAFF#} {GAFF__units}", + "The {GAFF__names__noun} of the {SMILES__description} {SMILES#} is:{GAFF#} {GAFF__units}", + "The {GAFF__names__noun} of the molecule {SMILES__description} {SMILES#} is:{GAFF#} {GAFF__units}", """Task: Please predict a molecule feature based on the description. Description: Predict the {GAFF__names__noun} in {GAFF__units} of a molecule. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must answer with a numeric value in {GAFF__units} without using any {#other|additional!} words. -Result:{GAFF#} {GAFF__units}""", # noqa: E501 +Result:{GAFF#} {GAFF__units}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that has {GAFF__names__noun} of {GAFF#} {GAFF__units}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", ], } fn_meta = "meta.yaml" diff --git a/data/tabular/half_life_obach/transform.py b/data/tabular/half_life_obach/transform.py index 7b2d98e5d..063b5194c 100644 --- a/data/tabular/half_life_obach/transform.py +++ b/data/tabular/half_life_obach/transform.py @@ -50,7 +50,7 @@ def get_and_transform_data(): "targets": [ { "id": "half_life_duration", # name of the column in a tabular dataset - "description": "the time it takes for the plasma concentration of a drug in the body to be reduced by half", # noqa: E501 + "description": "the time it takes for the plasma concentration of a drug in the body to be reduced by half", "units": "hours", # units of the values in this column (leave empty if unitless) "type": "continuous", "names": [ # names for the property (to sample from for building the prompts) diff --git a/data/tabular/herg_blockers/transform.py b/data/tabular/herg_blockers/transform.py index 9967270ea..f2a41ec10 100644 --- a/data/tabular/herg_blockers/transform.py +++ b/data/tabular/herg_blockers/transform.py @@ -143,71 +143,71 @@ def get_and_transform_data(): journal = {Molecular Pharmaceutics}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.", + "The {SMILES__description} {SMILES#} represents a molecule that is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that {herg_blocker__names__verb}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {herg_blocker#False&True}""", # noqa: E501 +Result: {herg_blocker#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is a {herg_blocker__names__noun}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {herg_blocker#no &NULL}{herg_blocker__names__noun}.""", # noqa: E501 +Result: This molecule is {herg_blocker#no &NULL}{herg_blocker__names__noun}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is a {herg_blocker__names__noun}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is a {herg_blocker__names__noun}? -Assistant: {herg_blocker#No&Yes}, this molecule is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.""", # noqa: E501 +Assistant: {herg_blocker#No&Yes}, this molecule is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} a {herg_blocker__names__noun}? -Assistant: {herg_blocker#No&Yes}, it is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.""", # noqa: E501 +Assistant: {herg_blocker#No&Yes}, it is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {herg_blocker#not &NULL}a {herg_blocker__names__noun}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that {herg_blocker#not &NULL}{herg_blocker__names__verb}? -Assistant: This is a molecule that is {herg_blocker#not &NULL}a {herg_blocker__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {herg_blocker#not &NULL}a {herg_blocker__names__noun}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {herg_blocker#not &NULL}be a {herg_blocker__names__noun}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {herg_blocker#not &NULL}a {herg_blocker__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {herg_blocker#not &NULL}a {herg_blocker__names__noun}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {herg_blocker#not &NULL}be a {herg_blocker__names__noun}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {herg_blocker#not &NULL}a {herg_blocker__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {herg_blocker#not &NULL}a {herg_blocker__names__noun}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} a {herg_blocker__names__noun}:{herg_blocker#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} a {herg_blocker__names__noun}:{herg_blocker#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is a {herg_blocker__names__noun}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{herg_blocker#False&True}""", # noqa: E501 +Result:{herg_blocker#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is a {herg_blocker__names__noun}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result:This molecule is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.""", # noqa: E501 +Result:This molecule is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} a {herg_blocker__names__noun}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {herg_blocker%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {herg_blocker#not &NULL}a {herg_blocker__names__noun}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%herg_blocker%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {herg_blocker#not &NULL}a {herg_blocker__names__noun}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%herg_blocker%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/herg_central_inhib/transform.py b/data/tabular/herg_central_inhib/transform.py index f7c0a4305..988863cad 100644 --- a/data/tabular/herg_central_inhib/transform.py +++ b/data/tabular/herg_central_inhib/transform.py @@ -124,71 +124,71 @@ def get_and_transform_data(): ], "templates": [ # herg_inhib__names__noun - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {herg_inhib#not &NULL}a {herg_inhib__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {herg_inhib#not &NULL}a {herg_inhib__names__noun}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that is {herg_inhib#not &NULL}a {herg_inhib__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {herg_inhib#not &NULL}a {herg_inhib__names__noun}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {herg_inhib#not &NULL}a {herg_inhib__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {herg_inhib#not &NULL}a {herg_inhib__names__noun}.", + "The {SMILES__description} {SMILES#} represents a molecule that is {herg_inhib#not &NULL}a {herg_inhib__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {herg_inhib#not &NULL}a {herg_inhib__names__noun}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that {herg_inhib__names__verb}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {herg_inhib#False&True}""", # noqa: E501 +Result: {herg_inhib#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is a {herg_inhib__names__noun}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {herg_inhib#no &NULL}{herg_inhib__names__noun}.""", # noqa: E501 +Result: This molecule is {herg_inhib#no &NULL}{herg_inhib__names__noun}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is a {herg_inhib__names__noun}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is a {herg_inhib__names__noun}? -Assistant: {herg_inhib#No&Yes}, this molecule is {herg_inhib#not &NULL}a {herg_inhib__names__noun}.""", # noqa: E501 +Assistant: {herg_inhib#No&Yes}, this molecule is {herg_inhib#not &NULL}a {herg_inhib__names__noun}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} a {herg_inhib__names__noun}? -Assistant: {herg_inhib#No&Yes}, it is {herg_inhib#not &NULL}a {herg_inhib__names__noun}.""", # noqa: E501 +Assistant: {herg_inhib#No&Yes}, it is {herg_inhib#not &NULL}a {herg_inhib__names__noun}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {herg_inhib#not &NULL}a {herg_inhib__names__noun}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that does {herg_inhib#not &NULL}{herg_inhib__names__verb}? -#Assistant: This is a molecule that is {herg_inhib#not &NULL}a {herg_inhib__names__noun}: {SMILES#}""", # noqa: E501 +#Assistant: This is a molecule that is {herg_inhib#not &NULL}a {herg_inhib__names__noun}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {herg_inhib#not &NULL}be a {herg_inhib__names__noun}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {herg_inhib#not &NULL}a {herg_inhib__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {herg_inhib#not &NULL}a {herg_inhib__names__noun}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {herg_inhib#not &NULL}be a {herg_inhib__names__noun}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {herg_inhib#not &NULL}a {herg_inhib__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {herg_inhib#not &NULL}a {herg_inhib__names__noun}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} a {herg_inhib__names__noun}:{herg_inhib#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} a {herg_inhib__names__noun}:{herg_inhib#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is a {herg_inhib__names__noun}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{herg_inhib#False&True}""", # noqa: E501 +Result:{herg_inhib#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is a {herg_inhib__names__noun}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result:This molecule is {herg_inhib#not &NULL}a {herg_inhib__names__noun}.""", # noqa: E501 +Result:This molecule is {herg_inhib#not &NULL}a {herg_inhib__names__noun}.""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} a {herg_inhib__names__noun}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {herg_inhib%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {herg_inhib#not &NULL}a {herg_inhib__names__noun}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%herg_inhib%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {herg_inhib#not &NULL}a {herg_inhib__names__noun}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%herg_inhib%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/herg_karim_et_al/transform.py b/data/tabular/herg_karim_et_al/transform.py index 62aa05929..814b9ce51 100644 --- a/data/tabular/herg_karim_et_al/transform.py +++ b/data/tabular/herg_karim_et_al/transform.py @@ -119,71 +119,71 @@ def get_and_transform_data(): journal = {Journal of Cheminformatics}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {herg_blocker#not a hERG blocker (>= 10uM)&a hERG blocker (<10uM)}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {herg_blocker#not a human ether-à-go-go related gene (hERG) blocker (>= 10uM)&a human ether-à-go-go related gene (hERG) blocker (<10uM)}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that is {herg_blocker#not a hERG blocker (>= 10uM)&a hERG blocker (<10uM)}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {herg_blocker#not a human ether-à-go-go related gene (hERG) blocker (>= 10uM)&a human ether-à-go-go related gene (hERG) blocker (<10uM)}.", # noqa: E501 + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {herg_blocker#not a hERG blocker (>= 10uM)&a hERG blocker (<10uM)}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {herg_blocker#not a human ether-à-go-go related gene (hERG) blocker (>= 10uM)&a human ether-à-go-go related gene (hERG) blocker (<10uM)}.", + "The {SMILES__description} {SMILES#} represents a molecule that is {herg_blocker#not a hERG blocker (>= 10uM)&a hERG blocker (<10uM)}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {herg_blocker#not a human ether-à-go-go related gene (hERG) blocker (>= 10uM)&a human ether-à-go-go related gene (hERG) blocker (<10uM)}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that does {herg_blocker__names__verb}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {herg_blocker#False&True}""", # noqa: E501 +Result: {herg_blocker#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is a {herg_blocker__names__noun}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {herg_blocker#no &NULL}{herg_blocker__names__noun}.""", # noqa: E501 +Result: This molecule is {herg_blocker#no &NULL}{herg_blocker__names__noun}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is a {herg_blocker__names__noun}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is a {herg_blocker__names__noun}? -Assistant: {herg_blocker#No&Yes}, this molecule is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.""", # noqa: E501 +Assistant: {herg_blocker#No&Yes}, this molecule is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} a {herg_blocker__names__noun}? -Assistant: {herg_blocker#No&Yes}, it is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.""", # noqa: E501 +Assistant: {herg_blocker#No&Yes}, it is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {herg_blocker#not &NULL}a {herg_blocker__names__noun}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that does {herg_blocker#not &NULL}{herg_blocker__names__verb}? -Assistant: This is a molecule that is {herg_blocker#not &NULL}a {herg_blocker__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {herg_blocker#not &NULL}a {herg_blocker__names__noun}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {herg_blocker#not &NULL}be a {herg_blocker__names__noun}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {herg_blocker#not &NULL}a {herg_blocker__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {herg_blocker#not &NULL}a {herg_blocker__names__noun}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {herg_blocker#not &NULL}be a {herg_blocker__names__noun}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {herg_blocker#not &NULL}a {herg_blocker__names__noun}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {herg_blocker#not &NULL}a {herg_blocker__names__noun}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} a {herg_blocker__names__noun}:{herg_blocker#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} a {herg_blocker__names__noun}:{herg_blocker#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is a {herg_blocker__names__noun}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{herg_blocker#False&True}""", # noqa: E501 +Result:{herg_blocker#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is a {herg_blocker__names__noun}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result:This molecule is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.""", # noqa: E501 +Result:This molecule is {herg_blocker#not &NULL}a {herg_blocker__names__noun}.""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} a {herg_blocker__names__noun}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {herg_blocker%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {herg_blocker#not &NULL}a {herg_blocker__names__noun}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%herg_blocker%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {herg_blocker#not &NULL}a {herg_blocker__names__noun}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%herg_blocker%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/hiv/transform.py b/data/tabular/hiv/transform.py index e6f32a7db..7b7b43e80 100644 --- a/data/tabular/hiv/transform.py +++ b/data/tabular/hiv/transform.py @@ -118,74 +118,74 @@ def get_and_transform_data(): journal = {Chemical Science}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {activity_HIV#no &NULL}{activity_HIV__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {activity_HIV#no &NULL}{activity_HIV__names__noun}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {activity_HIV#no &NULL}{activity_HIV__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_HIV#not &NULL}{activity_HIV__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {activity_HIV#no &NULL}{activity_HIV__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {activity_HIV#no &NULL}{activity_HIV__names__noun}.", + "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {activity_HIV#no &NULL}{activity_HIV__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_HIV#not &NULL}{activity_HIV__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_HIV__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {activity_HIV#False&True}""", # noqa: E501 +Result: {activity_HIV#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_HIV__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {activity_HIV#not &NULL}{activity_HIV__names__adjective}.""", # noqa: E501 +Result: This molecule is {activity_HIV#not &NULL}{activity_HIV__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {activity_HIV__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {activity_HIV__names__adjective}? -Assistant: {activity_HIV#No&Yes}, this molecule is {activity_HIV#not &NULL}{activity_HIV__names__adjective}.""", # noqa: E501 +Assistant: {activity_HIV#No&Yes}, this molecule is {activity_HIV#not &NULL}{activity_HIV__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {activity_HIV__names__adjective}? -Assistant: {activity_HIV#No&Yes}, it is {activity_HIV#not &NULL}{activity_HIV__names__adjective}.""", # noqa: E501 +Assistant: {activity_HIV#No&Yes}, it is {activity_HIV#not &NULL}{activity_HIV__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {activity_HIV#not &NULL}{activity_HIV__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {activity_HIV#not &NULL}{activity_HIV__names__adjective}? -Assistant: This is a molecule that is {activity_HIV#not &NULL}{activity_HIV__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {activity_HIV#not &NULL}{activity_HIV__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {activity_HIV#not &NULL}be {activity_HIV__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_HIV#not &NULL}{activity_HIV__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_HIV#not &NULL}{activity_HIV__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {activity_HIV#not &NULL}be {activity_HIV__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_HIV#not &NULL}{activity_HIV__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_HIV#not &NULL}{activity_HIV__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {activity_HIV__names__adjective}:{activity_HIV#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {activity_HIV__names__adjective}:{activity_HIV#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_HIV__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{activity_HIV#False&True}""", # noqa: E501 +Result:{activity_HIV#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_HIV__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result:This molecule is {activity_HIV#not &NULL}{activity_HIV__names__adjective}.""", # noqa: E501 - # noqa: E501 """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. +Result:This molecule is {activity_HIV#not &NULL}{activity_HIV__names__adjective}.""", + # Description: A molecule that is {activity_HIV__names__adjective}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {activity_HIV__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {activity_HIV%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_HIV#not &NULL}{activity_HIV__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%activity_HIV%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_HIV#not &NULL}{activity_HIV__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%activity_HIV%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/human_intestinal_absorption/transform.py b/data/tabular/human_intestinal_absorption/transform.py index 8d363cc44..c3fb6c9e4 100644 --- a/data/tabular/human_intestinal_absorption/transform.py +++ b/data/tabular/human_intestinal_absorption/transform.py @@ -127,16 +127,16 @@ def get_and_transform_data(): journal = {Journal of Chemical Information and Modeling}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {absorption_HIA_Hou#no &NULL}{absorption_HIA_Hou__names__noun} properties.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {absorption_HIA_Hou#no &NULL}{absorption_HIA_Hou__names__noun} {#properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {absorption_HIA_Hou#not &NULL}{absorption_HIA_Hou__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {absorption_HIA_Hou#not &NULL}{absorption_HIA_Hou__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {absorption_HIA_Hou#no &NULL}{absorption_HIA_Hou__names__noun} properties.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {absorption_HIA_Hou#no &NULL}{absorption_HIA_Hou__names__noun} {#properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {absorption_HIA_Hou#not &NULL}{absorption_HIA_Hou__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {absorption_HIA_Hou#not &NULL}{absorption_HIA_Hou__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {absorption_HIA_Hou__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {absorption_HIA_Hou#False&True}""", # noqa: E501 +Result: {absorption_HIA_Hou#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {absorption_HIA_Hou__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -144,58 +144,58 @@ def get_and_transform_data(): Result: This molecule is {absorption_HIA_Hou#not &NULL}{absorption_HIA_Hou__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {absorption_HIA_Hou__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {absorption_HIA_Hou__names__adjective}? -Assistant: {absorption_HIA_Hou#No&Yes}, this molecule is {absorption_HIA_Hou#not &NULL}{absorption_HIA_Hou__names__adjective}.""", # noqa: E501 +Assistant: {absorption_HIA_Hou#No&Yes}, this molecule is {absorption_HIA_Hou#not &NULL}{absorption_HIA_Hou__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {absorption_HIA_Hou__names__adjective}? -Assistant: {absorption_HIA_Hou#No&Yes}, it is {absorption_HIA_Hou#not &NULL}{absorption_HIA_Hou__names__adjective}.""", # noqa: E501 +Assistant: {absorption_HIA_Hou#No&Yes}, it is {absorption_HIA_Hou#not &NULL}{absorption_HIA_Hou__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {absorption_HIA_Hou#not &NULL}{absorption_HIA_Hou__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {absorption_HIA_Hou#not &NULL}{absorption_HIA_Hou__names__adjective}? -Assistant: This is a molecule that is {absorption_HIA_Hou#not &NULL}{absorption_HIA_Hou__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {absorption_HIA_Hou#not &NULL}{absorption_HIA_Hou__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {absorption_HIA_Hou#not &NULL}be {absorption_HIA_Hou__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {absorption_HIA_Hou#not &NULL}{absorption_HIA_Hou__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {absorption_HIA_Hou#not &NULL}{absorption_HIA_Hou__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {absorption_HIA_Hou#not &NULL}be {absorption_HIA_Hou__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {absorption_HIA_Hou#not &NULL}{absorption_HIA_Hou__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {absorption_HIA_Hou#not &NULL}{absorption_HIA_Hou__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {absorption_HIA_Hou__names__adjective}:{absorption_HIA_Hou#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {absorption_HIA_Hou__names__adjective}:{absorption_HIA_Hou#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {absorption_HIA_Hou__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{absorption_HIA_Hou#False&True}""", # noqa: E501 - # noqa: E501 """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. +Result:{absorption_HIA_Hou#False&True}""", + # Description: A molecule that is {absorption_HIA_Hou__names__adjective}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {absorption_HIA_Hou__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {absorption_HIA_Hou%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {absorption_HIA_Hou__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {absorption_HIA_Hou%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {absorption_HIA_Hou#not &NULL}{absorption_HIA_Hou__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%absorption_HIA_Hou%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {absorption_HIA_Hou#not &NULL}{absorption_HIA_Hou__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%absorption_HIA_Hou%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/iupac_goldbook/transform.py b/data/tabular/iupac_goldbook/transform.py index 99b94fef7..617d55881 100644 --- a/data/tabular/iupac_goldbook/transform.py +++ b/data/tabular/iupac_goldbook/transform.py @@ -57,9 +57,7 @@ def get_and_transform_data(): def cleanup(x): if isinstance(x, list): return x[0] - elif x is None: - return "" - elif x.find("[image:") != -1: + elif x is None or x.find("[image:") != -1: return "" else: return x @@ -136,41 +134,41 @@ def cleanup(x): "}", ], "templates": [ - 'The {term__names__noun} "{term#}" can be {#described|defined!} {#by|as!}:\n{#definition}', # noqa + 'The {term__names__noun} "{term#}" can be {#described|defined!} {#by|as!}:\n{#definition}', """Task: Please {#give me|create|generate!} a {definition__names__noun} of a {term__names__noun}. Term: {term#} Constraint: Answer the question with {#full|complete!} sentences. -Result: {definition#}""", # noqa +Result: {definition#}""", """Task: Please {#give me|create|generate!} a {term__names__noun} for the {#following |!}{definition__names__noun}: Definition: {definition#} -Result: {term#}""", # noqa +Result: {term#}""", """User: Can you {#give me|create|generate!} a {term__names__noun} {#described|defined!} by: {#definition} -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {term#}""", # noqa +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {term#}""", """User: Can you {#give me|create|generate!} the {definition__names__noun} for the following {term__names__noun}: {#term} Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: -{#definition}""", # noqa +{#definition}""", """User: I'm {#searching|looking!} for the {term__names__noun} that can be described {#by|as!}: {#definition} -Assistant: This {term__names__noun} fits {#your|this!} definition: {term#}""", # noqa +Assistant: This {term__names__noun} fits {#your|this!} definition: {term#}""", """User: I want to {#come up with|create|generate!} a {definition__names__noun}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The {term__names__noun} can be described {#by|as!}: {#term} -Assistant: {#Ok|Got it!},{# here you go,|!} this {definition__names__noun} fits {#your|this!} description: {definition#}""", # noqa +Assistant: {#Ok|Got it!},{# here you go,|!} this {definition__names__noun} fits {#your|this!} description: {definition#}""", """User: I want to {#come up with|create|generate!} a {term__names__noun}. Assistant: {#This sounds very exciting. |This sounds very interesting. |!}How is the {term__names__noun} described? User: The {term__names__noun} can be described {#by|as!}: {#definition} -Assistant: {#Ok|Got it!},{# here you go,|!} this {term__names__noun} fits {#your|this!} description: {term#}""", # noqa +Assistant: {#Ok|Got it!},{# here you go,|!} this {term__names__noun} fits {#your|this!} description: {term#}""", """Task: Please {#give me|create|generate!} a {definition__names__noun} of a {term__names__noun}. Term: {term#} Constraint: Answer the question with {#full|complete!} sentences. -Result:{definition#}""", # noqa +Result:{definition#}""", """Task: Please {#give me|create|generate!} a {term__names__noun} for the {#following |!}{definition__names__noun}: Definition: {definition#} -Result:{term#}""", # noqa +Result:{term#}""", ], } diff --git a/data/tabular/kcnq2_potassium_channel_butkiewicz/transform.py b/data/tabular/kcnq2_potassium_channel_butkiewicz/transform.py index e3ecfc95d..b92c388ff 100644 --- a/data/tabular/kcnq2_potassium_channel_butkiewicz/transform.py +++ b/data/tabular/kcnq2_potassium_channel_butkiewicz/transform.py @@ -147,74 +147,74 @@ def get_and_transform_data(): journal = {Chemical Science}}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {activity_kcnq2_potassium_channel#no &NULL}{activity_kcnq2_potassium_channel__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {activity_kcnq2_potassium_channel#no &NULL}{activity_kcnq2_potassium_channel__names__noun}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {activity_kcnq2_potassium_channel#no &NULL}{activity_kcnq2_potassium_channel__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {activity_kcnq2_potassium_channel#no &NULL}{activity_kcnq2_potassium_channel__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {activity_kcnq2_potassium_channel#no &NULL}{activity_kcnq2_potassium_channel__names__noun}.", + "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {activity_kcnq2_potassium_channel#no &NULL}{activity_kcnq2_potassium_channel__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_kcnq2_potassium_channel__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {activity_kcnq2_potassium_channel#False&True}""", # noqa: E501 +Result: {activity_kcnq2_potassium_channel#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_kcnq2_potassium_channel__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}.""", # noqa: E501 +Result: This molecule is {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {activity_kcnq2_potassium_channel__names__gerund}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {activity_kcnq2_potassium_channel__names__gerund}? -Assistant: {activity_kcnq2_potassium_channel#No&Yes}, this molecule is {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}.""", # noqa: E501 +Assistant: {activity_kcnq2_potassium_channel#No&Yes}, this molecule is {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {activity_kcnq2_potassium_channel__names__gerund}? -Assistant: {activity_kcnq2_potassium_channel#No&Yes}, it is {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}.""", # noqa: E501 +Assistant: {activity_kcnq2_potassium_channel#No&Yes}, it is {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}? -Assistant: This is a molecule that is {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {activity_kcnq2_potassium_channel#not &NULL}be {activity_kcnq2_potassium_channel__names__gerund}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {activity_kcnq2_potassium_channel#not &NULL}be {activity_kcnq2_potassium_channel__names__gerund}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {activity_kcnq2_potassium_channel__names__gerund}:{activity_kcnq2_potassium_channel#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {activity_kcnq2_potassium_channel__names__gerund}:{activity_kcnq2_potassium_channel#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_kcnq2_potassium_channel__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{activity_kcnq2_potassium_channel#False&True}""", # noqa: E501 +Result:{activity_kcnq2_potassium_channel#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_kcnq2_potassium_channel__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result:This molecule is {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}.""", # noqa: E501 - # noqa: E501 """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. +Result:This molecule is {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}.""", + # Description: A molecule that is {activity_kcnq2_potassium_channel__names__gerund}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {activity_kcnq2_potassium_channel__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {activity_kcnq2_potassium_channel%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%activity_kcnq2_potassium_channel%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_kcnq2_potassium_channel#not &NULL}{activity_kcnq2_potassium_channel__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%activity_kcnq2_potassium_channel%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/ld50_catmos/meta.yaml b/data/tabular/ld50_catmos/meta.yaml index 00b0d5373..e4a74438e 100644 --- a/data/tabular/ld50_catmos/meta.yaml +++ b/data/tabular/ld50_catmos/meta.yaml @@ -1,145 +1,144 @@ ---- name: ld50_catmos description: |- - Acute toxicity LD50 measures - the most conservative dose that can lead to lethal adverse effects. - The higher the dose, the more lethal of a drug. - We aggregated the data from multiple SMILES by computing the mean. + Acute toxicity LD50 measures + the most conservative dose that can lead to lethal adverse effects. + The higher the dose, the more lethal of a drug. + We aggregated the data from multiple SMILES by computing the mean. targets: - - id: CATMoS_LD50_mgkg - description: Acute Toxicity LD50. - units: mg/kg - type: continuous - names: - - noun: acute oral toxicity rat LD50 - - noun: acute oral toxicity (LD50 in rats) - uris: - - http://www.bioassayontology.org/bao#BAO_0002117 - significant_digits: 1 - - id: log10_LD50 - description: Acute Toxicity LD50. - units: log10(mg/kg) - type: continuous - names: - - noun: log10 acute oral toxicity rat LD50 - - noun: log10 acute oral toxicity (LD50 in rats) - - noun: log10 LD50 in rats (oral exposure) - - noun: log10 rat LD50 (oral exposure) - significant_digits: 2 - - id: num_ghose_violations - description: Ghose filter violations - type: ordinal - significant_digits: 0 - names: - - noun: Ghose filter violations - - noun: violations of the Ghose filter - - id: num_lead_likeness_violations - description: Lead likeness filter violations - type: ordinal - significant_digits: 0 - names: - - noun: lead likeness filter violations - - noun: violations of the lead likeness filter - - id: num_lipinski_violations - description: Lipinski filter violations - type: ordinal - significant_digits: 0 - names: - - noun: Lipinski rule violations - - noun: violations of the Lipinski rules - - id: molecular_mass - description: Molecular mass - type: continuous - units: g/mol - names: - - noun: molecular mass - - noun: molecular weight - - id: num_carbon_atoms - description: Number of carbon atoms - type: ordinal - significant_digits: 0 - names: - - noun: carbon atoms - - id: num_oxygen_atoms - description: Number of oxygen atoms - type: ordinal - significant_digits: 0 - names: - - noun: oxygen atoms + - id: CATMoS_LD50_mgkg + description: Acute Toxicity LD50. + units: mg/kg + type: continuous + names: + - noun: acute oral toxicity rat LD50 + - noun: acute oral toxicity (LD50 in rats) + uris: + - http://www.bioassayontology.org/bao#BAO_0002117 + significant_digits: 1 + - id: log10_LD50 + description: Acute Toxicity LD50. + units: log10(mg/kg) + type: continuous + names: + - noun: log10 acute oral toxicity rat LD50 + - noun: log10 acute oral toxicity (LD50 in rats) + - noun: log10 LD50 in rats (oral exposure) + - noun: log10 rat LD50 (oral exposure) + significant_digits: 2 + - id: num_ghose_violations + description: Ghose filter violations + type: ordinal + significant_digits: 0 + names: + - noun: Ghose filter violations + - noun: violations of the Ghose filter + - id: num_lead_likeness_violations + description: Lead likeness filter violations + type: ordinal + significant_digits: 0 + names: + - noun: lead likeness filter violations + - noun: violations of the lead likeness filter + - id: num_lipinski_violations + description: Lipinski filter violations + type: ordinal + significant_digits: 0 + names: + - noun: Lipinski rule violations + - noun: violations of the Lipinski rules + - id: molecular_mass + description: Molecular mass + type: continuous + units: g/mol + names: + - noun: molecular mass + - noun: molecular weight + - id: num_carbon_atoms + description: Number of carbon atoms + type: ordinal + significant_digits: 0 + names: + - noun: carbon atoms + - id: num_oxygen_atoms + description: Number of oxygen atoms + type: ordinal + significant_digits: 0 + names: + - noun: oxygen atoms identifiers: - - id: SMILES - type: SMILES - description: SMILES + - id: SMILES + type: SMILES + description: SMILES license: CC BY 4.0 links: - - url: https://ehp.niehs.nih.gov/doi/full/10.1289/EHP8495#supplementary-materials - description: corresponding publication + - url: https://ehp.niehs.nih.gov/doi/full/10.1289/EHP8495#supplementary-materials + description: corresponding publication num_points: 9032 bibtex: - - |- - @article{Mansouri_2021, title={CATMoS: Collaborative Acute Toxicity Modeling Suite}, - volume={129}, - ISSN={1552-9924}, - url={http://dx.doi.org/10.1289/EHP8495}, - DOI={10.1289/ehp8495}, - number={4}, - journal={Environmental Health Perspectives}, - publisher={Environmental Health Perspectives}, - author={Mansouri, Kamel and Karmaus, Agnes L. and Fitzpatrick, Jeremy - and Patlewicz, Grace and Pradeep, Prachi and Alberga, Domenico and - Alepee, Nathalie and Allen, Timothy E.H. and Allen, Dave and Alves, Vinicius M. - and Andrade, Carolina H. and Auernhammer, Tyler R. and Ballabio, Davide and - Bell, Shannon and Benfenati, Emilio and Bhattacharya, Sudin and - Bastos, Joyce V. and Boyd, Stephen and Brown, J.B. and Capuzzi, Stephen J. and - Chushak, Yaroslav and Ciallella, Heather and Clark, Alex M. and - Consonni, Viviana and Daga, Pankaj R. and Ekins, Sean and Farag, Sherif and - Fedorov, Maxim and Fourches, Denis and Gadaleta, Domenico and Gao, Feng and - Gearhart, Jeffery M. and Goh, Garett and Goodman, Jonathan M. and - Grisoni, Francesca and Grulke, Christopher M. and Hartung, Thomas and - Hirn, Matthew and Karpov, Pavel and Korotcov, Alexandru and - Lavado, Giovanna J. and Lawless, Michael and Li, Xinhao and - Luechtefeld, Thomas and Lunghini, Filippo and Mangiatordi, Giuseppe F. and - Marcou, Gilles and Marsh, Dan and Martin, Todd and Mauri, Andrea and - Muratov, Eugene N. and Myatt, Glenn J. and Nguyen, Dac-Trung and - Nicolotti, Orazio and Note, Reine and Pande, Paritosh and - Parks, Amanda K. and Peryea, Tyler and Polash, Ahsan H. and - Rallo, Robert and Roncaglioni, Alessandra and Rowlands, Craig and - Ruiz, Patricia and Russo, Daniel P. and Sayed, Ahmed and Sayre, Risa and - Sheils, Timothy and Siegel, Charles and Silva, Arthur C. and Simeonov, Anton and - Sosnin, Sergey and Southall, Noel and Strickland, Judy and Tang, Yun and - Teppen, Brian and Tetko, Igor V. and Thomas, Dennis and Tkachenko, Valery and - Todeschini, Roberto and Toma, Cosimo and Tripodi, Ignacio and - Trisciuzzi, Daniela and Tropsha, Alexander and Varnek, Alexandre and - Vukovic, Kristijan and Wang, Zhongyu and Wang, Liguo and - Waters, Katrina M. and Wedlake, Andrew J. and Wijeyesakere, Sanjeeva J. and - Wilson, Dan and Xiao, Zijun and Yang, Hongbin and Zahoranszky-Kohalmi, Gergely and - Zakharov, Alexey V. and Zhang, Fagen F. and Zhang, Zhen and Zhao, Tongan and - Zhu, Hao and Zorn, Kimberley M. and Casey, Warren and Kleinstreuer, Nicole C.}, - year={2021}, month=apr } + - |- + @article{Mansouri_2021, title={CATMoS: Collaborative Acute Toxicity Modeling Suite}, + volume={129}, + ISSN={1552-9924}, + url={http://dx.doi.org/10.1289/EHP8495}, + DOI={10.1289/ehp8495}, + number={4}, + journal={Environmental Health Perspectives}, + publisher={Environmental Health Perspectives}, + author={Mansouri, Kamel and Karmaus, Agnes L. and Fitzpatrick, Jeremy + and Patlewicz, Grace and Pradeep, Prachi and Alberga, Domenico and + Alepee, Nathalie and Allen, Timothy E.H. and Allen, Dave and Alves, Vinicius M. + and Andrade, Carolina H. and Auernhammer, Tyler R. and Ballabio, Davide and + Bell, Shannon and Benfenati, Emilio and Bhattacharya, Sudin and + Bastos, Joyce V. and Boyd, Stephen and Brown, J.B. and Capuzzi, Stephen J. and + Chushak, Yaroslav and Ciallella, Heather and Clark, Alex M. and + Consonni, Viviana and Daga, Pankaj R. and Ekins, Sean and Farag, Sherif and + Fedorov, Maxim and Fourches, Denis and Gadaleta, Domenico and Gao, Feng and + Gearhart, Jeffery M. and Goh, Garett and Goodman, Jonathan M. and + Grisoni, Francesca and Grulke, Christopher M. and Hartung, Thomas and + Hirn, Matthew and Karpov, Pavel and Korotcov, Alexandru and + Lavado, Giovanna J. and Lawless, Michael and Li, Xinhao and + Luechtefeld, Thomas and Lunghini, Filippo and Mangiatordi, Giuseppe F. and + Marcou, Gilles and Marsh, Dan and Martin, Todd and Mauri, Andrea and + Muratov, Eugene N. and Myatt, Glenn J. and Nguyen, Dac-Trung and + Nicolotti, Orazio and Note, Reine and Pande, Paritosh and + Parks, Amanda K. and Peryea, Tyler and Polash, Ahsan H. and + Rallo, Robert and Roncaglioni, Alessandra and Rowlands, Craig and + Ruiz, Patricia and Russo, Daniel P. and Sayed, Ahmed and Sayre, Risa and + Sheils, Timothy and Siegel, Charles and Silva, Arthur C. and Simeonov, Anton and + Sosnin, Sergey and Southall, Noel and Strickland, Judy and Tang, Yun and + Teppen, Brian and Tetko, Igor V. and Thomas, Dennis and Tkachenko, Valery and + Todeschini, Roberto and Toma, Cosimo and Tripodi, Ignacio and + Trisciuzzi, Daniela and Tropsha, Alexander and Varnek, Alexandre and + Vukovic, Kristijan and Wang, Zhongyu and Wang, Liguo and + Waters, Katrina M. and Wedlake, Andrew J. and Wijeyesakere, Sanjeeva J. and + Wilson, Dan and Xiao, Zijun and Yang, Hongbin and Zahoranszky-Kohalmi, Gergely and + Zakharov, Alexey V. and Zhang, Fagen F. and Zhang, Zhen and Zhao, Tongan and + Zhu, Hao and Zorn, Kimberley M. and Casey, Warren and Kleinstreuer, Nicole C.}, + year={2021}, month=apr } templates: - - The {#molecule|chemical|compound!} with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} an {CATMoS_LD50_mgkg__names__noun} of {CATMoS_LD50_mgkg#} {CATMoS_LD50_mgkg__units}. - - The {#molecule|chemical|compound!} with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} a {log10_LD50__names__noun} of {log10_LD50#} {log10_LD50__units}. - - | - Task: Determine the acute oral toxicity and molecular properties of a {#molecule|chemical|compound!} given the {SMILES__description}. - Input: {SMILES#} - Desired Output: {CATMoS_LD50_mgkg__names__noun}, {log10_LD50__names__noun}, {num_ghose_violations__names__noun}, {num_lead_likeness_violations__names__noun}, {num_lipinski_violations__names__noun}, {molecular_mass__names__noun}, {num_carbon_atoms__names__noun}, {num_oxygen_atoms__names__noun} - Output: {CATMoS_LD50_mgkg#} {CATMoS_LD50_mgkg__units}, {log10_LD50#} {log10_LD50__units}, {num_ghose_violations#}, {num_lead_likeness_violations#}, {num_lipinski_violations#}, {molecular_mass#} {molecular_mass__units}, {num_carbon_atoms#}, {num_oxygen_atoms#} - - | - Context: You are {#an assistant|researcher|scientist!} in a pharmaceutical company. Your {#boss|superior|department head!} has asked you to {#design|create|synthesize!} a new drug. - User: The {#drug|compound|chemical!} should have a {CATMoS_LD50_mgkg__names__noun} of {CATMoS_LD50_mgkg#} {CATMoS_LD50_mgkg__units}, {num_ghose_violations#} {num_ghose_violations__names__noun}, {num_lead_likeness_violations#} {num_lead_likeness_violations__names__noun}, {num_lipinski_violations#} {num_lipinski_violations__names__noun}, {molecular_mass#} {molecular_mass__names__noun} {molecular_mass__units}, {num_carbon_atoms#} {num_carbon_atoms__names__noun}, and {num_oxygen_atoms#} {num_oxygen_atoms__names__noun}. - Assistant: {#Happy to help!|Sure!|Of course!} The {#molecule|chemical|compound!} with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} the desired properties. - - | - User: I need a {#drug|compound|chemical!} with a {log10_LD50__names__noun} of {log10_LD50#} {log10_LD50__units}. - Assistant: {#Happy to help!|Sure!|Of course!} Can you provide me with more {#constraints|details|information!}? - User: The {#drug|compound|chemical!} should have {num_ghose_violations#} {num_ghose_violations__names__noun}, {num_lead_likeness_violations#} {num_lead_likeness_violations__names__noun}, {num_lipinski_violations#} {num_lipinski_violations__names__noun}, {num_carbon_atoms#} {num_carbon_atoms__names__noun}, and {num_oxygen_atoms#} {num_oxygen_atoms__names__noun}. - Assistant: The {#molecule|chemical|compound!} with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} the desired properties. - - | - User: I need a {#drug|compound|chemical!} with a {CATMoS_LD50_mgkg__names__noun} of {CATMoS_LD50_mgkg#} {CATMoS_LD50_mgkg__units}. - Assistant: {#Happy to help!|Sure!|Of course!} Can you provide me with more {#constraints|details|information!}? - User: The {#drug|compound|chemical!} should have a {num_carbon_atoms#} {num_carbon_atoms__names__noun}, {num_oxygen_atoms#} {num_oxygen_atoms__names__noun}, and a {molecular_mass__names__noun} of {molecular_mass#} {molecular_mass__units}. Could you please only provide me with the {SMILES__description} and return no other information? - Assistant: {SMILES#} - - | - User: I am looking for a {#drug|compound|chemical!} with a {log10_LD50__names__noun} of {log10_LD50#} {log10_LD50__units}. - Assistant: {#That's interesting!|Interesting!|I see!} Can you provide me with more {#constraints|details|information!}? - User: The {#drug|compound|chemical!} should have {num_ghose_violations#} {num_ghose_violations__names__noun}, {num_lead_likeness_violations#} {num_lead_likeness_violations__names__noun}, {num_lipinski_violations#} {num_lipinski_violations__names__noun}, {num_carbon_atoms#} {num_carbon_atoms__names__noun}, and {num_oxygen_atoms#} {num_oxygen_atoms__names__noun}. Please return only the {SMILES__description} wrapped as follows [ANSWER][/ANSWER]. - Assistant: [ANSWER]{SMILES#}[/ANSWER] + - The {#molecule|chemical|compound!} with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} an {CATMoS_LD50_mgkg__names__noun} of {CATMoS_LD50_mgkg#} {CATMoS_LD50_mgkg__units}. + - The {#molecule|chemical|compound!} with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} a {log10_LD50__names__noun} of {log10_LD50#} {log10_LD50__units}. + - | + Task: Determine the acute oral toxicity and molecular properties of a {#molecule|chemical|compound!} given the {SMILES__description}. + Input: {SMILES#} + Desired Output: {CATMoS_LD50_mgkg__names__noun}, {log10_LD50__names__noun}, {num_ghose_violations__names__noun}, {num_lead_likeness_violations__names__noun}, {num_lipinski_violations__names__noun}, {molecular_mass__names__noun}, {num_carbon_atoms__names__noun}, {num_oxygen_atoms__names__noun} + Output: {CATMoS_LD50_mgkg#} {CATMoS_LD50_mgkg__units}, {log10_LD50#} {log10_LD50__units}, {num_ghose_violations#}, {num_lead_likeness_violations#}, {num_lipinski_violations#}, {molecular_mass#} {molecular_mass__units}, {num_carbon_atoms#}, {num_oxygen_atoms#} + - | + Context: You are {#an assistant|researcher|scientist!} in a pharmaceutical company. Your {#boss|superior|department head!} has asked you to {#design|create|synthesize!} a new drug. + User: The {#drug|compound|chemical!} should have a {CATMoS_LD50_mgkg__names__noun} of {CATMoS_LD50_mgkg#} {CATMoS_LD50_mgkg__units}, {num_ghose_violations#} {num_ghose_violations__names__noun}, {num_lead_likeness_violations#} {num_lead_likeness_violations__names__noun}, {num_lipinski_violations#} {num_lipinski_violations__names__noun}, {molecular_mass#} {molecular_mass__names__noun} {molecular_mass__units}, {num_carbon_atoms#} {num_carbon_atoms__names__noun}, and {num_oxygen_atoms#} {num_oxygen_atoms__names__noun}. + Assistant: {#Happy to help!|Sure!|Of course!} The {#molecule|chemical|compound!} with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} the desired properties. + - | + User: I need a {#drug|compound|chemical!} with a {log10_LD50__names__noun} of {log10_LD50#} {log10_LD50__units}. + Assistant: {#Happy to help!|Sure!|Of course!} Can you provide me with more {#constraints|details|information!}? + User: The {#drug|compound|chemical!} should have {num_ghose_violations#} {num_ghose_violations__names__noun}, {num_lead_likeness_violations#} {num_lead_likeness_violations__names__noun}, {num_lipinski_violations#} {num_lipinski_violations__names__noun}, {num_carbon_atoms#} {num_carbon_atoms__names__noun}, and {num_oxygen_atoms#} {num_oxygen_atoms__names__noun}. + Assistant: The {#molecule|chemical|compound!} with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} the desired properties. + - | + User: I need a {#drug|compound|chemical!} with a {CATMoS_LD50_mgkg__names__noun} of {CATMoS_LD50_mgkg#} {CATMoS_LD50_mgkg__units}. + Assistant: {#Happy to help!|Sure!|Of course!} Can you provide me with more {#constraints|details|information!}? + User: The {#drug|compound|chemical!} should have a {num_carbon_atoms#} {num_carbon_atoms__names__noun}, {num_oxygen_atoms#} {num_oxygen_atoms__names__noun}, and a {molecular_mass__names__noun} of {molecular_mass#} {molecular_mass__units}. Could you please only provide me with the {SMILES__description} and return no other information? + Assistant: {SMILES#} + - | + User: I am looking for a {#drug|compound|chemical!} with a {log10_LD50__names__noun} of {log10_LD50#} {log10_LD50__units}. + Assistant: {#That's interesting!|Interesting!|I see!} Can you provide me with more {#constraints|details|information!}? + User: The {#drug|compound|chemical!} should have {num_ghose_violations#} {num_ghose_violations__names__noun}, {num_lead_likeness_violations#} {num_lead_likeness_violations__names__noun}, {num_lipinski_violations#} {num_lipinski_violations__names__noun}, {num_carbon_atoms#} {num_carbon_atoms__names__noun}, and {num_oxygen_atoms#} {num_oxygen_atoms__names__noun}. Please return only the {SMILES__description} wrapped as follows [ANSWER][/ANSWER]. + Assistant: [ANSWER]{SMILES#}[/ANSWER] diff --git a/data/tabular/m1_muscarinic_receptor_agonists_butkiewicz/transform.py b/data/tabular/m1_muscarinic_receptor_agonists_butkiewicz/transform.py index a0c1d38d0..36935cd4a 100644 --- a/data/tabular/m1_muscarinic_receptor_agonists_butkiewicz/transform.py +++ b/data/tabular/m1_muscarinic_receptor_agonists_butkiewicz/transform.py @@ -144,74 +144,74 @@ def get_and_transform_data(): journal = {Chemical Science}}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {m1_muscarinic_agonist#no &NULL}{m1_muscarinic_agonist__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {m1_muscarinic_agonist#no &NULL}{m1_muscarinic_agonist__names__noun}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {m1_muscarinic_agonist#no &NULL}{m1_muscarinic_agonist__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {m1_muscarinic_agonist#no &NULL}{m1_muscarinic_agonist__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {m1_muscarinic_agonist#no &NULL}{m1_muscarinic_agonist__names__noun}.", + "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {m1_muscarinic_agonist#no &NULL}{m1_muscarinic_agonist__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {m1_muscarinic_agonist__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {m1_muscarinic_agonist#False&True}""", # noqa: E501 +Result: {m1_muscarinic_agonist#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {m1_muscarinic_agonist__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}.""", # noqa: E501 +Result: This molecule is {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {m1_muscarinic_agonist__names__gerund}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {m1_muscarinic_agonist__names__gerund}? -Assistant: {m1_muscarinic_agonist#No&Yes}, this molecule is {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}.""", # noqa: E501 +Assistant: {m1_muscarinic_agonist#No&Yes}, this molecule is {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {m1_muscarinic_agonist__names__gerund}? -Assistant: {m1_muscarinic_agonist#No&Yes}, it is {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}.""", # noqa: E501 +Assistant: {m1_muscarinic_agonist#No&Yes}, it is {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}? -Assistant: This is a molecule that is {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {m1_muscarinic_agonist#not &NULL}be {m1_muscarinic_agonist__names__gerund}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {m1_muscarinic_agonist#not &NULL}be {m1_muscarinic_agonist__names__gerund}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {m1_muscarinic_agonist__names__gerund}:{m1_muscarinic_agonist#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {m1_muscarinic_agonist__names__gerund}:{m1_muscarinic_agonist#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {m1_muscarinic_agonist__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{m1_muscarinic_agonist#False&True}""", # noqa: E501 +Result:{m1_muscarinic_agonist#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {m1_muscarinic_agonist__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result:This molecule is {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}.""", # noqa: E501 - # noqa: E501 """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. +Result:This molecule is {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}.""", + # Description: A molecule that is {m1_muscarinic_agonist__names__gerund}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {m1_muscarinic_agonist__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {m1_muscarinic_agonist%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%m1_muscarinic_agonist%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {m1_muscarinic_agonist#not &NULL}{m1_muscarinic_agonist__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%m1_muscarinic_agonist%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/m1_muscarinic_receptor_antagonists_butkiewicz/transform.py b/data/tabular/m1_muscarinic_receptor_antagonists_butkiewicz/transform.py index 89a5b4ab5..d31bb31f4 100644 --- a/data/tabular/m1_muscarinic_receptor_antagonists_butkiewicz/transform.py +++ b/data/tabular/m1_muscarinic_receptor_antagonists_butkiewicz/transform.py @@ -136,74 +136,74 @@ def get_and_transform_data(): journal = {Chemical Science}}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {m1_muscarinic_antagonist#no &NULL}{m1_muscarinic_antagonist__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {m1_muscarinic_antagonist#no &NULL}{m1_muscarinic_antagonist__names__noun}.", # noqa: E501 - "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {m1_muscarinic_antagonist#no &NULL}{m1_muscarinic_antagonist__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {m1_muscarinic_antagonist#no &NULL}{m1_muscarinic_antagonist__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule {#shows|exhibits|displays!} {m1_muscarinic_antagonist#no &NULL}{m1_muscarinic_antagonist__names__noun}.", + "The {SMILES__description} {SMILES#} represents a molecule that {#shows|exhibits|displays!} {m1_muscarinic_antagonist#no &NULL}{m1_muscarinic_antagonist__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {m1_muscarinic_antagonist__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {m1_muscarinic_antagonist#False&True}""", # noqa: E501 +Result: {m1_muscarinic_antagonist#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {m1_muscarinic_antagonist__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}.""", # noqa: E501 +Result: This molecule is {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {m1_muscarinic_antagonist__names__gerund}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {m1_muscarinic_antagonist__names__gerund}? -Assistant: {m1_muscarinic_antagonist#No&Yes}, this molecule is {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}.""", # noqa: E501 +Assistant: {m1_muscarinic_antagonist#No&Yes}, this molecule is {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {m1_muscarinic_antagonist__names__gerund}? -Assistant: {m1_muscarinic_antagonist#No&Yes}, it is {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}.""", # noqa: E501 +Assistant: {m1_muscarinic_antagonist#No&Yes}, it is {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}? -Assistant: This is a molecule that is {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {m1_muscarinic_antagonist#not &NULL}be {m1_muscarinic_antagonist__names__gerund}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {m1_muscarinic_antagonist#not &NULL}be {m1_muscarinic_antagonist__names__gerund}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {m1_muscarinic_antagonist__names__gerund}:{m1_muscarinic_antagonist#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {m1_muscarinic_antagonist__names__gerund}:{m1_muscarinic_antagonist#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {m1_muscarinic_antagonist__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{m1_muscarinic_antagonist#False&True}""", # noqa: E501 +Result:{m1_muscarinic_antagonist#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {m1_muscarinic_antagonist__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result:This molecule is {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}.""", # noqa: E501 - # noqa: E501 """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. +Result:This molecule is {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}.""", + # Description: A molecule that is {m1_muscarinic_antagonist__names__gerund}. - # Result:{SMILES#}""", # noqa: E501 + # Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {m1_muscarinic_antagonist__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {m1_muscarinic_antagonist%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%m1_muscarinic_antagonist%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {m1_muscarinic_antagonist#not &NULL}{m1_muscarinic_antagonist__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%m1_muscarinic_antagonist%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/mol_repr_transl/transform.py b/data/tabular/mol_repr_transl/transform.py index b9ce33a07..70315fca9 100644 --- a/data/tabular/mol_repr_transl/transform.py +++ b/data/tabular/mol_repr_transl/transform.py @@ -27,37 +27,37 @@ "num_points": None, "bibtex": ["Please see source material."], "templates": [ - "The molecule with the {IDENTIFIER__names__noun} {#representation of |!}{IDENTIFIER#} can also be represented with the {TARGET__names__noun} {#representation |!}{TARGET#}.", # noqa: E501 - "The molecule with the {TARGET__names__noun} {#representation of |!}{TARGET#} can also be represented with the {IDENTIFIER__names__noun} {#representation |!}{IDENTIFIER#}.", # noqa: E501 + "The molecule with the {IDENTIFIER__names__noun} {#representation of |!}{IDENTIFIER#} can also be represented with the {TARGET__names__noun} {#representation |!}{TARGET#}.", + "The molecule with the {TARGET__names__noun} {#representation of |!}{TARGET#} can also be represented with the {IDENTIFIER__names__noun} {#representation |!}{IDENTIFIER#}.", # Instruction tuning text templates """Task: Please {#create|generate!} a molecule representation based on {#the input molecule representation and |!}the description. Description: {#Generate|Create!} the {TARGET__names__noun} from the {IDENTIFIER__names__noun}. {#Molecule |!}{IDENTIFIER__names__noun}: {IDENTIFIER#} Constraint: Even if you are {#uncertain|not sure!}, you must answer with a representation without using any {#other|additional!} words. -Result: {TARGET#}""", # noqa: E501 +Result: {TARGET#}""", """Task: Please {#create|generate!} a molecule representation based on {#the input molecule representation and |!}the description. Description: {#Generate|Create!} the {IDENTIFIER__names__noun} from the {TARGET__names__noun}. {#Molecule |!}{TARGET__names__noun}: {TARGET#} Constraint: Even if you are {#uncertain|not sure!}, you must answer with a representation without using any {#other|additional!} words. -Result: {IDENTIFIER#}""", # noqa: E501 +Result: {IDENTIFIER#}""", # Conversational text templates """User: Can you {#tell me|create|generate!} the {TARGET__names__noun} of the molecule with the {IDENTIFIER__names__noun} {IDENTIFIER#}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, this molecule has a {TARGET__names__noun} of {TARGET#}.""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, this molecule has a {TARGET__names__noun} of {TARGET#}.""", """User: Can you {#tell me|create|generate!} the {IDENTIFIER__names__noun} of the molecule with the {TARGET__names__noun} {TARGET#}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, this molecule has a {IDENTIFIER__names__noun} of {IDENTIFIER#}.""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, this molecule has a {IDENTIFIER__names__noun} of {IDENTIFIER#}.""", # Benchmarking text templates - "The molecule with the {IDENTIFIER__names__noun} {#representation of |!}{IDENTIFIER#} can also be represented with the {TARGET__names__noun}{# representation|!}:{TARGET#}.", # noqa: E501 - "The molecule with the {TARGET__names__noun} {#representation of |!}{TARGET#} can also be represented with the {IDENTIFIER__names__noun}{# representation|!}:{IDENTIFIER#}.", # noqa: E501 + "The molecule with the {IDENTIFIER__names__noun} {#representation of |!}{IDENTIFIER#} can also be represented with the {TARGET__names__noun}{# representation|!}:{TARGET#}.", + "The molecule with the {TARGET__names__noun} {#representation of |!}{TARGET#} can also be represented with the {IDENTIFIER__names__noun}{# representation|!}:{IDENTIFIER#}.", """Task: Please {#create|generate!} a molecule representation based on {#the input molecule representation and |!}the description. Description: {#Generate|Create!} the {TARGET__names__noun} from the {IDENTIFIER__names__noun}. {#Molecule |!}{IDENTIFIER__names__noun}: {IDENTIFIER#} Constraint: Even if you are {#uncertain|not sure!}, you must answer with a representation without using any {#other|additional!} words. -Result:{TARGET#}""", # noqa: E501 +Result:{TARGET#}""", """Task: Please {#create|generate!} a molecule representation based on {#the input molecule representation and |!}the description. Description: {#Generate|Create!} the {IDENTIFIER__names__noun} from the {TARGET__names__noun}. {#Molecule |!}{TARGET__names__noun}: {TARGET#} Constraint: Even if you are {#uncertain|not sure!}, you must answer with a representation without using any {#other|additional!} words. -Result:{IDENTIFIER#}""", # noqa: E501 +Result:{IDENTIFIER#}""", ], } @@ -78,7 +78,7 @@ def smiles_with_hydrogens(smiles): mol = Chem.MolFromSmiles(smiles) mol = Chem.AddHs(mol) return Chem.MolToSmiles(mol) - except BaseException: # noqa: E722 + except BaseException: return pd.NA @@ -100,7 +100,7 @@ def get_and_transform_data(): col_len = len(df.columns) - 1 # else: # print( - # "CAUTION: No split information found, maybe you need to rerun the train_test_split.py script over extend_tabular_processed.csv?" # noqa: E501 + # "CAUTION: No split information found, maybe you need to rerun the train_test_split.py script over extend_tabular_processed.csv?" # ) # col_len = len(df.columns) diff --git a/data/tabular/mona/example_processing_and_templates.ipynb b/data/tabular/mona/example_processing_and_templates.ipynb index 5f12a6f7f..89eadb645 100644 --- a/data/tabular/mona/example_processing_and_templates.ipynb +++ b/data/tabular/mona/example_processing_and_templates.ipynb @@ -8,21 +8,20 @@ "outputs": [], "source": [ "import json\n", - "import pandas as pd\n", - "import numpy as np\n", - "from json.decoder import JSONDecodeError\n", + "import os\n", "from collections import Counter\n", - "from pprint import pprint\n", "from io import BytesIO\n", - "import requests\n", + "from json.decoder import JSONDecodeError\n", + "from pprint import pprint\n", "from zipfile import ZipFile\n", - "import os\n", - "from tqdm import tqdm\n", + "\n", + "import numpy as np\n", + "import pandas as pd\n", + "import requests\n", "\n", "# import datasets\n", - "import rdkit\n", - "import rdkit.Chem as Chem\n", - "import rdkit.RDLogger as RDLogger" + "from rdkit import Chem, RDLogger\n", + "from tqdm import tqdm" ] }, { diff --git a/data/tabular/mona/transform.py b/data/tabular/mona/transform.py index 18fdad2b8..f6c7c6f56 100644 --- a/data/tabular/mona/transform.py +++ b/data/tabular/mona/transform.py @@ -56,49 +56,48 @@ "benchmarks": [], "num_points": 0, # will be updated "bibtex": [ - # noqa ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} has a {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}.", # noqa: E501 - "Based on the {SMILES__description} {#representation of |!}{SMILES#}, the molecule has a {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is representing!} a molecule {#that has a|with a!} {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}.", # noqa: E501 - "The molecule with the {SMILES__description} {SMILES#} has a {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}.", # noqa: E501 + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} has a {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}.", + "Based on the {SMILES__description} {#representation of |!}{SMILES#}, the molecule has a {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}.", + "The {SMILES__description} {SMILES#} {#represents|is representing!} a molecule {#that has a|with a!} {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}.", + "The molecule with the {SMILES__description} {SMILES#} has a {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}.", # Instruction tuning text templates """Task: Please predict a molecule feature based on the description. Description: Predict the {spectral_entropy__names__noun} in {spectral_entropy__units}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must answer with a numeric value in {spectral_entropy__units} without using any {#other|additional!} words. -Result: {spectral_entropy#} {spectral_entropy__units}""", # noqa: E501 +Result: {spectral_entropy#} {spectral_entropy__units}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that has a {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} the {spectral_entropy__names__noun} in {spectral_entropy__units} of the molecule with the {SMILES__description} {SMILES#}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, this molecule has a {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}.""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, this molecule has a {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that has a {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that has a {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}. -Assistant: This is a molecule that has a {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that has a {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should have a {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} represents a molecule that has a {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} represents a molecule that has a {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should have a {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} represents a molecule that has a {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} represents a molecule that has a {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}: {SMILES#}""", # Benchmarking text templates - "The {spectral_entropy__names__noun} of the molecule with the {SMILES__description} {SMILES#} is:{spectral_entropy#} {spectral_entropy__units}", # noqa: E501 - "The {spectral_entropy__names__noun} of the {SMILES__description} {SMILES#} is:{spectral_entropy#} {spectral_entropy__units}", # noqa: E501 - "The {spectral_entropy__names__noun} of the molecule {SMILES__description} {SMILES#} is:{spectral_entropy#} {spectral_entropy__units}", # noqa: E501 + "The {spectral_entropy__names__noun} of the molecule with the {SMILES__description} {SMILES#} is:{spectral_entropy#} {spectral_entropy__units}", + "The {spectral_entropy__names__noun} of the {SMILES__description} {SMILES#} is:{spectral_entropy#} {spectral_entropy__units}", + "The {spectral_entropy__names__noun} of the molecule {SMILES__description} {SMILES#} is:{spectral_entropy#} {spectral_entropy__units}", """Task: Please predict a molecule feature based on the description. Description: Predict the {spectral_entropy__names__noun} in {spectral_entropy__units} of a molecule. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must answer with a numeric value in {spectral_entropy__units} without using any {#other|additional!} words. -Result:{spectral_entropy#} {spectral_entropy__units}""", # noqa: E501 +Result:{spectral_entropy#} {spectral_entropy__units}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that has {spectral_entropy__names__noun} of {spectral_entropy#} {spectral_entropy__units}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", ], } diff --git a/data/tabular/nlmchem/transform.py b/data/tabular/nlmchem/transform.py index 3a7446f66..6988f8867 100644 --- a/data/tabular/nlmchem/transform.py +++ b/data/tabular/nlmchem/transform.py @@ -85,29 +85,29 @@ def get_and_transform_data(): }""", ], "templates": [ - 'The {Abbreviation__names__noun} "{Abbreviation#}" stands for "{#Full_Form}".', # noqa + 'The {Abbreviation__names__noun} "{Abbreviation#}" stands for "{#Full_Form}".', """Task: Please give me the {Full_Form__names__noun} of the {Abbreviation__names__noun}. Abbreviation: {Abbreviation#} Constraint: Answer the question with {#full|complete!} words. -Result: {Full_Form#}""", # noqa +Result: {Full_Form#}""", """Task: Please give me the {Abbreviation__names__noun} of the following {Full_Form__names__noun}. Full form or meaning of the abbreviation: {Full_Form#} Constraint: Answer the question with an {Abbreviation__names__noun}. -Result: {Abbreviation#}""", # noqa +Result: {Abbreviation#}""", """User: Can you give me the {Abbreviation__names__noun} of the following {Full_Form__names__noun}: {#Full_Form} -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {Abbreviation#}""", # noqa +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {Abbreviation#}""", """User: Can you give me the {Full_Form__names__noun} of the following {Abbreviation__names__noun}: {#Abbreviation} -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {Full_Form#}""", # noqa +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {Full_Form#}""", """User: I'm {#searching|looking!} for the {Abbreviation__names__noun} for: {#Full_Form} -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {Abbreviation#}""", # noqa +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {Abbreviation#}""", """Task: Please give me the {Full_Form__names__noun} of the {Abbreviation__names__noun}. Abbreviation: {Abbreviation#} Constraint: Answer the question with {#full|complete!} words. -Result:{Full_Form#}""", # noqa +Result:{Full_Form#}""", """Task: Please give me the {Abbreviation__names__noun} of the following {Full_Form__names__noun}. Full form or meaning of the abbreviation: {Full_Form#} Constraint: Answer the question with an {Abbreviation__names__noun}. -Result:{Abbreviation#}""", # noqa +Result:{Abbreviation#}""", ], } diff --git a/data/tabular/nr_ahr_tox21/transform.py b/data/tabular/nr_ahr_tox21/transform.py index 522c694a5..cd6d52370 100644 --- a/data/tabular/nr_ahr_tox21/transform.py +++ b/data/tabular/nr_ahr_tox21/transform.py @@ -117,17 +117,17 @@ def get_and_transform_data(): journal = {Frontiers in Environmental Science}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__adjective}.", # noqa: E501 - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__gerund}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_NR-AhR#no &NULL}{toxicity_NR-AhR__names__noun} {#properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_NR-AhR#not &NULL}identified as {toxicity_NR-AhR__names__adjective}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__adjective}.", + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__gerund}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_NR-AhR#no &NULL}{toxicity_NR-AhR__names__noun} {#properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_NR-AhR#not &NULL}identified as {toxicity_NR-AhR__names__adjective}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-AhR__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra!} words. -Result: {toxicity_NR-AhR#False&True}""", # noqa: E501 +Result: {toxicity_NR-AhR#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-AhR__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -135,58 +135,58 @@ def get_and_transform_data(): Result: This molecule is {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_NR-AhR__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|figure out|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {toxicity_NR-AhR__names__adjective}? -Assistant: {toxicity_NR-AhR#No&Yes}, this molecule is {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_NR-AhR#No&Yes}, this molecule is {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {toxicity_NR-AhR__names__adjective}? -Assistant: {toxicity_NR-AhR#No&Yes}, it is {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_NR-AhR#No&Yes}, it is {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__adjective}? -Assistant: This is a molecule that is {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: This sounds {#very exciting. |very interesting. | very curious. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {toxicity_NR-AhR#not &NULL}be {toxicity_NR-AhR__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {toxicity_NR-AhR#not &NULL}be {toxicity_NR-AhR__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {toxicity_NR-AhR__names__adjective}:{toxicity_NR-AhR#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {toxicity_NR-AhR__names__adjective}:{toxicity_NR-AhR#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-AhR__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{toxicity_NR-AhR#False&True}""", # noqa: E501 +Result:{toxicity_NR-AhR#False&True}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_NR-AhR__names__adjective}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_NR-AhR__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_NR-AhR%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_NR-AhR__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_NR-AhR%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_NR-AhR%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_NR-AhR#not &NULL}{toxicity_NR-AhR__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_NR-AhR%} -Answer:{%multiple_choice_result}""", # noqa: E501, +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/nr_ar_lbd_tox21/transform.py b/data/tabular/nr_ar_lbd_tox21/transform.py index f2da520d4..831882746 100644 --- a/data/tabular/nr_ar_lbd_tox21/transform.py +++ b/data/tabular/nr_ar_lbd_tox21/transform.py @@ -120,17 +120,17 @@ def get_and_transform_data(): journal = {Frontiers in Environmental Science}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__adjective}.", # noqa: E501 - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__gerund}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_NR-AR-LBD#no &NULL}{toxicity_NR-AR-LBD__names__noun} {#properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_NR-AR-LBD#not &NULL}identified as {toxicity_NR-AR-LBD__names__adjective}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__adjective}.", + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__gerund}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_NR-AR-LBD#no &NULL}{toxicity_NR-AR-LBD__names__noun} {#properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_NR-AR-LBD#not &NULL}identified as {toxicity_NR-AR-LBD__names__adjective}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-AR-LBD__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra!} words. -Result: {toxicity_NR-AR-LBD#False&True}""", # noqa: E501 +Result: {toxicity_NR-AR-LBD#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-AR-LBD__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -138,58 +138,58 @@ def get_and_transform_data(): Result: This molecule is {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_NR-AR-LBD__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|figure out|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {toxicity_NR-AR-LBD__names__adjective}? -Assistant: {toxicity_NR-AR-LBD#No&Yes}, this molecule is {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_NR-AR-LBD#No&Yes}, this molecule is {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {toxicity_NR-AR-LBD__names__adjective}? -Assistant: {toxicity_NR-AR-LBD#No&Yes}, it is {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_NR-AR-LBD#No&Yes}, it is {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__adjective}? -Assistant: This is a molecule that is {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: This sounds {#very exciting. |very interesting. | very curious. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {toxicity_NR-AR-LBD#not &NULL}be {toxicity_NR-AR-LBD__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {toxicity_NR-AR-LBD#not &NULL}be {toxicity_NR-AR-LBD__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {toxicity_NR-AR-LBD__names__adjective}:{toxicity_NR-AR-LBD#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {toxicity_NR-AR-LBD__names__adjective}:{toxicity_NR-AR-LBD#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-AR-LBD__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{toxicity_NR-AR-LBD#False&True}""", # noqa: E501 +Result:{toxicity_NR-AR-LBD#False&True}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_NR-AR-LBD__names__adjective}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_NR-AR-LBD__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_NR-AR-LBD%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_NR-AR-LBD__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_NR-AR-LBD%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_NR-AR-LBD%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_NR-AR-LBD#not &NULL}{toxicity_NR-AR-LBD__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_NR-AR-LBD%} -Answer:{%multiple_choice_result}""", # noqa: E501, +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/nr_ar_tox21/transform.py b/data/tabular/nr_ar_tox21/transform.py index 4951a69d7..549d510be 100644 --- a/data/tabular/nr_ar_tox21/transform.py +++ b/data/tabular/nr_ar_tox21/transform.py @@ -112,17 +112,17 @@ def get_and_transform_data(): journal = {Frontiers in Environmental Science}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__adjective}.", # noqa: E501 - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__gerund}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_NR-AR#no &NULL}{toxicity_NR-AR__names__noun} {#properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_NR-AR#not &NULL}identified as {toxicity_NR-AR__names__adjective}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__adjective}.", + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__gerund}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_NR-AR#no &NULL}{toxicity_NR-AR__names__noun} {#properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_NR-AR#not &NULL}identified as {toxicity_NR-AR__names__adjective}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-AR__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra!} words. -Result: {toxicity_NR-AR#False&True}""", # noqa: E501 +Result: {toxicity_NR-AR#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-AR__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -130,58 +130,58 @@ def get_and_transform_data(): Result: This molecule is {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_NR-AR__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|figure out|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {toxicity_NR-AR__names__adjective}? -Assistant: {toxicity_NR-AR#No&Yes}, this molecule is {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_NR-AR#No&Yes}, this molecule is {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {toxicity_NR-AR__names__adjective}? -Assistant: {toxicity_NR-AR#No&Yes}, it is {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_NR-AR#No&Yes}, it is {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__adjective}? -Assistant: This is a molecule that is {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: This sounds {#very exciting. |very interesting. | very curious. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {toxicity_NR-AR#not &NULL}be {toxicity_NR-AR__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {toxicity_NR-AR#not &NULL}be {toxicity_NR-AR__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {toxicity_NR-AR__names__adjective}:{toxicity_NR-AR#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {toxicity_NR-AR__names__adjective}:{toxicity_NR-AR#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-AR__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{toxicity_NR-AR#False&True}""", # noqa: E501 +Result:{toxicity_NR-AR#False&True}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_NR-AR__names__adjective}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_NR-AR__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_NR-AR%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_NR-AR__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_NR-AR%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_NR-AR%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_NR-AR#not &NULL}{toxicity_NR-AR__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_NR-AR%} -Answer:{%multiple_choice_result}""", # noqa: E501, +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/nr_aromatase_tox21/transform.py b/data/tabular/nr_aromatase_tox21/transform.py index 08b8b0719..b9d4370c2 100644 --- a/data/tabular/nr_aromatase_tox21/transform.py +++ b/data/tabular/nr_aromatase_tox21/transform.py @@ -115,17 +115,17 @@ def get_and_transform_data(): journal = {Frontiers in Environmental Science}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__adjective}.", # noqa: E501 - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__gerund}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_NR-Aromatase#no &NULL}{toxicity_NR-Aromatase__names__noun} {#properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_NR-Aromatase#not &NULL}identified as {toxicity_NR-Aromatase__names__adjective}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__adjective}.", + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__gerund}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_NR-Aromatase#no &NULL}{toxicity_NR-Aromatase__names__noun} {#properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_NR-Aromatase#not &NULL}identified as {toxicity_NR-Aromatase__names__adjective}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-Aromatase__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra!} words. -Result: {toxicity_NR-Aromatase#False&True}""", # noqa: E501 +Result: {toxicity_NR-Aromatase#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-Aromatase__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -133,58 +133,58 @@ def get_and_transform_data(): Result: This molecule is {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_NR-Aromatase__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|figure out|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {toxicity_NR-Aromatase__names__adjective}? -Assistant: {toxicity_NR-Aromatase#No&Yes}, this molecule is {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_NR-Aromatase#No&Yes}, this molecule is {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {toxicity_NR-Aromatase__names__adjective}? -Assistant: {toxicity_NR-Aromatase#No&Yes}, it is {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_NR-Aromatase#No&Yes}, it is {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__adjective}? -Assistant: This is a molecule that is {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: This sounds {#very exciting. |very interesting. | very curious. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {toxicity_NR-Aromatase#not &NULL}be {toxicity_NR-Aromatase__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {toxicity_NR-Aromatase#not &NULL}be {toxicity_NR-Aromatase__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {toxicity_NR-Aromatase__names__adjective}:{toxicity_NR-Aromatase#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {toxicity_NR-Aromatase__names__adjective}:{toxicity_NR-Aromatase#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-Aromatase__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{toxicity_NR-Aromatase#False&True}""", # noqa: E501 +Result:{toxicity_NR-Aromatase#False&True}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_NR-Aromatase__names__adjective}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_NR-Aromatase__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_NR-Aromatase%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_NR-Aromatase__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_NR-Aromatase%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_NR-Aromatase%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_NR-Aromatase#not &NULL}{toxicity_NR-Aromatase__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_NR-Aromatase%} -Answer:{%multiple_choice_result}""", # noqa: E501, +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/nr_er_lbd_tox21/transform.py b/data/tabular/nr_er_lbd_tox21/transform.py index 94fb3a959..6e2c5b4b7 100644 --- a/data/tabular/nr_er_lbd_tox21/transform.py +++ b/data/tabular/nr_er_lbd_tox21/transform.py @@ -134,17 +134,17 @@ def get_and_transform_data(): journal = {Frontiers in Environmental Science}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__adjective}.", # noqa: E501 - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__gerund}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_NR-ER-LBD#no &NULL}{toxicity_NR-ER-LBD__names__noun} {#properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_NR-ER-LBD#not &NULL}identified as {toxicity_NR-ER-LBD__names__adjective}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__adjective}.", + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__gerund}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_NR-ER-LBD#no &NULL}{toxicity_NR-ER-LBD__names__noun} {#properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_NR-ER-LBD#not &NULL}identified as {toxicity_NR-ER-LBD__names__adjective}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-ER-LBD__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra!} words. -Result: {toxicity_NR-ER-LBD#False&True}""", # noqa: E501 +Result: {toxicity_NR-ER-LBD#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-ER-LBD__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -152,58 +152,58 @@ def get_and_transform_data(): Result: This molecule is {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_NR-ER-LBD__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|figure out|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {toxicity_NR-ER-LBD__names__adjective}? -Assistant: {toxicity_NR-ER-LBD#No&Yes}, this molecule is {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_NR-ER-LBD#No&Yes}, this molecule is {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {toxicity_NR-ER-LBD__names__adjective}? -Assistant: {toxicity_NR-ER-LBD#No&Yes}, it is {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_NR-ER-LBD#No&Yes}, it is {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__adjective}? -Assistant: This is a molecule that is {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: This sounds {#very exciting. |very interesting. | very curious. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {toxicity_NR-ER-LBD#not &NULL}be {toxicity_NR-ER-LBD__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {toxicity_NR-ER-LBD#not &NULL}be {toxicity_NR-ER-LBD__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {toxicity_NR-ER-LBD__names__adjective}:{toxicity_NR-ER-LBD#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {toxicity_NR-ER-LBD__names__adjective}:{toxicity_NR-ER-LBD#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-ER-LBD__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{toxicity_NR-ER-LBD#False&True}""", # noqa: E501 +Result:{toxicity_NR-ER-LBD#False&True}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_NR-ER-LBD__names__adjective}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_NR-ER-LBD__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_NR-ER-LBD%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_NR-ER-LBD__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_NR-ER-LBD%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_NR-ER-LBD%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_NR-ER-LBD#not &NULL}{toxicity_NR-ER-LBD__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_NR-ER-LBD%} -Answer:{%multiple_choice_result}""", # noqa: E501, +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/nr_er_tox21/transform.py b/data/tabular/nr_er_tox21/transform.py index cb4a8bc55..74cab03a9 100644 --- a/data/tabular/nr_er_tox21/transform.py +++ b/data/tabular/nr_er_tox21/transform.py @@ -124,17 +124,17 @@ def get_and_transform_data(): journal = {Frontiers in Environmental Science}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__adjective}.", # noqa: E501 - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__gerund}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_NR-ER#no &NULL}{toxicity_NR-ER__names__noun} {#properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_NR-ER#not &NULL}identified as {toxicity_NR-ER__names__adjective}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__adjective}.", + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__gerund}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_NR-ER#no &NULL}{toxicity_NR-ER__names__noun} {#properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_NR-ER#not &NULL}identified as {toxicity_NR-ER__names__adjective}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-ER__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra!} words. -Result: {toxicity_NR-ER#False&True}""", # noqa: E501 +Result: {toxicity_NR-ER#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-ER__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -142,58 +142,58 @@ def get_and_transform_data(): Result: This molecule is {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_NR-ER__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|figure out|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {toxicity_NR-ER__names__adjective}? -Assistant: {toxicity_NR-ER#No&Yes}, this molecule is {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_NR-ER#No&Yes}, this molecule is {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {toxicity_NR-ER__names__adjective}? -Assistant: {toxicity_NR-ER#No&Yes}, it is {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_NR-ER#No&Yes}, it is {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__adjective}? -Assistant: This is a molecule that is {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: This sounds {#very exciting. |very interesting. | very curious. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {toxicity_NR-ER#not &NULL}be {toxicity_NR-ER__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {toxicity_NR-ER#not &NULL}be {toxicity_NR-ER__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {toxicity_NR-ER__names__adjective}:{toxicity_NR-ER#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {toxicity_NR-ER__names__adjective}:{toxicity_NR-ER#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-ER__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{toxicity_NR-ER#False&True}""", # noqa: E501 +Result:{toxicity_NR-ER#False&True}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_NR-ER__names__adjective}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_NR-ER__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_NR-ER%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_NR-ER__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_NR-ER%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_NR-ER%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_NR-ER#not &NULL}{toxicity_NR-ER__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_NR-ER%} -Answer:{%multiple_choice_result}""", # noqa: E501, +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/nr_ppar_gamma_tox21/transform.py b/data/tabular/nr_ppar_gamma_tox21/transform.py index f10de13f5..22b516f98 100644 --- a/data/tabular/nr_ppar_gamma_tox21/transform.py +++ b/data/tabular/nr_ppar_gamma_tox21/transform.py @@ -122,17 +122,17 @@ def get_and_transform_data(): journal = {Frontiers in Environmental Science}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__adjective}.", # noqa: E501 - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__gerund}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_NR-PPAR-gamma#no &NULL}{toxicity_NR-PPAR-gamma__names__noun} {#properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_NR-PPAR-gamma#not &NULL}identified as {toxicity_NR-PPAR-gamma__names__adjective}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__adjective}.", + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__gerund}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_NR-PPAR-gamma#no &NULL}{toxicity_NR-PPAR-gamma__names__noun} {#properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_NR-PPAR-gamma#not &NULL}identified as {toxicity_NR-PPAR-gamma__names__adjective}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-PPAR-gamma__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra!} words. -Result: {toxicity_NR-PPAR-gamma#False&True}""", # noqa: E501 +Result: {toxicity_NR-PPAR-gamma#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-PPAR-gamma__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -140,58 +140,58 @@ def get_and_transform_data(): Result: This molecule is {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_NR-PPAR-gamma__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|figure out|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {toxicity_NR-PPAR-gamma__names__adjective}? -Assistant: {toxicity_NR-PPAR-gamma#No&Yes}, this molecule is {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_NR-PPAR-gamma#No&Yes}, this molecule is {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {toxicity_NR-PPAR-gamma__names__adjective}? -Assistant: {toxicity_NR-PPAR-gamma#No&Yes}, it is {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_NR-PPAR-gamma#No&Yes}, it is {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__adjective}? -Assistant: This is a molecule that is {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: This sounds {#very exciting. |very interesting. | very curious. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {toxicity_NR-PPAR-gamma#not &NULL}be {toxicity_NR-PPAR-gamma__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {toxicity_NR-PPAR-gamma#not &NULL}be {toxicity_NR-PPAR-gamma__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {toxicity_NR-PPAR-gamma__names__adjective}:{toxicity_NR-PPAR-gamma#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {toxicity_NR-PPAR-gamma__names__adjective}:{toxicity_NR-PPAR-gamma#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_NR-PPAR-gamma__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{toxicity_NR-PPAR-gamma#False&True}""", # noqa: E501 +Result:{toxicity_NR-PPAR-gamma#False&True}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_NR-PPAR-gamma__names__adjective}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_NR-PPAR-gamma__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_NR-PPAR-gamma%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_NR-PPAR-gamma__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_NR-PPAR-gamma%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_NR-PPAR-gamma%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_NR-PPAR-gamma#not &NULL}{toxicity_NR-PPAR-gamma__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_NR-PPAR-gamma%} -Answer:{%multiple_choice_result}""", # noqa: E501, +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/ocp/transform.py b/data/tabular/ocp/transform.py index 91cd54553..8d0911c42 100644 --- a/data/tabular/ocp/transform.py +++ b/data/tabular/ocp/transform.py @@ -21,8 +21,8 @@ def uniCode2Latex(text: str) -> str: text = text.replace(chr(code), f"$_{code-8320}$") text = text.replace("\u0305", "$^-$") - text = text.replace("\u207A", "$^+$") - text = text.replace("\u207B", "$^-$") + text = text.replace("\u207a", "$^+$") + text = text.replace("\u207b", "$^-$") text = text.replace("\u2074", "$^4$") text = text.replace("\u2070", "$^0$") text = text.replace("\u2078", "$^1$") diff --git a/data/tabular/orbnet_denali/develop_transform.ipynb b/data/tabular/orbnet_denali/develop_transform.ipynb index 039c60f89..e1b836427 100644 --- a/data/tabular/orbnet_denali/develop_transform.ipynb +++ b/data/tabular/orbnet_denali/develop_transform.ipynb @@ -25,13 +25,10 @@ "metadata": {}, "outputs": [], "source": [ - "from pathlib import Path\n", - "from rdkit import Chem\n", - "import matplotlib.pyplot as plt\n", - "import numpy as np\n", - "import os\n", + "from glob import glob\n", + "\n", "import pandas as pd\n", - "from glob import glob" + "from rdkit import Chem" ] }, { @@ -60,11 +57,11 @@ "metadata": {}, "outputs": [], "source": [ - "import requests\n", "import tarfile\n", - "\n", "from io import BytesIO\n", "\n", + "import requests\n", + "\n", "\n", "def extract_tarball(url, output_dir):\n", " # Download the tarball from the URL\n", @@ -474,7 +471,6 @@ "metadata": {}, "outputs": [], "source": [ - "from rdkit.Chem import rdDetermineBonds\n", "from chemnlp.utils import xyz_to_mol" ] }, diff --git a/data/tabular/orexin1_receptor_butkiewicz/transform.py b/data/tabular/orexin1_receptor_butkiewicz/transform.py index ac290a1a7..8c4ba6e06 100644 --- a/data/tabular/orexin1_receptor_butkiewicz/transform.py +++ b/data/tabular/orexin1_receptor_butkiewicz/transform.py @@ -134,17 +134,17 @@ def get_and_transform_data(): journal = {Chemical Science}}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {activity_orexin1#not &NULL}{activity_orexin1__names__adjective}.", # noqa: E501 - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {activity_orexin1#not &NULL}{activity_orexin1__names__gerund}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {activity_orexin1#no &NULL}{activity_orexin1__names__noun} {#properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {activity_orexin1#not &NULL}identified as {activity_orexin1__names__adjective}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_orexin1#not &NULL}{activity_orexin1__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {activity_orexin1#not &NULL}{activity_orexin1__names__adjective}.", + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {activity_orexin1#not &NULL}{activity_orexin1__names__gerund}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {activity_orexin1#no &NULL}{activity_orexin1__names__noun} {#properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {activity_orexin1#not &NULL}identified as {activity_orexin1__names__adjective}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_orexin1#not &NULL}{activity_orexin1__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_orexin1__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra!} words. -Result: {activity_orexin1#False&True}""", # noqa: E501 +Result: {activity_orexin1#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_orexin1__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -152,58 +152,58 @@ def get_and_transform_data(): Result: This molecule is {activity_orexin1#not &NULL}{activity_orexin1__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {activity_orexin1__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|figure out|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {activity_orexin1__names__adjective}? -Assistant: {activity_orexin1#No&Yes}, this molecule is {activity_orexin1#not &NULL}{activity_orexin1__names__adjective}.""", # noqa: E501 +Assistant: {activity_orexin1#No&Yes}, this molecule is {activity_orexin1#not &NULL}{activity_orexin1__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {activity_orexin1__names__adjective}? -Assistant: {activity_orexin1#No&Yes}, it is {activity_orexin1#not &NULL}{activity_orexin1__names__adjective}.""", # noqa: E501 +Assistant: {activity_orexin1#No&Yes}, it is {activity_orexin1#not &NULL}{activity_orexin1__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {activity_orexin1#not &NULL}{activity_orexin1__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {activity_orexin1#not &NULL}{activity_orexin1__names__adjective}? -Assistant: This is a molecule that is {activity_orexin1#not &NULL}{activity_orexin1__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {activity_orexin1#not &NULL}{activity_orexin1__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: This sounds {#very exciting. |very interesting. | very curious. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {activity_orexin1#not &NULL}be {activity_orexin1__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_orexin1#not &NULL}{activity_orexin1__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_orexin1#not &NULL}{activity_orexin1__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {activity_orexin1#not &NULL}be {activity_orexin1__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_orexin1#not &NULL}{activity_orexin1__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_orexin1#not &NULL}{activity_orexin1__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {activity_orexin1__names__adjective}:{activity_orexin1#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {activity_orexin1__names__adjective}:{activity_orexin1#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_orexin1__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{activity_orexin1#False&True}""", # noqa: E501 +Result:{activity_orexin1#False&True}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {activity_orexin1__names__adjective}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {activity_orexin1__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {activity_orexin1%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {activity_orexin1__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {activity_orexin1%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_orexin1#not &NULL}{activity_orexin1__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%activity_orexin1%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_orexin1#not &NULL}{activity_orexin1__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional|extra!} words. Options: {SMILES%activity_orexin1%} -Answer:{%multiple_choice_result}""", # noqa: E501, +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/p_glycoprotein_inhibition_broccatelli_et_al/transform.py b/data/tabular/p_glycoprotein_inhibition_broccatelli_et_al/transform.py index e9244958c..13cc1594b 100644 --- a/data/tabular/p_glycoprotein_inhibition_broccatelli_et_al/transform.py +++ b/data/tabular/p_glycoprotein_inhibition_broccatelli_et_al/transform.py @@ -122,17 +122,17 @@ def get_and_transform_data(): journal = {Journal of Medicinal Chemistry}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__adjective}.", # noqa: E501 - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__gerund}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {Pgp_inhibition#no &NULL}{Pgp_inhibition__names__noun} {#properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {Pgp_inhibition#not &NULL}identified as {Pgp_inhibition__names__adjective}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__adjective}.", + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__gerund}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {Pgp_inhibition#no &NULL}{Pgp_inhibition__names__noun} {#properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {Pgp_inhibition#not &NULL}identified as {Pgp_inhibition__names__adjective}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {Pgp_inhibition__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra!} words. -Result: {Pgp_inhibition#False&True}""", # noqa: E501 +Result: {Pgp_inhibition#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {Pgp_inhibition__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -140,58 +140,58 @@ def get_and_transform_data(): Result: This molecule is {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {Pgp_inhibition__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|figure out|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {Pgp_inhibition__names__adjective}? -Assistant: {Pgp_inhibition#No&Yes}, this molecule is {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__adjective}.""", # noqa: E501 +Assistant: {Pgp_inhibition#No&Yes}, this molecule is {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {Pgp_inhibition__names__adjective}? -Assistant: {Pgp_inhibition#No&Yes}, it is {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__adjective}.""", # noqa: E501 +Assistant: {Pgp_inhibition#No&Yes}, it is {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__adjective}? -Assistant: This is a molecule that is {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: This sounds {#very exciting. |very interesting. | very curious. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {Pgp_inhibition#not &NULL}be {Pgp_inhibition__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {Pgp_inhibition#not &NULL}be {Pgp_inhibition__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {Pgp_inhibition__names__adjective}:{Pgp_inhibition#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {Pgp_inhibition__names__adjective}:{Pgp_inhibition#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {Pgp_inhibition__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{Pgp_inhibition#False&True}""", # noqa: E501 +Result:{Pgp_inhibition#False&True}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {Pgp_inhibition__names__adjective}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {Pgp_inhibition__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {Pgp_inhibition%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {Pgp_inhibition__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {Pgp_inhibition%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%Pgp_inhibition%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {Pgp_inhibition#not &NULL}{Pgp_inhibition__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%Pgp_inhibition%} -Answer:{%multiple_choice_result}""", # noqa: E501, +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/pampa_ncats/transform.py b/data/tabular/pampa_ncats/transform.py index 3d640103b..5c4acbdb5 100644 --- a/data/tabular/pampa_ncats/transform.py +++ b/data/tabular/pampa_ncats/transform.py @@ -99,17 +99,17 @@ def get_and_transform_data(): }""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {permeability#not &NULL}{permeability__names__adjective}.", # noqa: E501 - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {permeability#not &NULL}{permeability__names__gerund}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {permeability#no &NULL}{permeability__names__noun} {#properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {permeability#not &NULL}identified as {permeability__names__adjective}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {permeability#not &NULL}{permeability__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {permeability#not &NULL}{permeability__names__adjective}.", + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {permeability#not &NULL}{permeability__names__gerund}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {permeability#no &NULL}{permeability__names__noun} {#properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {permeability#not &NULL}identified as {permeability__names__adjective}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {permeability#not &NULL}{permeability__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {permeability__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra!} words. -Result: {permeability#False&True}""", # noqa: E501 +Result: {permeability#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {permeability__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -117,58 +117,58 @@ def get_and_transform_data(): Result: This molecule is {permeability#not &NULL}{permeability__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {permeability__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|figure out|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {permeability__names__adjective}? -Assistant: {permeability#No&Yes}, this molecule is {permeability#not &NULL}{permeability__names__adjective}.""", # noqa: E501 +Assistant: {permeability#No&Yes}, this molecule is {permeability#not &NULL}{permeability__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {permeability__names__adjective}? -Assistant: {permeability#No&Yes}, it is {permeability#not &NULL}{permeability__names__adjective}.""", # noqa: E501 +Assistant: {permeability#No&Yes}, it is {permeability#not &NULL}{permeability__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {permeability#not &NULL}{permeability__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {permeability#not &NULL}{permeability__names__adjective}? -Assistant: This is a molecule that is {permeability#not &NULL}{permeability__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {permeability#not &NULL}{permeability__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: This sounds {#very exciting. |very interesting. | very curious. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {permeability#not &NULL}be {permeability__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {permeability#not &NULL}{permeability__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {permeability#not &NULL}{permeability__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {permeability#not &NULL}be {permeability__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {permeability#not &NULL}{permeability__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {permeability#not &NULL}{permeability__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {permeability__names__adjective}:{permeability#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {permeability__names__adjective}:{permeability#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {permeability__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{permeability#False&True}""", # noqa: E501 +Result:{permeability#False&True}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {permeability__names__adjective}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {permeability__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {permeability%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {permeability__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {permeability%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {permeability#not &NULL}{permeability__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%permeability%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {permeability#not &NULL}{permeability__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%permeability%} -Answer:{%multiple_choice_result}""", # noqa: E501, +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/peptides_hemolytic/transform.py b/data/tabular/peptides_hemolytic/transform.py index 000c7cfe3..b8aa47b29 100644 --- a/data/tabular/peptides_hemolytic/transform.py +++ b/data/tabular/peptides_hemolytic/transform.py @@ -149,17 +149,17 @@ def get_and_transform_data(): journal = {Chemical Science}""", ], "templates": [ - "The sequence of {#aminoacids|AAs!} {sequence#} {#shows|exhibits|demonstrates!} {hemolytic#no &NULL}{hemolytic__names__adjective} properties.", # noqa: E501 - "The aminoacid sequence {sequence#} {#shows|exhibits|displays!} {hemolytic#no &NULL}{hemolytic__names__adjective} properties.", # noqa: E501 - "Based on the {sequence__description} {#representation |!}{sequence#}, the aminoacid sequence has {hemolytic#no &NULL}{hemolytic__names__adjective} {#properties|characteristics|features!}.", # noqa: E501 - "The {sequence__description} {sequence#} {#represents|is from!} an aminoacid sequence that is {hemolytic#not &NULL}identified as {hemolytic__names__adjective}.", # noqa: E501 - "The {#aminoacid sequence |!}{sequence__description} {sequence#} is {hemolytic#not &NULL}{hemolytic__names__adjective}.", # noqa: E501 not all variables need to be used + "The sequence of {#aminoacids|AAs!} {sequence#} {#shows|exhibits|demonstrates!} {hemolytic#no &NULL}{hemolytic__names__adjective} properties.", + "The aminoacid sequence {sequence#} {#shows|exhibits|displays!} {hemolytic#no &NULL}{hemolytic__names__adjective} properties.", + "Based on the {sequence__description} {#representation |!}{sequence#}, the aminoacid sequence has {hemolytic#no &NULL}{hemolytic__names__adjective} {#properties|characteristics|features!}.", + "The {sequence__description} {sequence#} {#represents|is from!} an aminoacid sequence that is {hemolytic#not &NULL}identified as {hemolytic__names__adjective}.", + "The {#aminoacid sequence |!}{sequence__description} {sequence#} is {hemolytic#not &NULL}{hemolytic__names__adjective}.", # Instruction tuning text templates """Task: Please classify a aminoacid sequence based on the description. Description: A aminoacid sequence that is {hemolytic__names__adjective}. {#aminoacid sequence |!}{sequence__description}: {sequence#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {hemolytic#False&True}""", # noqa: E501 +Result: {hemolytic#False&True}""", """Task: Please classify a aminoacid sequence based on the description. Description: A aminoacid sequence that is {hemolytic__names__adjective}. {#aminoacid sequence |!}{sequence__description}: {sequence#} @@ -167,58 +167,58 @@ def get_and_transform_data(): Result: This aminoacid sequence is {hemolytic#not &NULL}{hemolytic__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#aminoacid sequence |!}{sequence__description} based on the {#text |!}description{# below|!}. Description: A aminoacid sequence that is {hemolytic__names__adjective}. -Result: {sequence#}""", # noqa: E501 +Result: {sequence#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the aminoacid sequence with the {sequence__description} {sequence#} is {hemolytic__names__adjective}? -Assistant: {hemolytic#No&Yes}, this aminoacid sequence is {hemolytic#not &NULL}{hemolytic__names__adjective}.""", # noqa: E501 +Assistant: {hemolytic#No&Yes}, this aminoacid sequence is {hemolytic#not &NULL}{hemolytic__names__adjective}.""", """User: Is the aminoacid sequence with the {sequence__description} {sequence#} {hemolytic__names__adjective}? -Assistant: {hemolytic#No&Yes}, it is {hemolytic#not &NULL}{hemolytic__names__adjective}.""", # noqa: E501 +Assistant: {hemolytic#No&Yes}, it is {hemolytic#not &NULL}{hemolytic__names__adjective}.""", """User: Can you {#give me|create|generate!} the {sequence__description} of a aminoacid sequence that is {hemolytic#not &NULL}{hemolytic__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {sequence#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {sequence#}""", """User: I'm {#searching|looking!} for the {sequence__description} of a aminoacid sequence that is {hemolytic#not &NULL}{hemolytic__names__adjective}? -Assistant: This is a aminoacid sequence that is {hemolytic#not &NULL}{hemolytic__names__adjective}: {sequence#}""", # noqa: E501 +Assistant: This is a aminoacid sequence that is {hemolytic#not &NULL}{hemolytic__names__adjective}: {sequence#}""", """User: I want to {#come up with|create|generate!} a {#aminoacid sequence |!}{sequence__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The aminoacid sequence should {hemolytic#not &NULL}be {hemolytic__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {sequence__description} is {hemolytic#not &NULL}{hemolytic__names__adjective}: {sequence#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {sequence__description} is {hemolytic#not &NULL}{hemolytic__names__adjective}: {sequence#}""", """User: I want to {#come up with|create|generate!} a {#aminoacid sequence |!}{sequence__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#aminoacid sequence|one!}? User: Yes, the aminoacid sequence should {hemolytic#not &NULL}be {hemolytic__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {sequence__description} is {hemolytic#not &NULL}{hemolytic__names__adjective}: {sequence#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {sequence__description} is {hemolytic#not &NULL}{hemolytic__names__adjective}: {sequence#}""", # Benchmarking text templates - "Is the {sequence__description} {sequence#} {hemolytic__names__adjective}:{hemolytic#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {sequence__description} {sequence#} {hemolytic__names__adjective}:{hemolytic#no&yes}", """Task: Please classify a aminoacid sequence based on the description. Description: A aminoacid sequence that is {hemolytic__names__adjective}. {#aminoacid sequence |!}{sequence__description}: {sequence#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{hemolytic#False&True}""", # noqa: E501 +Result:{hemolytic#False&True}""", """Task: Please {#give me|create|generate!} a {#aminoacid sequence |!}{sequence__description} based on the {#text |!}description{# below|!}. Description: A aminoacid sequence that is {hemolytic__names__adjective}. -Result:{sequence#}""", # noqa: E501 +Result:{sequence#}""", """Task: Please answer the multiple choice question. Question: Is the aminoacid sequence with the {sequence__description} {#representation of |!}{sequence#} {hemolytic__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {hemolytic%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the aminoacid sequence with the {sequence__description} {#representation of |!}{sequence#} {hemolytic__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {hemolytic%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which aminoacid sequences are {hemolytic#not &NULL}{hemolytic__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {sequence%hemolytic%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which aminoacid sequences are {hemolytic#not &NULL}{hemolytic__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {sequence%hemolytic%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/peptides_nonfouling/transform.py b/data/tabular/peptides_nonfouling/transform.py index 4d1879cd0..8c7e9290b 100644 --- a/data/tabular/peptides_nonfouling/transform.py +++ b/data/tabular/peptides_nonfouling/transform.py @@ -131,17 +131,17 @@ def get_and_transform_data(): publisher={Wiley Online Library}""", ], "templates": [ - "The sequence of {#aminoacids|AAs!} {sequence#} {#shows|exhibits|demonstrates!} {nonfouling#no &NULL}{nonfouling__names__adjective} properties.", # noqa: E501 - "The aminoacid sequence {sequence#} {#shows|exhibits|displays!} {nonfouling#no &NULL}{nonfouling__names__adjective} properties.", # noqa: E501 - "Based on the {sequence__description} {#representation |!}{sequence#}, the aminoacid sequence has {nonfouling#no &NULL}{nonfouling__names__adjective} {#properties|characteristics|features!}.", # noqa: E501 - "The {sequence__description} {sequence#} {#represents|is from!} an aminoacid sequence that is {nonfouling#not &NULL}identified as {nonfouling__names__adjective}.", # noqa: E501 - "The {#aminoacid sequence |!}{sequence__description} {sequence#} is {nonfouling#not &NULL}{nonfouling__names__adjective}.", # noqa: E501 not all variables need to be used + "The sequence of {#aminoacids|AAs!} {sequence#} {#shows|exhibits|demonstrates!} {nonfouling#no &NULL}{nonfouling__names__adjective} properties.", + "The aminoacid sequence {sequence#} {#shows|exhibits|displays!} {nonfouling#no &NULL}{nonfouling__names__adjective} properties.", + "Based on the {sequence__description} {#representation |!}{sequence#}, the aminoacid sequence has {nonfouling#no &NULL}{nonfouling__names__adjective} {#properties|characteristics|features!}.", + "The {sequence__description} {sequence#} {#represents|is from!} an aminoacid sequence that is {nonfouling#not &NULL}identified as {nonfouling__names__adjective}.", + "The {#aminoacid sequence |!}{sequence__description} {sequence#} is {nonfouling#not &NULL}{nonfouling__names__adjective}.", # Instruction tuning text templates """Task: Please classify a aminoacid sequence based on the description. Description: A aminoacid sequence that is {nonfouling__names__adjective}. {#aminoacid sequence |!}{sequence__description}: {sequence#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {nonfouling#False&True}""", # noqa: E501 +Result: {nonfouling#False&True}""", """Task: Please classify a aminoacid sequence based on the description. Description: A aminoacid sequence that is {nonfouling__names__adjective}. {#aminoacid sequence |!}{sequence__description}: {sequence#} @@ -149,58 +149,58 @@ def get_and_transform_data(): Result: This aminoacid sequence is {nonfouling#not &NULL}{nonfouling__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#aminoacid sequence |!}{sequence__description} based on the {#text |!}description{# below|!}. Description: A aminoacid sequence that is {nonfouling__names__adjective}. -Result: {sequence#}""", # noqa: E501 +Result: {sequence#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the aminoacid sequence with the {sequence__description} {sequence#} is {nonfouling__names__adjective}? -Assistant: {nonfouling#No&Yes}, this aminoacid sequence is {nonfouling#not &NULL}{nonfouling__names__adjective}.""", # noqa: E501 +Assistant: {nonfouling#No&Yes}, this aminoacid sequence is {nonfouling#not &NULL}{nonfouling__names__adjective}.""", """User: Is the aminoacid sequence with the {sequence__description} {sequence#} {nonfouling__names__adjective}? -Assistant: {nonfouling#No&Yes}, it is {nonfouling#not &NULL}{nonfouling__names__adjective}.""", # noqa: E501 +Assistant: {nonfouling#No&Yes}, it is {nonfouling#not &NULL}{nonfouling__names__adjective}.""", """User: Can you {#give me|create|generate!} the {sequence__description} of a aminoacid sequence that is {nonfouling#not &NULL}{nonfouling__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {sequence#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {sequence#}""", """User: I'm {#searching|looking!} for the {sequence__description} of a aminoacid sequence that is {nonfouling#not &NULL}{nonfouling__names__adjective}? -Assistant: This is a aminoacid sequence that is {nonfouling#not &NULL}{nonfouling__names__adjective}: {sequence#}""", # noqa: E501 +Assistant: This is a aminoacid sequence that is {nonfouling#not &NULL}{nonfouling__names__adjective}: {sequence#}""", """User: I want to {#come up with|create|generate!} a {#aminoacid sequence |!}{sequence__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The aminoacid sequence should {nonfouling#not &NULL}be {nonfouling__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {sequence__description} is {nonfouling#not &NULL}{nonfouling__names__adjective}: {sequence#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {sequence__description} is {nonfouling#not &NULL}{nonfouling__names__adjective}: {sequence#}""", """User: I want to {#come up with|create|generate!} a {#aminoacid sequence |!}{sequence__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#aminoacid sequence|one!}? User: Yes, the aminoacid sequence should {nonfouling#not &NULL}be {nonfouling__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {sequence__description} is {nonfouling#not &NULL}{nonfouling__names__adjective}: {sequence#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {sequence__description} is {nonfouling#not &NULL}{nonfouling__names__adjective}: {sequence#}""", # Benchmarking text templates - "Is the {sequence__description} {sequence#} {nonfouling__names__adjective}:{nonfouling#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {sequence__description} {sequence#} {nonfouling__names__adjective}:{nonfouling#no&yes}", """Task: Please classify a aminoacid sequence based on the description. Description: A aminoacid sequence that is {nonfouling__names__adjective}. {#aminoacid sequence |!}{sequence__description}: {sequence#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{nonfouling#False&True}""", # noqa: E501 +Result:{nonfouling#False&True}""", """Task: Please {#give me|create|generate!} a {#aminoacid sequence |!}{sequence__description} based on the {#text |!}description{# below|!}. Description: A aminoacid sequence that is {nonfouling__names__adjective}. -Result:{sequence#}""", # noqa: E501 +Result:{sequence#}""", """Task: Please answer the multiple choice question. Question: Is the aminoacid sequence with the {sequence__description} {#representation of |!}{sequence#} {nonfouling__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {nonfouling%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the aminoacid sequence with the {sequence__description} {#representation of |!}{sequence#} {nonfouling__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {nonfouling%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which aminoacid sequences are {nonfouling#not &NULL}{nonfouling__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {sequence%nonfouling%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which aminoacid sequences are {nonfouling#not &NULL}{nonfouling__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {sequence%nonfouling%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/peptides_soluble/transform.py b/data/tabular/peptides_soluble/transform.py index d14d0a1b6..eb7a43cd6 100644 --- a/data/tabular/peptides_soluble/transform.py +++ b/data/tabular/peptides_soluble/transform.py @@ -131,17 +131,17 @@ def get_and_transform_data(): publisher={Wiley Online Library}""", ], "templates": [ - "The sequence of {#aminoacids|AAs!} {sequence#} {#shows|exhibits|demonstrates!} {soluble#no &NULL}{soluble__names__adjective} properties.", # noqa: E501 - "The aminoacid sequence {sequence#} {#shows|exhibits|displays!} {soluble#no &NULL}{soluble__names__adjective} properties.", # noqa: E501 - "Based on the {sequence__description} {#representation |!}{sequence#}, the aminoacid sequence has {soluble#no &NULL}{soluble__names__adjective} {#properties|characteristics|features!}.", # noqa: E501 - "The {sequence__description} {sequence#} {#represents|is from!} an aminoacid sequence that is {soluble#not &NULL}identified as {soluble__names__adjective}.", # noqa: E501 - "The {#aminoacid sequence |!}{sequence__description} {sequence#} is {soluble#not &NULL}{soluble__names__adjective}.", # noqa: E501 not all variables need to be used + "The sequence of {#aminoacids|AAs!} {sequence#} {#shows|exhibits|demonstrates!} {soluble#no &NULL}{soluble__names__adjective} properties.", + "The aminoacid sequence {sequence#} {#shows|exhibits|displays!} {soluble#no &NULL}{soluble__names__adjective} properties.", + "Based on the {sequence__description} {#representation |!}{sequence#}, the aminoacid sequence has {soluble#no &NULL}{soluble__names__adjective} {#properties|characteristics|features!}.", + "The {sequence__description} {sequence#} {#represents|is from!} an aminoacid sequence that is {soluble#not &NULL}identified as {soluble__names__adjective}.", + "The {#aminoacid sequence |!}{sequence__description} {sequence#} is {soluble#not &NULL}{soluble__names__adjective}.", # Instruction tuning text templates """Task: Please classify a aminoacid sequence based on the description. Description: A aminoacid sequence that is {soluble__names__adjective}. {#aminoacid sequence |!}{sequence__description}: {sequence#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {soluble#False&True}""", # noqa: E501 +Result: {soluble#False&True}""", """Task: Please classify a aminoacid sequence based on the description. Description: A aminoacid sequence that is {soluble__names__adjective}. {#aminoacid sequence |!}{sequence__description}: {sequence#} @@ -149,58 +149,58 @@ def get_and_transform_data(): Result: This aminoacid sequence is {soluble#not &NULL}{soluble__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#aminoacid sequence |!}{sequence__description} based on the {#text |!}description{# below|!}. Description: A aminoacid sequence that is {soluble__names__adjective}. -Result: {sequence#}""", # noqa: E501 +Result: {sequence#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the aminoacid sequence with the {sequence__description} {sequence#} is {soluble__names__adjective}? -Assistant: {soluble#No&Yes}, this aminoacid sequence is {soluble#not &NULL}{soluble__names__adjective}.""", # noqa: E501 +Assistant: {soluble#No&Yes}, this aminoacid sequence is {soluble#not &NULL}{soluble__names__adjective}.""", """User: Is the aminoacid sequence with the {sequence__description} {sequence#} {soluble__names__adjective}? -Assistant: {soluble#No&Yes}, it is {soluble#not &NULL}{soluble__names__adjective}.""", # noqa: E501 +Assistant: {soluble#No&Yes}, it is {soluble#not &NULL}{soluble__names__adjective}.""", """User: Can you {#give me|create|generate!} the {sequence__description} of a aminoacid sequence that is {soluble#not &NULL}{soluble__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {sequence#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {sequence#}""", """User: I'm {#searching|looking!} for the {sequence__description} of a aminoacid sequence that is {soluble#not &NULL}{soluble__names__adjective}? -Assistant: This is a aminoacid sequence that is {soluble#not &NULL}{soluble__names__adjective}: {sequence#}""", # noqa: E501 +Assistant: This is a aminoacid sequence that is {soluble#not &NULL}{soluble__names__adjective}: {sequence#}""", """User: I want to {#come up with|create|generate!} a {#aminoacid sequence |!}{sequence__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The aminoacid sequence should {soluble#not &NULL}be {soluble__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {sequence__description} is {soluble#not &NULL}{soluble__names__adjective}: {sequence#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {sequence__description} is {soluble#not &NULL}{soluble__names__adjective}: {sequence#}""", """User: I want to {#come up with|create|generate!} a {#aminoacid sequence |!}{sequence__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#aminoacid sequence|one!}? User: Yes, the aminoacid sequence should {soluble#not &NULL}be {soluble__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {sequence__description} is {soluble#not &NULL}{soluble__names__adjective}: {sequence#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {sequence__description} is {soluble#not &NULL}{soluble__names__adjective}: {sequence#}""", # Benchmarking text templates - "Is the {sequence__description} {sequence#} {soluble__names__adjective}:{soluble#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {sequence__description} {sequence#} {soluble__names__adjective}:{soluble#no&yes}", """Task: Please classify a aminoacid sequence based on the description. Description: A aminoacid sequence that is {soluble__names__adjective}. {#aminoacid sequence |!}{sequence__description}: {sequence#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{soluble#False&True}""", # noqa: E501 +Result:{soluble#False&True}""", """Task: Please {#give me|create|generate!} a {#aminoacid sequence |!}{sequence__description} based on the {#text |!}description{# below|!}. Description: A aminoacid sequence that is {soluble__names__adjective}. -Result:{sequence#}""", # noqa: E501 +Result:{sequence#}""", """Task: Please answer the multiple choice question. Question: Is the aminoacid sequence with the {sequence__description} {#representation of |!}{sequence#} {soluble__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {soluble%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the aminoacid sequence with the {sequence__description} {#representation of |!}{sequence#} {soluble__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {soluble%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which aminoacid sequences are {soluble#not &NULL}{soluble__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {sequence%soluble%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which aminoacid sequences are {soluble#not &NULL}{soluble__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {sequence%soluble%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/potassium_ion_channel_kir2_1_butkiewicz/transform.py b/data/tabular/potassium_ion_channel_kir2_1_butkiewicz/transform.py index 03f5ab250..cd31605dd 100644 --- a/data/tabular/potassium_ion_channel_kir2_1_butkiewicz/transform.py +++ b/data/tabular/potassium_ion_channel_kir2_1_butkiewicz/transform.py @@ -146,76 +146,76 @@ def get_and_transform_data(): journal = {Chemical Science}}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__noun}.", # noqa: E501 - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {activity_potassium_ion_channel#no &NULL}{activity_potassium_ion_channel__names__gerund}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {activity_potassium_ion_channel#no &NULL}{activity_potassium_ion_channel__names__adjective} {#properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {activity_potassium_ion_channel#not &NULL}identified as {activity_potassium_ion_channel__names__adjective}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__noun}.", + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {activity_potassium_ion_channel#no &NULL}{activity_potassium_ion_channel__names__gerund}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {activity_potassium_ion_channel#no &NULL}{activity_potassium_ion_channel__names__adjective} {#properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {activity_potassium_ion_channel#not &NULL}identified as {activity_potassium_ion_channel__names__adjective}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_potassium_ion_channel__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra!} words. -Result: {activity_potassium_ion_channel#False&True}""", # noqa: E501 +Result: {activity_potassium_ion_channel#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_potassium_ion_channel__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__adjective}.""", # noqa: E501 +Result: This molecule is {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {activity_potassium_ion_channel__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|figure out|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {activity_potassium_ion_channel__names__adjective}? -Assistant: {activity_potassium_ion_channel#No&Yes}, this molecule is {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__adjective}.""", # noqa: E501 +Assistant: {activity_potassium_ion_channel#No&Yes}, this molecule is {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {activity_potassium_ion_channel__names__adjective}? -Assistant: {activity_potassium_ion_channel#No&Yes}, it is {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__adjective}.""", # noqa: E501 +Assistant: {activity_potassium_ion_channel#No&Yes}, it is {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__adjective}? -Assistant: This is a molecule that is {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: This sounds {#very exciting. |very interesting. | very curious. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {activity_potassium_ion_channel#not &NULL}be {activity_potassium_ion_channel__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {activity_potassium_ion_channel#not &NULL}be {activity_potassium_ion_channel__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {activity_potassium_ion_channel__names__adjective}:{activity_potassium_ion_channel#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {activity_potassium_ion_channel__names__adjective}:{activity_potassium_ion_channel#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_potassium_ion_channel__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{activity_potassium_ion_channel#False&True}""", # noqa: E501 +Result:{activity_potassium_ion_channel#False&True}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {activity_potassium_ion_channel__names__adjective}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {activity_potassium_ion_channel__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {activity_potassium_ion_channel%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {activity_potassium_ion_channel__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {activity_potassium_ion_channel%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%activity_potassium_ion_channel%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_potassium_ion_channel#not &NULL}{activity_potassium_ion_channel__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%activity_potassium_ion_channel%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/sarscov2_3clpro_diamond/transform.py b/data/tabular/sarscov2_3clpro_diamond/transform.py index e088a60d6..223e935d7 100644 --- a/data/tabular/sarscov2_3clpro_diamond/transform.py +++ b/data/tabular/sarscov2_3clpro_diamond/transform.py @@ -84,7 +84,7 @@ def get_and_transform_data(): "description": "data source", }, { - "url": "https://www.diamond.ac.uk/dam/jcr:9fdc4297-15b6-47e2-8d53-befb0970bf7c/COVID19-summary-20200324.xlsx", # noqa E501 + "url": "https://www.diamond.ac.uk/dam/jcr:9fdc4297-15b6-47e2-8d53-befb0970bf7c/COVID19-summary-20200324.xlsx", "description": "data source", }, { @@ -132,74 +132,74 @@ def get_and_transform_data(): journal = {Journal of Molecular Biology}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {activity_SARSCoV2_3CLPro#no &NULL}{activity_SARSCoV2_3CLPro__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that {#shows|exhibits|displays!} {activity_SARSCoV2_3CLPro#no &NULL}{activity_SARSCoV2_3CLPro__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {activity_SARSCoV2_3CLPro#no &NULL}{activity_SARSCoV2_3CLPro__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that {#shows|exhibits|displays!} {activity_SARSCoV2_3CLPro#no &NULL}{activity_SARSCoV2_3CLPro__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_SARSCoV2_3CLPro__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra|!} words. -Result: {activity_SARSCoV2_3CLPro#False&True}""", # noqa: E501 +Result: {activity_SARSCoV2_3CLPro#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_SARSCoV2_3CLPro__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}.""", # noqa: E501 +Result: This molecule is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {activity_SARSCoV2_3CLPro__names__gerund}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {activity_SARSCoV2_3CLPro__names__gerund}? -Assistant: {activity_SARSCoV2_3CLPro#No&Yes}, this molecule is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}.""", # noqa: E501 +Assistant: {activity_SARSCoV2_3CLPro#No&Yes}, this molecule is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {activity_SARSCoV2_3CLPro__names__gerund}? -Assistant: {activity_SARSCoV2_3CLPro#No&Yes}, it is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}.""", # noqa: E501 +Assistant: {activity_SARSCoV2_3CLPro#No&Yes}, it is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}? -Assistant: This is a molecule that is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {activity_SARSCoV2_3CLPro#not &NULL}be {activity_SARSCoV2_3CLPro__names__gerund}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {activity_SARSCoV2_3CLPro#not &NULL}be {activity_SARSCoV2_3CLPro__names__gerund}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {activity_SARSCoV2_3CLPro__names__gerund}:{activity_SARSCoV2_3CLPro#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {activity_SARSCoV2_3CLPro__names__gerund}:{activity_SARSCoV2_3CLPro#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_SARSCoV2_3CLPro__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{activity_SARSCoV2_3CLPro#False&True}""", # noqa: E501 +Result:{activity_SARSCoV2_3CLPro#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_SARSCoV2_3CLPro__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result:This molecule is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}.""", # noqa: E501 +Result:This molecule is {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {activity_SARSCoV2_3CLPro__names__gerund}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {activity_SARSCoV2_3CLPro__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {activity_SARSCoV2_3CLPro%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%activity_SARSCoV2_3CLPro%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_SARSCoV2_3CLPro#not &NULL}{activity_SARSCoV2_3CLPro__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%activity_SARSCoV2_3CLPro%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/sarscov2_vitro_touret/transform.py b/data/tabular/sarscov2_vitro_touret/transform.py index 903076d69..7ac058005 100644 --- a/data/tabular/sarscov2_vitro_touret/transform.py +++ b/data/tabular/sarscov2_vitro_touret/transform.py @@ -102,74 +102,74 @@ def get_and_transform_data(): journal = {Scientific Reports}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {activity_SARSCoV2#no &NULL}{activity_SARSCoV2__names__noun}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {activity_SARSCoV2#effectively &ineffectevely}{activity_SARSCoV2__names__gerund}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that {#shows|exhibits|displays!} {activity_SARSCoV2#no &NULL}{activity_SARSCoV2__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {activity_SARSCoV2#no &NULL}{activity_SARSCoV2__names__noun}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {activity_SARSCoV2#effectively &ineffectevely}{activity_SARSCoV2__names__gerund}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that {#shows|exhibits|displays!} {activity_SARSCoV2#no &NULL}{activity_SARSCoV2__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_SARSCoV2__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra|!} words. -Result: {activity_SARSCoV2#False&True}""", # noqa: E501 +Result: {activity_SARSCoV2#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_SARSCoV2__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}.""", # noqa: E501 +Result: This molecule is {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {activity_SARSCoV2__names__gerund}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {activity_SARSCoV2__names__gerund}? -Assistant: {activity_SARSCoV2#No&Yes}, this molecule is {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}.""", # noqa: E501 +Assistant: {activity_SARSCoV2#No&Yes}, this molecule is {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {activity_SARSCoV2__names__gerund}? -Assistant: {activity_SARSCoV2#No&Yes}, it is {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}.""", # noqa: E501 +Assistant: {activity_SARSCoV2#No&Yes}, it is {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}? -Assistant: This is a molecule that is {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {activity_SARSCoV2#not &NULL}be {activity_SARSCoV2__names__gerund}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {activity_SARSCoV2#not &NULL}be {activity_SARSCoV2__names__gerund}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {activity_SARSCoV2__names__gerund}:{activity_SARSCoV2#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {activity_SARSCoV2__names__gerund}:{activity_SARSCoV2#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_SARSCoV2__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{activity_SARSCoV2#False&True}""", # noqa: E501 +Result:{activity_SARSCoV2#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_SARSCoV2__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result:This molecule is {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}.""", # noqa: E501 +Result:This molecule is {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {activity_SARSCoV2__names__gerund}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {activity_SARSCoV2__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {activity_SARSCoV2%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%activity_SARSCoV2%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_SARSCoV2#not &NULL}{activity_SARSCoV2__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%activity_SARSCoV2%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/serine_threonine_kinase_33_butkiewicz/transform.py b/data/tabular/serine_threonine_kinase_33_butkiewicz/transform.py index e8b7cb205..ed30cb903 100644 --- a/data/tabular/serine_threonine_kinase_33_butkiewicz/transform.py +++ b/data/tabular/serine_threonine_kinase_33_butkiewicz/transform.py @@ -147,74 +147,74 @@ def get_and_transform_data(): journal = {Chemical Science}}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {activity_serine_threonine_kinase33#not &NULL}{#showing|exhibiting|displaying!} activity against any of the following: serine kinase /threonine kinase.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__noun}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {activity_serine_threonine_kinase33#not &NULL}{#showing|exhibiting|displaying!} activity against any of the following: serine kinase /threonine kinase.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__noun}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_serine_threonine_kinase33__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra|!} words. -Result: {activity_serine_threonine_kinase33#False&True}""", # noqa: E501 +Result: {activity_serine_threonine_kinase33#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_serine_threonine_kinase33__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}.""", # noqa: E501 +Result: This molecule is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {activity_serine_threonine_kinase33__names__gerund}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {activity_serine_threonine_kinase33__names__gerund}? -Assistant: {activity_serine_threonine_kinase33#No&Yes}, this molecule is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}.""", # noqa: E501 +Assistant: {activity_serine_threonine_kinase33#No&Yes}, this molecule is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {activity_serine_threonine_kinase33__names__gerund}? -Assistant: {activity_serine_threonine_kinase33#No&Yes}, it is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}.""", # noqa: E501 +Assistant: {activity_serine_threonine_kinase33#No&Yes}, it is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}? -Assistant: This is a molecule that is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {activity_serine_threonine_kinase33#not &NULL}be {activity_serine_threonine_kinase33__names__gerund}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {activity_serine_threonine_kinase33#not &NULL}be {activity_serine_threonine_kinase33__names__gerund}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {activity_serine_threonine_kinase33__names__gerund}:{activity_serine_threonine_kinase33#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {activity_serine_threonine_kinase33__names__gerund}:{activity_serine_threonine_kinase33#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_serine_threonine_kinase33__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{activity_serine_threonine_kinase33#False&True}""", # noqa: E501 +Result:{activity_serine_threonine_kinase33#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_serine_threonine_kinase33__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result:This molecule is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}.""", # noqa: E501 +Result:This molecule is {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {activity_serine_threonine_kinase33__names__gerund}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {activity_serine_threonine_kinase33__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {activity_serine_threonine_kinase33%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%activity_serine_threonine_kinase33%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_serine_threonine_kinase33#not &NULL}{activity_serine_threonine_kinase33__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%activity_serine_threonine_kinase33%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/skin_reaction/transform.py b/data/tabular/skin_reaction/transform.py index d4bc8da50..19096a21d 100644 --- a/data/tabular/skin_reaction/transform.py +++ b/data/tabular/skin_reaction/transform.py @@ -137,16 +137,16 @@ def get_and_transform_data(): journal = {Toxicology and Applied Pharmacology}""", ], "templates": [ - "The {#molecule |!}{SMILES__description} {SMILES#} causes {skin_reaction#no &NULL}{skin_reaction__names__noun}.", # noqa: E501 - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {skin_reaction#not &NULL}{skin_reaction__names__gerund}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, there is {skin_reaction#no &NULL}{skin_reaction__names__noun}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} does {skin_reaction#not &NULL}{skin_reaction__names__verb}.", # noqa: E501 not all variables need to be used + "The {#molecule |!}{SMILES__description} {SMILES#} causes {skin_reaction#no &NULL}{skin_reaction__names__noun}.", + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {skin_reaction#not &NULL}{skin_reaction__names__gerund}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, there is {skin_reaction#no &NULL}{skin_reaction__names__noun}.", + "The {#molecule |!}{SMILES__description} {SMILES#} does {skin_reaction#not &NULL}{skin_reaction__names__verb}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {skin_reaction__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result: {skin_reaction#False&True}""", # noqa: E501 +Result: {skin_reaction#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {skin_reaction__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -154,58 +154,58 @@ def get_and_transform_data(): Result: This molecule is {skin_reaction#not &NULL}{skin_reaction__names__gerund}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {skin_reaction__names__gerund}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {skin_reaction__names__gerund}? -Assistant: {skin_reaction#No&Yes}, this molecule is {skin_reaction#not &NULL}{skin_reaction__names__gerund}.""", # noqa: E501 +Assistant: {skin_reaction#No&Yes}, this molecule is {skin_reaction#not &NULL}{skin_reaction__names__gerund}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {skin_reaction__names__gerund}? -Assistant: {skin_reaction#No&Yes}, it is {skin_reaction#not &NULL}{skin_reaction__names__gerund}.""", # noqa: E501 +Assistant: {skin_reaction#No&Yes}, it is {skin_reaction#not &NULL}{skin_reaction__names__gerund}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {skin_reaction#not &NULL}{skin_reaction__names__gerund}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {skin_reaction#not &NULL}{skin_reaction__names__gerund}? -Assistant: This is a molecule that is {skin_reaction#not &NULL}{skin_reaction__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {skin_reaction#not &NULL}{skin_reaction__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {skin_reaction#not &NULL}be {skin_reaction__names__gerund}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {skin_reaction#not &NULL}{skin_reaction__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {skin_reaction#not &NULL}{skin_reaction__names__gerund}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {skin_reaction#not &NULL}be {skin_reaction__names__gerund}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {skin_reaction#not &NULL}{skin_reaction__names__gerund}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {skin_reaction#not &NULL}{skin_reaction__names__gerund}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {skin_reaction__names__gerund}:{skin_reaction#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {skin_reaction__names__gerund}:{skin_reaction#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {skin_reaction__names__gerund}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{skin_reaction#False&True}""", # noqa: E501 +Result:{skin_reaction#False&True}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {skin_reaction__names__gerund}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {skin_reaction__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {skin_reaction%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {skin_reaction__names__gerund}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {skin_reaction%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {skin_reaction#not &NULL}{skin_reaction__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%skin_reaction%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {skin_reaction#not &NULL}{skin_reaction__names__gerund}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%skin_reaction%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/sr_are_tox21/transform.py b/data/tabular/sr_are_tox21/transform.py index e622e87aa..ebcb619cd 100644 --- a/data/tabular/sr_are_tox21/transform.py +++ b/data/tabular/sr_are_tox21/transform.py @@ -119,17 +119,17 @@ def get_and_transform_data(): journal = {Frontiers in Environmental Science}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__adjective}.", # noqa: E501 - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__gerund}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_SR-ARE#no &NULL}{toxicity_SR-ARE__names__noun} {#properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_SR-ARE#not &NULL}identified as {toxicity_SR-ARE__names__adjective}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__adjective}.", + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__gerund}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_SR-ARE#no &NULL}{toxicity_SR-ARE__names__noun} {#properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_SR-ARE#not &NULL}identified as {toxicity_SR-ARE__names__adjective}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_SR-ARE__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra!} words. -Result: {toxicity_SR-ARE#False&True}""", # noqa: E501 +Result: {toxicity_SR-ARE#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_SR-ARE__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -137,58 +137,58 @@ def get_and_transform_data(): Result: This molecule is {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_SR-ARE__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|figure out|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {toxicity_SR-ARE__names__adjective}? -Assistant: {toxicity_SR-ARE#No&Yes}, this molecule is {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_SR-ARE#No&Yes}, this molecule is {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {toxicity_SR-ARE__names__adjective}? -Assistant: {toxicity_SR-ARE#No&Yes}, it is {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_SR-ARE#No&Yes}, it is {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__adjective}? -Assistant: This is a molecule that is {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: This sounds {#very exciting. |very interesting. | very curious. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {toxicity_SR-ARE#not &NULL}be {toxicity_SR-ARE__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {toxicity_SR-ARE#not &NULL}be {toxicity_SR-ARE__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {toxicity_SR-ARE__names__adjective}:{toxicity_SR-ARE#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {toxicity_SR-ARE__names__adjective}:{toxicity_SR-ARE#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_SR-ARE__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{toxicity_SR-ARE#False&True}""", # noqa: E501 +Result:{toxicity_SR-ARE#False&True}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_SR-ARE__names__adjective}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_SR-ARE__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_SR-ARE%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_SR-ARE__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_SR-ARE%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_SR-ARE%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_SR-ARE#not &NULL}{toxicity_SR-ARE__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_SR-ARE%} -Answer:{%multiple_choice_result}""", # noqa: E501, +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/sr_atad5_tox21/transform.py b/data/tabular/sr_atad5_tox21/transform.py index 6d0f59cab..12d7633ae 100644 --- a/data/tabular/sr_atad5_tox21/transform.py +++ b/data/tabular/sr_atad5_tox21/transform.py @@ -65,10 +65,10 @@ def get_and_transform_data(): }, {"noun": "Luciferase-tagged ATAD5 toxicity"}, { - "verb": "shows activity in the SR-Luciferase-tagged ATAD5 in human embryonic kidney cells toxicity assay" # noqa E501 + "verb": "shows activity in the SR-Luciferase-tagged ATAD5 in human embryonic kidney cells toxicity assay" }, { - "verb": "is active in the Luciferase-tagged ATAD5 in human embryonic kidney cells toxicity assay" # noqa + "verb": "is active in the Luciferase-tagged ATAD5 in human embryonic kidney cells toxicity assay" }, {"verb": "is active in the Luciferase-tagged ATAD5 toxicity assay"}, { @@ -127,17 +127,17 @@ def get_and_transform_data(): journal = {Frontiers in Environmental Science}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__adjective}.", # noqa: E501 - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__gerund}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_SR-ATAD5#no &NULL}{toxicity_SR-ATAD5__names__noun} {#properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_SR-ATAD5#not &NULL}identified as {toxicity_SR-ATAD5__names__adjective}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__adjective}.", + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__gerund}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_SR-ATAD5#no &NULL}{toxicity_SR-ATAD5__names__noun} {#properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_SR-ATAD5#not &NULL}identified as {toxicity_SR-ATAD5__names__adjective}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_SR-ATAD5__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra!} words. -Result: {toxicity_SR-ATAD5#False&True}""", # noqa: E501 +Result: {toxicity_SR-ATAD5#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_SR-ATAD5__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -145,58 +145,58 @@ def get_and_transform_data(): Result: This molecule is {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_SR-ATAD5__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|figure out|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {toxicity_SR-ATAD5__names__adjective}? -Assistant: {toxicity_SR-ATAD5#No&Yes}, this molecule is {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_SR-ATAD5#No&Yes}, this molecule is {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {toxicity_SR-ATAD5__names__adjective}? -Assistant: {toxicity_SR-ATAD5#No&Yes}, it is {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_SR-ATAD5#No&Yes}, it is {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__adjective}? -Assistant: This is a molecule that is {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: This sounds {#very exciting. |very interesting. | very curious. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {toxicity_SR-ATAD5#not &NULL}be {toxicity_SR-ATAD5__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {toxicity_SR-ATAD5#not &NULL}be {toxicity_SR-ATAD5__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {toxicity_SR-ATAD5__names__adjective}:{toxicity_SR-ATAD5#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {toxicity_SR-ATAD5__names__adjective}:{toxicity_SR-ATAD5#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_SR-ATAD5__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{toxicity_SR-ATAD5#False&True}""", # noqa: E501 +Result:{toxicity_SR-ATAD5#False&True}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_SR-ATAD5__names__adjective}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_SR-ATAD5__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_SR-ATAD5%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_SR-ATAD5__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_SR-ATAD5%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_SR-ATAD5%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_SR-ATAD5#not &NULL}{toxicity_SR-ATAD5__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_SR-ATAD5%} -Answer:{%multiple_choice_result}""", # noqa: E501, +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/sr_hse_tox21/transform.py b/data/tabular/sr_hse_tox21/transform.py index c4ee9788a..4fa154459 100644 --- a/data/tabular/sr_hse_tox21/transform.py +++ b/data/tabular/sr_hse_tox21/transform.py @@ -115,17 +115,17 @@ def get_and_transform_data(): journal = {Frontiers in Environmental Science}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__adjective}.", # noqa: E501 - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__gerund}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_SR-HSE#no &NULL}{toxicity_SR-HSE__names__noun} {#properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_SR-HSE#not &NULL}identified as {toxicity_SR-HSE__names__adjective}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__adjective}.", + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__gerund}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_SR-HSE#no &NULL}{toxicity_SR-HSE__names__noun} {#properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_SR-HSE#not &NULL}identified as {toxicity_SR-HSE__names__adjective}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_SR-HSE__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra!} words. -Result: {toxicity_SR-HSE#False&True}""", # noqa: E501 +Result: {toxicity_SR-HSE#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_SR-HSE__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -133,58 +133,58 @@ def get_and_transform_data(): Result: This molecule is {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_SR-HSE__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|figure out|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {toxicity_SR-HSE__names__adjective}? -Assistant: {toxicity_SR-HSE#No&Yes}, this molecule is {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_SR-HSE#No&Yes}, this molecule is {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {toxicity_SR-HSE__names__adjective}? -Assistant: {toxicity_SR-HSE#No&Yes}, it is {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_SR-HSE#No&Yes}, it is {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__adjective}? -Assistant: This is a molecule that is {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: This sounds {#very exciting. |very interesting. | very curious. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {toxicity_SR-HSE#not &NULL}be {toxicity_SR-HSE__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {toxicity_SR-HSE#not &NULL}be {toxicity_SR-HSE__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {toxicity_SR-HSE__names__adjective}:{toxicity_SR-HSE#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {toxicity_SR-HSE__names__adjective}:{toxicity_SR-HSE#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_SR-HSE__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{toxicity_SR-HSE#False&True}""", # noqa: E501 +Result:{toxicity_SR-HSE#False&True}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_SR-HSE__names__adjective}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_SR-HSE__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_SR-HSE%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_SR-HSE__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_SR-HSE%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_SR-HSE%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_SR-HSE#not &NULL}{toxicity_SR-HSE__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_SR-HSE%} -Answer:{%multiple_choice_result}""", # noqa: E501, +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/sr_mmp_tox21/transform.py b/data/tabular/sr_mmp_tox21/transform.py index 9649356a1..efc1439aa 100644 --- a/data/tabular/sr_mmp_tox21/transform.py +++ b/data/tabular/sr_mmp_tox21/transform.py @@ -123,17 +123,17 @@ def get_and_transform_data(): journal = {Frontiers in Environmental Science}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__adjective}.", # noqa: E501 - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__gerund}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_SR-MMP#no &NULL}{toxicity_SR-MMP__names__noun} {#properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_SR-MMP#not &NULL}identified as {toxicity_SR-MMP__names__adjective}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__adjective}.", + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__gerund}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_SR-MMP#no &NULL}{toxicity_SR-MMP__names__noun} {#properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_SR-MMP#not &NULL}identified as {toxicity_SR-MMP__names__adjective}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_SR-MMP__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra!} words. -Result: {toxicity_SR-MMP#False&True}""", # noqa: E501 +Result: {toxicity_SR-MMP#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_SR-MMP__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -141,58 +141,58 @@ def get_and_transform_data(): Result: This molecule is {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_SR-MMP__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|figure out|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {toxicity_SR-MMP__names__adjective}? -Assistant: {toxicity_SR-MMP#No&Yes}, this molecule is {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_SR-MMP#No&Yes}, this molecule is {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {toxicity_SR-MMP__names__adjective}? -Assistant: {toxicity_SR-MMP#No&Yes}, it is {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_SR-MMP#No&Yes}, it is {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__adjective}? -Assistant: This is a molecule that is {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: This sounds {#very exciting. |very interesting. | very curious. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {toxicity_SR-MMP#not &NULL}be {toxicity_SR-MMP__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {toxicity_SR-MMP#not &NULL}be {toxicity_SR-MMP__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {toxicity_SR-MMP__names__adjective}:{toxicity_SR-MMP#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {toxicity_SR-MMP__names__adjective}:{toxicity_SR-MMP#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_SR-MMP__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{toxicity_SR-MMP#False&True}""", # noqa: E501 +Result:{toxicity_SR-MMP#False&True}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_SR-MMP__names__adjective}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_SR-MMP__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_SR-MMP%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_SR-MMP__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_SR-MMP%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_SR-MMP%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_SR-MMP#not &NULL}{toxicity_SR-MMP__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_SR-MMP%} -Answer:{%multiple_choice_result}""", # noqa: E501, +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/sr_p53_tox21/transform.py b/data/tabular/sr_p53_tox21/transform.py index 60239e40a..5e4f3d12b 100644 --- a/data/tabular/sr_p53_tox21/transform.py +++ b/data/tabular/sr_p53_tox21/transform.py @@ -116,17 +116,17 @@ def get_and_transform_data(): journal = {Frontiers in Environmental Science}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__adjective}.", # noqa: E501 - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__gerund}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_SR-p53#no &NULL}{toxicity_SR-p53__names__noun} {#properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_SR-p53#not &NULL}identified as {toxicity_SR-p53__names__adjective}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__adjective}.", + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__gerund}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {toxicity_SR-p53#no &NULL}{toxicity_SR-p53__names__noun} {#properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {toxicity_SR-p53#not &NULL}identified as {toxicity_SR-p53__names__adjective}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_SR-p53__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra!} words. -Result: {toxicity_SR-p53#False&True}""", # noqa: E501 +Result: {toxicity_SR-p53#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_SR-p53__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} @@ -134,58 +134,58 @@ def get_and_transform_data(): Result: This molecule is {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_SR-p53__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|figure out|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {toxicity_SR-p53__names__adjective}? -Assistant: {toxicity_SR-p53#No&Yes}, this molecule is {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_SR-p53#No&Yes}, this molecule is {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {toxicity_SR-p53__names__adjective}? -Assistant: {toxicity_SR-p53#No&Yes}, it is {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__adjective}.""", # noqa: E501 +Assistant: {toxicity_SR-p53#No&Yes}, it is {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__adjective}? -Assistant: This is a molecule that is {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: This sounds {#very exciting. |very interesting. | very curious. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {toxicity_SR-p53#not &NULL}be {toxicity_SR-p53__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {toxicity_SR-p53#not &NULL}be {toxicity_SR-p53__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {toxicity_SR-p53__names__adjective}:{toxicity_SR-p53#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {toxicity_SR-p53__names__adjective}:{toxicity_SR-p53#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {toxicity_SR-p53__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{toxicity_SR-p53#False&True}""", # noqa: E501 +Result:{toxicity_SR-p53#False&True}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {toxicity_SR-p53__names__adjective}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_SR-p53__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_SR-p53%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {toxicity_SR-p53__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {toxicity_SR-p53%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_SR-p53%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {toxicity_SR-p53#not &NULL}{toxicity_SR-p53__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%toxicity_SR-p53%} -Answer:{%multiple_choice_result}""", # noqa: E501, +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/suzuki_miyaura_sach/transform.py b/data/tabular/suzuki_miyaura_sach/transform.py index 2fe6fb121..dd7680baf 100644 --- a/data/tabular/suzuki_miyaura_sach/transform.py +++ b/data/tabular/suzuki_miyaura_sach/transform.py @@ -123,7 +123,7 @@ def canonicalize_smiles(smi): def make_reaction_smiles(row): - precursors = f" {row['reactant1_SMILES']}.{row['reactant2_SMILES']}.{row['catalyst_SMILES']}.{row['ligand_SMILES']}.{row['reagent_SMILES']}.{row['solvent_SMILES']} " # noqa + precursors = f" {row['reactant1_SMILES']}.{row['reactant2_SMILES']}.{row['catalyst_SMILES']}.{row['ligand_SMILES']}.{row['reagent_SMILES']}.{row['solvent_SMILES']} " product = "C1=C(C2=C(C)C=CC3N(C4OCCCC4)N=CC2=3)C=CC2=NC=CC=C12" # print(precursors, product) can_precursors = Chem.MolToSmiles( diff --git a/data/tabular/train_test_split.py b/data/tabular/train_test_split.py index 4ec096e89..fb23d9632 100644 --- a/data/tabular/train_test_split.py +++ b/data/tabular/train_test_split.py @@ -469,7 +469,7 @@ def as_sequence_split( val = all_as_sequence[train_size : train_size + val_size] test = all_as_sequence[train_size + val_size :] print( - f"In total, there are {len(all_as_sequence)} AS_SEQUENCEs. Split sizes: {len(train)} train, {len(val)} valid, {len(test)} test." # noqa: E501 + f"In total, there are {len(all_as_sequence)} AS_SEQUENCEs. Split sizes: {len(train)} train, {len(val)} valid, {len(test)} test." ) with open("val_as_sequences.txt", "w") as f: @@ -637,7 +637,7 @@ def assign_splits( if ( yaml_file_has_column_of_type(file, "SMILES") and not yaml_file_has_column_of_type(file, "AS_SEQUENCE") - ) # noqa: E501 + ) ] # we filter those out that are in the to_scaffold_split list not_scaffold_split_yaml_files = [ @@ -707,7 +707,7 @@ def split_and_save(file, ddf): # split_counts = ddf["split"].value_counts().compute() # print( - # f"Dataset {file} has {len(ddf)} datapoints. Split sizes: {split_counts['train']} train, {split_counts['valid']} valid, {split_counts['test']} test." # noqa: E501 + # f"Dataset {file} has {len(ddf)} datapoints. Split sizes: {split_counts['train']} train, {split_counts['valid']} valid, {split_counts['test']} test." # ) # we then write the new data_clean.csv file @@ -872,10 +872,10 @@ def scaffold_split( # to ensure overall scaffold splitting does not distort train/val/test split sizes for each dataset print( - f"Dataset {file} has {len(df)} datapoints. Split sizes: {len(df[df['split'] == 'train'])} train, {len(df[df['split'] == 'valid'])} valid, {len(df[df['split'] == 'test'])} test." # noqa: E501 + f"Dataset {file} has {len(df)} datapoints. Split sizes: {len(df[df['split'] == 'train'])} train, {len(df[df['split'] == 'valid'])} valid, {len(df[df['split'] == 'test'])} test." ) print( - f"Dataset {file} has {len(df)} datapoints. Split fractions: {len(df[df['split'] == 'train']) / len(df)} train, {len(df[df['split'] == 'valid']) / len(df)} valid, {len(df[df['split'] == 'test']) / len(df)} test." # noqa: E501 + f"Dataset {file} has {len(df)} datapoints. Split fractions: {len(df[df['split'] == 'train']) / len(df)} train, {len(df[df['split'] == 'valid']) / len(df)} valid, {len(df[df['split'] == 'test']) / len(df)} test." ) if override: # write the new data_clean.csv file diff --git a/data/tabular/tyrosyl-dna_phosphodiesterase_butkiewicz/transform.py b/data/tabular/tyrosyl-dna_phosphodiesterase_butkiewicz/transform.py index a0523e79b..d22e3c923 100644 --- a/data/tabular/tyrosyl-dna_phosphodiesterase_butkiewicz/transform.py +++ b/data/tabular/tyrosyl-dna_phosphodiesterase_butkiewicz/transform.py @@ -149,76 +149,76 @@ def get_and_transform_data(): journal = {Chemical Science}}""", ], "templates": [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__noun}.", # noqa: E501 - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {activity_tyrosyl_dna_phosphodiesterase#no &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__gerund}.", # noqa: E501 - "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {activity_tyrosyl_dna_phosphodiesterase#no &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective} {#properties|characteristics|features!}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}identified as {activity_tyrosyl_dna_phosphodiesterase__names__adjective}.", # noqa: E501 - "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective}.", # noqa: E501 not all variables need to be used + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__noun}.", + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} {activity_tyrosyl_dna_phosphodiesterase#no &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__gerund}.", + "Based on the {SMILES__description} {#representation |!}{SMILES#}, the molecule has {activity_tyrosyl_dna_phosphodiesterase#no &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective} {#properties|characteristics|features!}.", + "The {SMILES__description} {SMILES#} {#represents|is from!} a molecule that is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}identified as {activity_tyrosyl_dna_phosphodiesterase__names__adjective}.", + "The {#molecule |!}{SMILES__description} {SMILES#} is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective}.", # Instruction tuning text templates """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_tyrosyl_dna_phosphodiesterase__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional|extra!} words. -Result: {activity_tyrosyl_dna_phosphodiesterase#False&True}""", # noqa: E501 +Result: {activity_tyrosyl_dna_phosphodiesterase#False&True}""", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_tyrosyl_dna_phosphodiesterase__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Answer the question in a {#full|complete!} sentence. -Result: This molecule is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective}.""", # noqa: E501 +Result: This molecule is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective}.""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {activity_tyrosyl_dna_phosphodiesterase__names__adjective}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|figure out|estimate!} if the molecule with the {SMILES__description} {SMILES#} is {activity_tyrosyl_dna_phosphodiesterase__names__adjective}? -Assistant: {activity_tyrosyl_dna_phosphodiesterase#No&Yes}, this molecule is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective}.""", # noqa: E501 +Assistant: {activity_tyrosyl_dna_phosphodiesterase#No&Yes}, this molecule is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective}.""", """User: Is the molecule with the {SMILES__description} {SMILES#} {activity_tyrosyl_dna_phosphodiesterase__names__adjective}? -Assistant: {activity_tyrosyl_dna_phosphodiesterase#No&Yes}, it is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective}.""", # noqa: E501 +Assistant: {activity_tyrosyl_dna_phosphodiesterase#No&Yes}, it is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective}? -Assistant: This is a molecule that is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: This sounds {#very exciting. |very interesting. | very curious. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should {activity_tyrosyl_dna_phosphodiesterase#not &NULL}be {activity_tyrosyl_dna_phosphodiesterase__names__adjective}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {#molecule |!}{SMILES__description}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should {activity_tyrosyl_dna_phosphodiesterase#not &NULL}be {activity_tyrosyl_dna_phosphodiesterase__names__adjective}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} is {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective}: {SMILES#}""", # Benchmarking text templates - "Is the {SMILES__description} {SMILES#} {activity_tyrosyl_dna_phosphodiesterase__names__adjective}:{activity_tyrosyl_dna_phosphodiesterase#no&yes}", # noqa: E501 for the benchmarking setup separates input and output + "Is the {SMILES__description} {SMILES#} {activity_tyrosyl_dna_phosphodiesterase__names__adjective}:{activity_tyrosyl_dna_phosphodiesterase#no&yes}", """Task: Please classify a molecule based on the description. Description: A molecule that is {activity_tyrosyl_dna_phosphodiesterase__names__adjective}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must pick either "True" or "False" without using any {#other|additional!} words. -Result:{activity_tyrosyl_dna_phosphodiesterase#False&True}""", # noqa: E501 +Result:{activity_tyrosyl_dna_phosphodiesterase#False&True}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that is {activity_tyrosyl_dna_phosphodiesterase__names__adjective}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {activity_tyrosyl_dna_phosphodiesterase__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {activity_tyrosyl_dna_phosphodiesterase%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Is the molecule with the {SMILES__description} {#representation of |!}{SMILES#} {activity_tyrosyl_dna_phosphodiesterase__names__adjective}? Constraint: Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%2%aA1} without using any {#other|additional!} words. Options: {activity_tyrosyl_dna_phosphodiesterase%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%activity_tyrosyl_dna_phosphodiesterase%} -Answer: {%multiple_choice_result}""", # noqa: E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: Which molecules are {activity_tyrosyl_dna_phosphodiesterase#not &NULL}{activity_tyrosyl_dna_phosphodiesterase__names__adjective}? Constraint: You must select none, one or more options from {%multiple_choice_enum%2-5%aA1} without using any {#other|additional!} words. Options: {SMILES%activity_tyrosyl_dna_phosphodiesterase%} -Answer:{%multiple_choice_result}""", # noqa: E501 +Answer:{%multiple_choice_result}""", ], } diff --git a/data/tabular/volume_of_distribution_at_steady_state_lombardo_et_al/transform.py b/data/tabular/volume_of_distribution_at_steady_state_lombardo_et_al/transform.py index 1d45078bb..d10f3c219 100644 --- a/data/tabular/volume_of_distribution_at_steady_state_lombardo_et_al/transform.py +++ b/data/tabular/volume_of_distribution_at_steady_state_lombardo_et_al/transform.py @@ -95,7 +95,7 @@ def get_and_transform_data(): "description": "corresponding publication", }, { - "url": "https://tdcommons.ai/single_pred_tasks/adme/#vdss-volumn-of-distribution-at-steady-state-lombardo-et-al", # noqa: E501 + "url": "https://tdcommons.ai/single_pred_tasks/adme/#vdss-volumn-of-distribution-at-steady-state-lombardo-et-al", "description": "data source", }, ], diff --git a/data/text_sampling/preprocess_kg.py b/data/text_sampling/preprocess_kg.py index 10d090e51..93d8887ee 100644 --- a/data/text_sampling/preprocess_kg.py +++ b/data/text_sampling/preprocess_kg.py @@ -12,212 +12,212 @@ "compound_chebi": [ """The {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} {node2_name#}.""", """Task: Please {#create|generate!} {#a compound |a !}{SMILES__description} that {rel1_type#} {node2_name#}. -Result: {SMILES#}""", # noqa E501 +Result: {SMILES#}""", """Task: Please {#create|generate!} {#a compound |a !}{SMILES__description} that {rel1_type#} {node2_name#}. -Result:{SMILES#}""", # noqa E501 +Result:{SMILES#}""", # Add templates with constraint section? ], "compound_chebi_chebi": [ - """The {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} {node2_name#} and {rel2_type#} {node3_name#}.""", # noqa E501 - # """Task: Please {#create|generate!} {#a compound |a !}{SMILES__description} that {rel1_type#} {node2_name#} and {rel2_type#} {node3_name#}. # noqa E501 - # Result: {SMILES#}""", # noqa E501 - # """Task: Please {#create|generate!} {#a compound |a !}{SMILES__description} that {rel1_type#} {node2_name#} and {rel2_type#} {node3_name#}. # noqa E501 - # Result:{SMILES#}""", # noqa E501 + """The {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} {node2_name#} and {rel2_type#} {node3_name#}.""", + # """Task: Please {#create|generate!} {#a compound |a !}{SMILES__description} that {rel1_type#} {node2_name#} and {rel2_type#} {node3_name#}. + # Result: {SMILES#}""", + # """Task: Please {#create|generate!} {#a compound |a !}{SMILES__description} that {rel1_type#} {node2_name#} and {rel2_type#} {node3_name#}. + # Result:{SMILES#}""", # Not sure if this templates make sense here? Add templates with constraint section? ], "compound_chebi_chebi_chebi": [], "compound_protein": [ """The {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}.""", - """The {node2_type#} {node2_protein_names#} is targeted by the drug with the {SMILES__description} {SMILES#}.""", # noqa E501 + """The {node2_type#} {node2_protein_names#} is targeted by the drug with the {SMILES__description} {SMILES#}.""", """User: Can you {#give me|come up with!} {#one|an!} example for a {node1_type#} {SMILES__description} that {rel1_type#} the {node2_type#} {node2_protein_names#}? -Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}.""", # noqa E501 +Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}.""", ], # "compound_protein_compound": [ - # """The {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} and {rel2_type#} the {node3_type#} {node3_smiles#}.""", # noqa E501 - # """The {node2_type#} {node2_protein_names#} is targeted by the compound with the {SMILES__description} {SMILES#} and {node3_smiles#}.""", # noqa E501 - # """User: Can you {#give me|come up with!} {#one|an!} example for a {node1_type#} {SMILES__description} that {rel1_type#} the {node2_type#} {node2_protein_names#}? # noqa E501 - # Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. # noqa E501 - # User: Can you {#tell|create|generate!} another {node1_type#} {SMILES__description} that {rel1_type#} the {node2_type#} {node2_protein_names#}? # noqa E501 - # Assistant: {#Sure|Yes|Of course|Yes, of course!}, the {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node3_type#} {SMILES__description} {node3_smiles#}.""", # noqa E501 + # """The {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} and {rel2_type#} the {node3_type#} {node3_smiles#}.""", + # """The {node2_type#} {node2_protein_names#} is targeted by the compound with the {SMILES__description} {SMILES#} and {node3_smiles#}.""", + # """User: Can you {#give me|come up with!} {#one|an!} example for a {node1_type#} {SMILES__description} that {rel1_type#} the {node2_type#} {node2_protein_names#}? + # Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. + # User: Can you {#tell|create|generate!} another {node1_type#} {SMILES__description} that {rel1_type#} the {node2_type#} {node2_protein_names#}? + # Assistant: {#Sure|Yes|Of course|Yes, of course!}, the {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node3_type#} {SMILES__description} {node3_smiles#}.""", # ], # "compound_protein_compound_3": [ - # """The {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} and {rel2_type#} the {node3_type#} {node3_smiles#}.""", # noqa E501 - # """The {node2_type#} {node2_protein_names#} is targeted by the compound with the {SMILES__description} {SMILES#} and {node3_smiles#}.""", # noqa E501 - # """User: Can you {#give me|come up with!} {#one|an!} example for a {node1_type#} {SMILES__description} that {rel1_type#} the {node2_type#} {node2_protein_names#}? # noqa E501 - # Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. # noqa E501 - # User: Can you {#tell|create|generate!} another {node1_type#} {SMILES__description} that {rel1_type#} the {node2_type#} {node2_protein_names#}? # noqa E501 - # Assistant: {#Sure|Yes|Of course|Yes, of course!}, the {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node3_type#} {SMILES__description} {node3_smiles#}.""", # noqa E501 + # """The {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} and {rel2_type#} the {node3_type#} {node3_smiles#}.""", + # """The {node2_type#} {node2_protein_names#} is targeted by the compound with the {SMILES__description} {SMILES#} and {node3_smiles#}.""", + # """User: Can you {#give me|come up with!} {#one|an!} example for a {node1_type#} {SMILES__description} that {rel1_type#} the {node2_type#} {node2_protein_names#}? + # Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. + # User: Can you {#tell|create|generate!} another {node1_type#} {SMILES__description} that {rel1_type#} the {node2_type#} {node2_protein_names#}? + # Assistant: {#Sure|Yes|Of course|Yes, of course!}, the {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node3_type#} {SMILES__description} {node3_smiles#}.""", # ], "compound_protein_disease": [ - """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} the {node3_type#} {node3_name#}.""", # noqa E501 - """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} the {node3_type#} {node3_name#}.""", # noqa E501 + """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} the {node3_type#} {node3_name#}.""", + """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} the {node3_type#} {node3_name#}.""", """User: {#Can you give me|Can you come up with!} {#an|one!} example for a protein that is targeted by the {node1_type#} {SMILES#}? Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node2_type#} {node2_protein_names#} is targeted by the {node1_type#} {SMILES#}. User: Can you tell me which disease the {node2_type#} {node2_protein_names#} {rel2_type#}? -Assistant: The {node2_type#} {node2_protein_names#} {rel2_type#} the {node3_name#} {node3_type#}.""", # noqa E501 +Assistant: The {node2_type#} {node2_protein_names#} {rel2_type#} the {node3_name#} {node3_type#}.""", ], "compound_protein_domain": [ - """{SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} a {node3_name#}.""", # noqa E501 - """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} a {node3_name#}.""", # noqa E501 + """{SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} a {node3_name#}.""", + """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} a {node3_name#}.""", """User: {#Can you give me|Can you come up with!} {#an|one!} example for a protein that binds the {node1_type#} {SMILES#}? Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node1_type#} {SMILES#} {rel1_type#} for example the {node2_type#} {node2_protein_names#}. User: Can you tell me a domain of the {node2_type#} {node2_protein_names#}? -Assistant: The {node2_type#} {node2_protein_names#} {rel2_type#} a {node3_name#}.""", # noqa E501 +Assistant: The {node2_type#} {node2_protein_names#} {rel2_type#} a {node3_name#}.""", ], "compound_protein_ec_number": [ - """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} and {rel2_type#} the {node3_name#} (EC {node3_id#}).""", # noqa E501 - """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. Furthermore, the {node1_type#} {SMILES#} {rel2_type#} the {node3_name#} (EC {node3_id#}).""", # noqa E501 + """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} and {rel2_type#} the {node3_name#} (EC {node3_id#}).""", + """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. Furthermore, the {node1_type#} {SMILES#} {rel2_type#} the {node3_name#} (EC {node3_id#}).""", """User: {#Can you give me|Can you come up with!} {#an|one!} example for a protein that binds the {node1_type#} {SMILES#}? Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. User: Can you tell me which enzyme the {node2_type#} {node2_protein_names#} {rel2_type#}? -Assistant: The {node2_type#} {node2_protein_names#} {rel2_type#} a {node3_name#} (EC {node3_id#}).""", # noqa E501 +Assistant: The {node2_type#} {node2_protein_names#} {rel2_type#} a {node3_name#} (EC {node3_id#}).""", ], # todo: There are some entries that have the EC number under node3_name and node3_id # and this is not handled yet properly. # "compound_protein_go_term": [ - # """The {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} the {node3_name#}.""", # noqa E501 - # """The {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} the {node3_name#}.""", # noqa E501 + # """The {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} the {node3_name#}.""", + # """The {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} the {node3_name#}.""", # ], "compound_protein_hpo": [ - """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} and {rel2_type#} {node3_name#}.""", # noqa E501 - """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} {node3_name#}.""", # noqa E501 - """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} the human phenotype represented by {node3_name#}.""", # noqa E501 - """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {rel2_type#} the {node3_name#}.""", # noqa E501 + """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} and {rel2_type#} {node3_name#}.""", + """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} {node3_name#}.""", + """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} the human phenotype represented by {node3_name#}.""", + """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {rel2_type#} the {node3_name#}.""", ], "compound_protein_hpo_disease": [ - """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} {node3_name#}. The {node3_name#} {rel3_type#} the {node4_type#} {node4_name#}.""", # noqa E501 + """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} {node3_name#}. The {node3_name#} {rel3_type#} the {node4_type#} {node4_name#}.""", ], "compound_protein_pathway": [ - """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} the {node3_name#}.""", # noqa E501 - """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} the {node3_name#}.""", # noqa E501 + """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} the {node3_name#}.""", + """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} the {node3_name#}.""", ], "compound_protein_pathway_disease": [ - """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} {node3_name#}. The {node3_name#} is {rel3_type#} the {node4_type#} {node4_name#}.""", # noqa E501 + """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} {node3_name#}. The {node3_name#} is {rel3_type#} the {node4_type#} {node4_name#}.""", ], "compound_protein_protein": [ - """The {node1_type#} with {SMILES__description} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} the {node3_type#} {node3_protein_names#}.""", # noqa E501 - """The {node2_type#} {node2_protein_names#} is targeted by {node1_type#} with {SMILES__description} {SMILES#}. The {node2_type#} {node2_protein_names#} {rel2_type#} {node3_protein_names#}.""", # noqa E501 + """The {node1_type#} with {SMILES__description} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} the {node3_type#} {node3_protein_names#}.""", + """The {node2_type#} {node2_protein_names#} is targeted by {node1_type#} with {SMILES__description} {SMILES#}. The {node2_type#} {node2_protein_names#} {rel2_type#} {node3_protein_names#}.""", """User: {#Can you give me|Can you come up with!} {#an|one!} example for a protein that binds the {node1_type#} with {SMILES__description} {SMILES#}? Assistant: The {node1_type#} with {SMILES__description} {SMILES#} {rel1_type#} for example the {node2_type#} {node2_protein_names#}. User: Can you tell me a {node3_type#} that {rel2_type#} {node2_type#} {node2_protein_names#}? -Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node2_type#} {node2_protein_names#} {rel2_type#} {node3_protein_names#}.""", # noqa E501 +Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node2_type#} {node2_protein_names#} {rel2_type#} {node3_protein_names#}.""", ], "drug_chebi": [ """The {node1_type#} {SMILES#} {rel1_type#} {node2_name#}.""", ], "drug_chebi_chebi": [ - """The {node1_type#} {SMILES#} {rel1_type#} {node2_name#} and {rel2_type#} {node3_name#}.""", # noqa E501 + """The {node1_type#} {SMILES#} {rel1_type#} {node2_name#} and {rel2_type#} {node3_name#}.""", ], "drug_chebi_chebi_chebi": [], "drug_disease_pathway": [ - """The {node1_type#} {SMILES#|node1_name#} is indicated for the {node2_name#} {node2_type#} and {rel2_type#} the {node3_name#} {node3_type#}.""", # noqa E501 + """The {node1_type#} {SMILES#|node1_name#} is indicated for the {node2_name#} {node2_type#} and {rel2_type#} the {node3_name#} {node3_type#}.""", ], "drug_disease_pathway_protein": [ - """The {node1_type#} {SMILES#|node1_name#} is indicated for the {node2_name#} {node2_type#} and {rel2_type#} the {node3_name#} {node3_type#}. The {node3_type#} {node3_name#} {rel3_type#} the {node4_type#} {node4_protein_names#}.""", # noqa E501 + """The {node1_type#} {SMILES#|node1_name#} is indicated for the {node2_name#} {node2_type#} and {rel2_type#} the {node3_name#} {node3_type#}. The {node3_type#} {node3_name#} {rel3_type#} the {node4_type#} {node4_protein_names#}.""", ], "drug_protein": [ """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#}.""", """User: {#Can you give me|Can you come up with!} {#an|one!} example for a protein that is targeted by the {node1_type#} {SMILES#|node1_name#}? -Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node2_type#} {node2_protein_names#} is targeted by {#this|the above!} {node1_type#}.""", # noqa E501 +Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node2_type#} {node2_protein_names#} is targeted by {#this|the above!} {node1_type#}.""", ], "drug_protein_disease": [ - """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} the {node3_type#} {node3_name#}.""", # noqa E501 - """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} the {node3_type#} {node3_name#}.""", # noqa E501 + """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} the {node3_type#} {node3_name#}.""", + """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} the {node3_type#} {node3_name#}.""", """User: {#Can you give me|Can you come up with!} {#an|one!} example for a protein that is targeted by the {node1_type#} {SMILES#|node1_name#}? Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node2_type#} {node2_protein_names#} is targeted by {#this|the above!} {node1_type#}. User: Can you tell me which disease the {node2_type#} {node2_protein_names#} {rel2_type#}? -Assistant: The {node2_type#} {node2_protein_names#} {rel2_type#} the {node3_name#} {node3_type#}.""", # noqa E501 +Assistant: The {node2_type#} {node2_protein_names#} {rel2_type#} the {node3_name#} {node3_type#}.""", ], "drug_protein_domain": [ - """{SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} a {node3_name#}.""", # noqa E501 - """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} a {node3_name#}.""", # noqa E501 + """{SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} a {node3_name#}.""", + """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} a {node3_name#}.""", """User: {#Can you give me|Can you come up with!} {#an|one!} example for a protein that binds the {node1_type#} {SMILES#|node1_name#}? Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node1_type#} {rel1_type#} for example the {node2_type#} {node2_protein_names#}. User: Can you tell me a domain of the {node2_type#} {node2_protein_names#}? -Assistant: The {node2_type#} {node2_protein_names#} {rel2_type#} a {node3_name#}.""", # noqa E501 +Assistant: The {node2_type#} {node2_protein_names#} {rel2_type#} a {node3_name#}.""", ], "drug_protein_drug": [ - """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#} {rel2_type#} the {node3_type#} {node3_name#|node3_smiles#}.""", # noqa E501 - """The {node2_type#} {node2_protein_names#} is targeted by the drugs {SMILES#|node1_name#} and {node3_name#|node3_smiles#}.""", # noqa E501 + """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#} {rel2_type#} the {node3_type#} {node3_name#|node3_smiles#}.""", + """The {node2_type#} {node2_protein_names#} is targeted by the drugs {SMILES#|node1_name#} and {node3_name#|node3_smiles#}.""", """User: {#Can you give me|Can you come up with!} {#an|one!} example for a {node1_type#} that {rel1_type#} the {node2_type#} {node2_protein_names#}? Assistant: {#Sure|Yes|Of course|Yes, of course!}, the {node1_type#} {rel1_type#} the {node2_type#} {node2_protein_names#}. User: Can you tell me another {node1_type#} that {rel1_type#} the {node2_type#} {node2_protein_names#}? -Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node3_type#} {node3_name#|node3_smiles#} also {rel1_type#} the {node2_type#} {node2_protein_names#}.""", # noqa E501 +Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node3_type#} {node3_name#|node3_smiles#} also {rel1_type#} the {node2_type#} {node2_protein_names#}.""", ], "drug_protein_ec_number": [ - """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_name#} which {rel2_type#} the {node3_name#} (EC {node3_id#}) reaction.""", # noqa E501 - """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_name#}. Furthermore, the {node2_type#} {node2_name#} {rel2_type#} the {node3_name#} (EC {node3_id#}) reaction.""", # noqa E501 + """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_name#} which {rel2_type#} the {node3_name#} (EC {node3_id#}) reaction.""", + """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_name#}. Furthermore, the {node2_type#} {node2_name#} {rel2_type#} the {node3_name#} (EC {node3_id#}) reaction.""", """User: {#Can you give me|Can you come up with!} {#an|one!} example for a protein that binds the {node1_type#} {SMILES#|node1_name#}? Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_name#}. User: Can you tell me which reaction the {node2_type#} {node2_name#} {rel2_type#}? -Assistant: The {node2_type#} {node2_name#} {rel2_type#} a {node3_name#} (EC {node3_id#}) reaction.""", # noqa E501 +Assistant: The {node2_type#} {node2_name#} {rel2_type#} a {node3_name#} (EC {node3_id#}) reaction.""", ], "drug_protein_go_term": [ - """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_name#} which {rel2_type#} the {node3_name#}.""", # noqa E501 - """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_name#}. The {node2_type#} {node2_name#} {rel2_type#} the {node3_name#}.""", # noqa E501 + """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_name#} which {rel2_type#} the {node3_name#}.""", + """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_name#}. The {node2_type#} {node2_name#} {rel2_type#} the {node3_name#}.""", """User: {#Can you give me|Can you come up with!} {#an|one!} example for a protein that binds the {node1_type#} {SMILES#|node1_name#}? Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_name#}. User: Can you tell me more {#details |!}about {node2_type#} {node2_name#}? -Assistant: {#Sure|Yes|Of course|Yes, of course!}, the {node2_type#} {node2_name#} {rel2_type#} the {node3_name#}.""", # noqa E501 +Assistant: {#Sure|Yes|Of course|Yes, of course!}, the {node2_type#} {node2_name#} {rel2_type#} the {node3_name#}.""", ], "drug_protein_hpo": [ - """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#} and {rel2_type#} {node3_name#}.""", # noqa E501 - """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} {node3_name#}.""", # noqa E501 - """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} the human phenotype represented by {node3_name#}.""", # noqa E501 - """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#}. This {node2_type#} {rel2_type#} the {node3_name#}.""", # noqa E501 + """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#} and {rel2_type#} {node3_name#}.""", + """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} {node3_name#}.""", + """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} the human phenotype represented by {node3_name#}.""", + """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#}. This {node2_type#} {rel2_type#} the {node3_name#}.""", ], "drug_protein_hpo_disease": [ - """The {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} {node3_name#}. The {node3_name#} {rel3_type#} the {node4_type#} {node4_name#}.""", # noqa E501 + """The {node1_type#} {SMILES__description} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} {node3_name#}. The {node3_name#} {rel3_type#} the {node4_type#} {node4_name#}.""", ], "drug_protein_pathway": [ - """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} the {node3_name#}.""", # noqa E501 - """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} the {node3_name#}.""", # noqa E501 + """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} the {node3_name#}.""", + """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} the {node3_name#}.""", """User: {#Can you give me|Can you come up with!} {#an|one!} example for a protein that binds the {node1_type#} {SMILES#|node1_name#}? Assistant: {#Sure|Yes|Of course|Yes, of course!}, the {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_name#}. User: Can you tell me more {#details |!}about {node2_type#} {node2_name#}? -Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node2_type#} {node2_name#} {rel2_type#} the {node3_name#}.""", # noqa E501 +Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node2_type#} {node2_name#} {rel2_type#} the {node3_name#}.""", ], "drug_protein_pathway_disease": [ - """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} the {node3_name#}. The {node3_name#} is {rel3_type#} the {node4_type#} {node4_name#}.""", # noqa E501 + """The {node1_type#} {SMILES#} {rel1_type#} the {node2_type#} {node2_protein_names#}. The {node2_type#} {node2_protein_names#} {rel2_type#} the {node3_name#}. The {node3_name#} is {rel3_type#} the {node4_type#} {node4_name#}.""", ], "drug_protein_protein": [ - """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} the {node3_type#} {node3_name#}.""", # noqa E501 - """The {node2_type#} {node2_protein_names#} is targeted by {SMILES#|node1_name#}. The {node2_type#} {node2_protein_names#} {rel2_type#} {node3_name#}.""", # noqa E501 + """The {node1_type#} {SMILES#|node1_name#} {rel1_type#} the {node2_type#} {node2_protein_names#} which {rel2_type#} the {node3_type#} {node3_name#}.""", + """The {node2_type#} {node2_protein_names#} is targeted by {SMILES#|node1_name#}. The {node2_type#} {node2_protein_names#} {rel2_type#} {node3_name#}.""", """User: {#Can you give me|Can you come up with!} {#an|one!} example for a protein that binds the {node1_type#} {SMILES#|node1_name#}? Assistant: The {node1_type#} {SMILES#|node1_name#} {rel1_type#} for example the {node2_type#} {node2_protein_names#}. User: Can you tell me a {node3_type#} that {rel2_type#} {node2_type#} {node2_protein_names#}? -Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node2_type#} {node2_name#} {rel2_type#} {node3_type#} {node3_name#}.""", # noqa E501 +Assistant: {#Yes|Of course|Yes, of course|Sure!}, the {node2_type#} {node2_name#} {rel2_type#} {node3_type#} {node3_name#}.""", ], "chembl33_preprocessed_filtered_bioactivity_dataset_w_fullprotnames_smiles": [ - "The {#molecule with the |!}{SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} a {#bioaffinity|affinity!} for {#the protein |!}{protein_name#} with a {standard_type#} {#value |!}of {standard_value#} {standard_units#}.", # noqa E501 + "The {#molecule with the |!}{SMILES__description} {#representation of |!}{SMILES#} {#shows|exhibits|displays!} a {#bioaffinity|affinity!} for {#the protein |!}{protein_name#} with a {standard_type#} {#value |!}of {standard_value#} {standard_units#}.", # Instruction tuning text templates """Task: Please {#derive|estimate|approximate!} {#the bioaffinity|the affinity!} of a {#molecule to a protein|protein to a molecule!}. Protein{# name|!}: {protein_name#} {#Molecule |!}{SMILES__description}: {SMILES#} Constraint{#s|!}: The {#resulting|derived|calculated!} {standard_type#} {#value |!}should be in {standard_units#}. Even if you are {#uncertain|not sure!}, you must {#derive|estimate|come up with!} a {standard_type#} {#value |!}without using any {#other|additional!} words. -Result: {standard_value#} {standard_units#}""", # noqa E501 +Result: {standard_value#} {standard_units#}""", """Task: Please {#create|generate!} {#a molecule |a !}{SMILES__description} that has a {#bioaffinity|affinity!} to {#the protein |!}{protein_name#} with a {standard_type#} {#value |!}of {standard_value#} {standard_units#}. -Result: {SMILES#}""", # noqa E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#give me|come up with!} {#one|an!} example of a protein that has a {#bioaffinity|affinity!} to the {SMILES__description} {SMILES#}? Assistant: {#For example, the protein |For example, |!}{protein_name#} has a {#bioaffinity|affinity!} to the {SMILES__description} {SMILES#}. User: Can you {#derive|estimate|approximate!} the {standard_type#} {#of this molecule|of this molecule for me|for me!}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, the {standard_type#} {#value |!}is {standard_value#} {standard_units#}.""", # noqa E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, the {standard_type#} {#value |!}is {standard_value#} {standard_units#}.""", """User: Can you {#give me|come up with!} {#one|an!} example of a protein that has a {#bioaffinity|affinity!} to the {SMILES__description} {SMILES#}? Assistant: {#The protein |!}{protein_name#} has for example a {#bioaffinity|affinity!} to the {SMILES__description} {SMILES#}. User: Can you {#derive|estimate|approximate!} the {standard_type#} {#of this molecule|of this molecule for me|for me!}? Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, the {standard_type#} {#value |!}is {standard_value#} {standard_units#}. User: Can you give {#me |!}{#additional|more!} {#information|details!} {#on|about!} the assay{# used| used for this estimation!}? Assistant: {#Sure|Yes|Of course!}, here you go: -{description#}""", # noqa E501 +{description#}""", # Benchmarking text templates, take super long to process, needs investigation """Task: Please {#derive|estimate|approximate!} {#the bioaffinity|the affinity!} of a {#molecule to a protein|protein to a molecule!}. Protein{# name|!}: {protein_name#} {#Molecule |!}{SMILES__description}: {SMILES#} Constraint{#s|!}: The {#resulting|derived|calculated!} {standard_type#} {#value |!}should be in {standard_units#}. Even if you are {#uncertain|not sure!}, you must {#derive|estimate|come up with!} a {standard_type#} {#value |!}without using any {#other|additional!} words. -Result:{standard_value#} {standard_units#}""", # noqa E501 +Result:{standard_value#} {standard_units#}""", """Task: Please {#create|generate!} a {#molecule |!}{SMILES__description} that has a {#bioaffinity|affinity!} to {#the protein |!}{protein_name#} with a {standard_type#} {#value |!}of {standard_value#} {standard_units#}. -Result:{SMILES#}""", # noqa E501 +Result:{SMILES#}""", """Task: Please answer the multiple choice question. Question: What is the {#the bioaffinity|the affinity!} of a {#molecule to a protein|protein to a molecule!}? Protein{# name|!}: {protein_name#} @@ -225,7 +225,7 @@ Constraint: The {#shown|listed!} {standard_type#} values {#below |!}are in {standard_units#}. Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%3-5%aA1} without using any other words. Options: {standard_value%} -Answer: {%multiple_choice_result}""", # noqa E501 +Answer: {%multiple_choice_result}""", """Task: Please answer the multiple choice question. Question: What is the {#the bioaffinity|the affinity!} of a {#molecule to a protein|protein to a molecule!}? Protein{# name|!}: {protein_name#} @@ -233,7 +233,7 @@ Constraint: The {#shown|listed!} {standard_type#} values {#below |!}are in {standard_units#}. Even if you are {#uncertain|not sure!}, you must pick either {%multiple_choice_enum%3-5%aA1} without using any other words. Options: {standard_value%} -Answer:{%multiple_choice_result}""", # noqa E501 +Answer:{%multiple_choice_result}""", ], } @@ -264,7 +264,7 @@ issn = {0305-1048}, doi = {10.1093/nar/gkab543}, url = {https://doi.org/10.1093/nar/gkab543}, -}""" # noqa E501 +}""" ], "templates": None, } @@ -367,7 +367,7 @@ def create_yamls(dirs: list): print(dataset_name) -def format_kg_df(df: pd.DataFrame) -> pd.DataFrame: # noqa: C901 +def format_kg_df(df: pd.DataFrame) -> pd.DataFrame: """Formats a pandas dataframe.""" df.drop_duplicates(inplace=True) @@ -525,7 +525,7 @@ def preprocess_kg_data(path_data_dir: str): # create separate dirs, move csv files there, and save cleaned data fns_data_raw = sorted(glob.glob(path_data_dir + "*.csv")) # KG walks data fns_data_raw += sorted(glob.glob(path_data_dir + "*.tsv")) # KG assay data - # fns_data_raw = "/fsx/proj-chemnlp/micpie/chemnlp/data/kg/chembl33_preprocessed_filtered_bioactivity_dataset_w_fullprotnames_smiles.tsv" # noqa E501 + # fns_data_raw = "/fsx/proj-chemnlp/micpie/chemnlp/data/kg/chembl33_preprocessed_filtered_bioactivity_dataset_w_fullprotnames_smiles.tsv" for fn in fns_data_raw: # subselect one path diff --git a/data/text_sampling/text_sampling.py b/data/text_sampling/text_sampling.py index 8d7399d7f..1b874cc34 100644 --- a/data/text_sampling/text_sampling.py +++ b/data/text_sampling/text_sampling.py @@ -14,56 +14,56 @@ DEFAULT_SIGNIFICANT_DIGITS = 3 standard_tabular_text_templates = [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} has a {TARGET__names__noun} of {TARGET#} {TARGET__units}.", # noqa: E501 - "Based on the {SMILES__description} {#representation of |!}{SMILES#}, the molecule has a {TARGET__names__noun} of {TARGET#} {TARGET__units}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is representing!} a molecule {#that has a|with a!} {TARGET__names__noun} of {TARGET#} {TARGET__units}.", # noqa: E501 + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} has a {TARGET__names__noun} of {TARGET#} {TARGET__units}.", + "Based on the {SMILES__description} {#representation of |!}{SMILES#}, the molecule has a {TARGET__names__noun} of {TARGET#} {TARGET__units}.", + "The {SMILES__description} {SMILES#} {#represents|is representing!} a molecule {#that has a|with a!} {TARGET__names__noun} of {TARGET#} {TARGET__units}.", "The molecule with the {SMILES__description} {SMILES#} has a {TARGET__names__noun} of {TARGET#} {TARGET__units}.", # Instruction tuning text templates """Task: Please predict a molecule feature based on the description. Description: Predict the {TARGET__names__noun} in {TARGET__units}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must answer with a numeric value in {TARGET__units} without using any {#other|additional!} words. -Result: {TARGET#} {TARGET__units}""", # noqa: E501 +Result: {TARGET#} {TARGET__units}""", """Task: Please predict a molecule feature based on the description. Description: Predict the {TARGET__names__noun} in {TARGET__units}. {SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must answer with a numeric value in {TARGET__units} without the unit and without using any {#other|additional!} words. -Result: {TARGET#}""", # noqa: E501 +Result: {TARGET#}""", """Task: Please {#give me|create|generate!} a {#molecule|chemical|compound!} with {SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} the {TARGET__names__noun} in {TARGET__units} of the molecule with the {SMILES__description} {SMILES#}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, this molecule has a {TARGET__names__noun} of {TARGET#} {TARGET__units}.""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, this molecule has a {TARGET__names__noun} of {TARGET#} {TARGET__units}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}. -Assistant: This is a molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}: {SMILES#}""", """User: I want to {#come up with|create|generate!} the {SMILES__description} of a {#molecule|chemical|chemical compound!}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should have a {TARGET__names__noun} of {TARGET#} {TARGET__units}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} represents a molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} represents a molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {SMILES__description} of a {#molecule|chemical|chemical structure!}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should have a {TARGET__names__noun} of {TARGET#} {TARGET__units}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} represents a molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} represents a molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}: {SMILES#}""", # Benchmarking text templates - "The {TARGET__names__noun} of the molecule with the {SMILES__description} {SMILES#} is:{TARGET#} {TARGET__units}", # noqa: E501 - "The {TARGET__names__noun} of the {SMILES__description} {SMILES#} is:{TARGET#} {TARGET__units}", # noqa: E501 - "The {TARGET__names__noun} of the molecule {SMILES__description} {SMILES#} is:{TARGET#} {TARGET__units}", # noqa: E501 + "The {TARGET__names__noun} of the molecule with the {SMILES__description} {SMILES#} is:{TARGET#} {TARGET__units}", + "The {TARGET__names__noun} of the {SMILES__description} {SMILES#} is:{TARGET#} {TARGET__units}", + "The {TARGET__names__noun} of the molecule {SMILES__description} {SMILES#} is:{TARGET#} {TARGET__units}", """Task: Please predict a molecule feature based on the description. Description: Predict the {TARGET__names__noun} in {TARGET__units} of a molecule. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must answer with a numeric value in {TARGET__units} without using any {#other|additional!} words. -Result:{TARGET#} {TARGET__units}""", # noqa: E501 +Result:{TARGET#} {TARGET__units}""", """Task: Please predict a molecule feature based on the description. Description: Predict the {TARGET__names__noun} in {TARGET__units} of a molecule. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must answer with a numeric value in {TARGET__units} without the unit and without using any {#other|additional!} words. -Result:{TARGET#}""", # noqa: E501 +Result:{TARGET#}""", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", ] @@ -335,7 +335,7 @@ def __repr__(self): def insert(self, data: dict) -> str: """Inserts the data and checks before if we got all the data for the present input_variables. More input_variables in data doesn't matter.""" - assert all(x in data.keys() for x in self.input_variables) + assert all(x in data for x in self.input_variables) template = self.template for k in data: if k not in self.input_variables: @@ -808,7 +808,7 @@ def get_sample_dict(self, sample: pd.Series, template: str): # uncomment below to append correct_choice_idx with the symbols prefix and suffix # multiple_choice_result = f"{rnd_symbol_prefix}{symbols[correct_choice_idx]}{rnd_symbol_suffix}" # uncomment below to append correct_choice to the answer after the correct choice symbol - # multiple_choice_result = f"{rnd_symbol_prefix}{symbols[correct_choice_idx]}{rnd_symbol_suffix} {correct_choice}" # noqa: E501 + # multiple_choice_result = f"{rnd_symbol_prefix}{symbols[correct_choice_idx]}{rnd_symbol_suffix} {correct_choice}" # else: # uncomment to include setup w/o symbols # if random.random() > 0.5: @@ -954,7 +954,7 @@ def apply_sampling( self.df = self.df_orig print(self.df[target_to_balance].value_counts()) # else: - # assert template_idx is None and class_balanced is True, "class_balanced sampling is only supported with template_idx." # noqa: E501 + # assert template_idx is None and class_balanced is True, "class_balanced sampling is only supported with template_idx." self.df["sample"] = self.df.apply( lambda sample: self.sample(sample, template_idx), axis=1 diff --git a/data/train_test_split.py b/data/train_test_split.py index 12f2090d9..1133cf9fb 100644 --- a/data/train_test_split.py +++ b/data/train_test_split.py @@ -472,7 +472,7 @@ def as_sequence_split( val = all_as_sequence[train_size : train_size + val_size] test = all_as_sequence[train_size + val_size :] print( - f"In total, there are {len(all_as_sequence)} AS_SEQUENCEs. Split sizes: {len(train)} train, {len(val)} valid, {len(test)} test." # noqa: E501 + f"In total, there are {len(all_as_sequence)} AS_SEQUENCEs. Split sizes: {len(train)} train, {len(val)} valid, {len(test)} test." ) with open("val_as_sequences.txt", "w") as f: @@ -641,7 +641,7 @@ def assign_splits( if ( yaml_file_has_column_of_type(file, "SMILES") and not yaml_file_has_column_of_type(file, "AS_SEQUENCE") - ) # noqa: E501 + ) ] # we filter those out that are in the to_scaffold_split list not_scaffold_split_yaml_files = [ @@ -711,7 +711,7 @@ def split_and_save(file, ddf): # split_counts = ddf["split"].value_counts().compute() # print( - # f"Dataset {file} has {len(ddf)} datapoints. Split sizes: {split_counts['train']} train, {split_counts['valid']} valid, {split_counts['test']} test." # noqa: E501 + # f"Dataset {file} has {len(ddf)} datapoints. Split sizes: {split_counts['train']} train, {split_counts['valid']} valid, {split_counts['test']} test." # ) # we then write the new data_clean.csv file @@ -876,10 +876,10 @@ def scaffold_split( # to ensure overall scaffold splitting does not distort train/val/test split sizes for each dataset print( - f"Dataset {file} has {len(df)} datapoints. Split sizes: {len(df[df['split'] == 'train'])} train, {len(df[df['split'] == 'valid'])} valid, {len(df[df['split'] == 'test'])} test." # noqa: E501 + f"Dataset {file} has {len(df)} datapoints. Split sizes: {len(df[df['split'] == 'train'])} train, {len(df[df['split'] == 'valid'])} valid, {len(df[df['split'] == 'test'])} test." ) print( - f"Dataset {file} has {len(df)} datapoints. Split fractions: {len(df[df['split'] == 'train']) / len(df)} train, {len(df[df['split'] == 'valid']) / len(df)} valid, {len(df[df['split'] == 'test']) / len(df)} test." # noqa: E501 + f"Dataset {file} has {len(df)} datapoints. Split fractions: {len(df[df['split'] == 'train']) / len(df)} train, {len(df[df['split'] == 'valid']) / len(df)} valid, {len(df[df['split'] == 'test']) / len(df)} test." ) if override: # write the new data_clean.csv file diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 3d4fec76e..eebc08964 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -1,5 +1,23 @@ # Contributing to ChemNLP + + +______________________________________________________________________ + +**Table of Contents** + +- [Getting Started](#getting-started) +- [Implementing a Dataset](#implementing-a-dataset) + - [meta.yaml Structure](#metayaml-structure) + - [transform.py Guidelines](#transformpy-guidelines) +- [Text Templates](#text-templates) +- [Testing Your Contribution](#testing-your-contribution) +- [Submitting Your Contribution](#submitting-your-contribution) + +______________________________________________________________________ + + + Thank you for your interest in contributing to ChemNLP! There are many ways to contribute, including implementing datasets, improving code, and enhancing documentation. ## Getting Started diff --git a/docs/api/meta_yaml_augmentor.md b/docs/api/meta_yaml_augmentor.md index 0e8328295..8e5470e12 100644 --- a/docs/api/meta_yaml_augmentor.md +++ b/docs/api/meta_yaml_augmentor.md @@ -1,5 +1,25 @@ # Meta YAML Augmenter + + +______________________________________________________________________ + +**Table of Contents** + +- [Overview](#overview) +- [generate_augmented_meta_yaml](#generate_augmented_meta_yaml) +- [CLI Interface](#cli-interface) + - [Usage](#usage) + - [Arguments](#arguments) + - [Example](#example) +- [Augmentation Process](#augmentation-process) +- [Notes](#notes) +- [Example Usage in Python](#example-usage-in-python) + +______________________________________________________________________ + + + ## Overview The Meta YAML Augmenter is a tool designed to enhance existing `meta.yaml` files for chemical datasets. It uses Large Language Models (LLMs) to generate additional templates and improve the metadata structure, particularly focusing on advanced sampling methods and template formats. diff --git a/docs/api/meta_yaml_generator.md b/docs/api/meta_yaml_generator.md index 09c3f651e..bcd24e1e8 100644 --- a/docs/api/meta_yaml_generator.md +++ b/docs/api/meta_yaml_generator.md @@ -1,5 +1,19 @@ # Meta YAML Generator + + +______________________________________________________________________ + +**Table of Contents** + +- [Overview](#overview) +- [`generate_meta_yaml`](#generate_meta_yaml) +- [Usage Example](#usage-example) + +______________________________________________________________________ + + + ## Overview The Meta YAML Generator is a tool designed to automatically create a `meta.yaml` file for chemical datasets using Large Language Models (LLMs). It analyzes the structure of a given DataFrame and generates a comprehensive metadata file, including advanced sampling methods and template formats. diff --git a/docs/api/sampler.md b/docs/api/sampler.md index 6e073916a..e6287413d 100644 --- a/docs/api/sampler.md +++ b/docs/api/sampler.md @@ -1,5 +1,28 @@ # Sampler Module + + +______________________________________________________________________ + +**Table of Contents** + +- [Overview](#overview) +- [TemplateSampler](#templatesampler) + - [Class: TemplateSampler](#class-templatesampler) + - [Initialization](#initialization) + - [Configuration Options](#configuration-options) + - [Main Methods](#main-methods) + - [`sample`](#sample) + - [`enable_class_balancing`](#enable_class_balancing) + - [`disable_class_balancing`](#disable_class_balancing) + - [Identifier Wrapping](#identifier-wrapping) + - [Usage Examples](#usage-examples) +- [Notes](#notes) + +______________________________________________________________________ + + + ## Overview The `sampler` module provides functionality for generating text samples based on templates and data. It is primarily used for creating datasets for natural language processing tasks in chemistry and related fields. The main class in this module is `TemplateSampler`, which allows for flexible text generation with support for multiple choice questions, class balancing, and identifier wrapping. diff --git a/docs/api/sampler_cli.md b/docs/api/sampler_cli.md index 0e165565d..e0bcb1cbe 100644 --- a/docs/api/sampler_cli.md +++ b/docs/api/sampler_cli.md @@ -1,5 +1,31 @@ # Sampler CLI + + +______________________________________________________________________ + +**Table of Contents** + +- [Overview](#overview) +- [Usage](#usage) + - [Arguments](#arguments) + - [Options](#options) +- [Detailed Option Descriptions](#detailed-option-descriptions) + - [`chunksize`](#chunksize) + - [`class_balanced`](#class_balanced) + - [`benchmarking`](#benchmarking) + - [`multiple_choice`](#multiple_choice) + - [`additional_templates`](#additional_templates) + - [`use_standard_templates`](#use_standard_templates) + - [`wrap_identifiers`](#wrap_identifiers) +- [Examples](#examples) +- [Notes](#notes) +- [Troubleshooting](#troubleshooting) + +______________________________________________________________________ + + + ## Overview The Sampler CLI is a command-line interface tool designed to process chemical datasets using the `TemplateSampler`. It allows for flexible text generation based on templates, with support for various sampling scenarios including class balancing, benchmarking, and multiple-choice questions. diff --git a/experiments/README.md b/experiments/README.md index 578f32415..c1a0673ce 100644 --- a/experiments/README.md +++ b/experiments/README.md @@ -1,5 +1,18 @@ # Working with the Stability cluster + + +______________________________________________________________________ + +**Table of Contents** + +- [GPT-Neox](#gpt-neox) +- [Hugging Face](#hugging-face) + +______________________________________________________________________ + + + We currently run our large scale experiments on the Stability AI HPC cluster. This subdirectory features a few helpful scripts that can help you get up and running on the cluster. diff --git a/experiments/ablations/continued_pretrain.py b/experiments/ablations/continued_pretrain.py index 730453b95..c993716fb 100644 --- a/experiments/ablations/continued_pretrain.py +++ b/experiments/ablations/continued_pretrain.py @@ -1,12 +1,16 @@ -from unsloth import FastLanguageModel +from typing import List, Optional + +import fire import torch -from unsloth import add_new_tokens -from typing import Optional, List -from unsloth import is_bfloat16_supported -from unsloth import UnslothTrainer, UnslothTrainingArguments import wandb from datasets import load_dataset -import fire +from unsloth import ( + FastLanguageModel, + UnslothTrainer, + UnslothTrainingArguments, + add_new_tokens, + is_bfloat16_supported, +) def load_model( @@ -57,7 +61,13 @@ def load_model( def train( - model, tokenizer, dataset, run_name: str, batch_size: int = 64, max_seq_length=2048, eval_dataset=None + model, + tokenizer, + dataset, + run_name: str, + batch_size: int = 64, + max_seq_length=2048, + eval_dataset=None, ): wandb.init(project="chemnlp-ablations", name=run_name) trainer = UnslothTrainer( @@ -83,8 +93,8 @@ def train( lr_scheduler_type="linear", seed=3407, output_dir=f"outputs_{run_name}", - eval_strategy = 'steps' if eval_dataset is not None else 'no', - eval_steps = 10_000 if eval_dataset is not None else None + eval_strategy="steps" if eval_dataset is not None else "no", + eval_steps=10_000 if eval_dataset is not None else None, ), ) @@ -138,9 +148,18 @@ def run( ) dataset = create_dataset(tokenizer, data_files) - eval_dataset = create_dataset(tokenizer, eval_data_files) if eval_data_files else None + eval_dataset = ( + create_dataset(tokenizer, eval_data_files) if eval_data_files else None + ) - train(model, tokenizer, dataset, run_name, batch_size=batch_size, eval_dataset=eval_dataset) + train( + model, + tokenizer, + dataset, + run_name, + batch_size=batch_size, + eval_dataset=eval_dataset, + ) if __name__ == "__main__": diff --git a/experiments/configs/data_configs/hf_data.yml b/experiments/configs/data_configs/hf_data.yml index c3fec721e..64d71ab4e 100644 --- a/experiments/configs/data_configs/hf_data.yml +++ b/experiments/configs/data_configs/hf_data.yml @@ -1,7 +1,7 @@ model_name: "EleutherAI/pythia-1b" context_length: 2048 dataset_name: "EleutherAI/pile" -dataset_args: {"name": "pubmed", "split": "train"} +dataset_args: { "name": "pubmed", "split": "train" } batch_size: 1 string_key: "text" save_path: "/fsx/proj-chemnlp/data/example_tokenised" diff --git a/experiments/data/prepare_gptneox_chemrxiv.py b/experiments/data/prepare_gptneox_chemrxiv.py index fc25c3d6b..1fb65016a 100644 --- a/experiments/data/prepare_gptneox_chemrxiv.py +++ b/experiments/data/prepare_gptneox_chemrxiv.py @@ -39,13 +39,11 @@ # execute gpt-neox processing gpt_tool_path = f"{args.gptneox_dir}/tools/preprocess_data.py" - os.system( - f""" + os.system(f""" python {gpt_tool_path} --input {data_path} --output-prefix {save_path}/data --vocab /fsx/pile/20B_tokenizer.json --dataset-impl mmap --tokenizer-type HFTokenizer --append-eod - """ - ) + """) diff --git a/experiments/data/split_data.py b/experiments/data/split_data.py index 00d4d4567..303b1bd10 100644 --- a/experiments/data/split_data.py +++ b/experiments/data/split_data.py @@ -22,7 +22,7 @@ print("loadinggg ...") ds = datasets.load_dataset( "json", - **{"data_files": {"train": args.data_path}, "split": "train"}, + data_files={"train": args.data_path}, split="train", num_proc=os.cpu_count(), keep_in_memory=True, ) diff --git a/experiments/scripts/run_tune.py b/experiments/scripts/run_tune.py index ec68a0ea8..0955cc8c0 100644 --- a/experiments/scripts/run_tune.py +++ b/experiments/scripts/run_tune.py @@ -14,6 +14,7 @@ import torch import transformers import wandb +from chemnlp.trainer import LLcheMTrainer from peft import PromptTuningConfig, PromptTuningInit, TaskType, get_peft_model from transformers import ( AutoTokenizer, @@ -22,7 +23,6 @@ ) from chemnlp.data_val.config import TrainPipelineConfig -from chemnlp.trainer import LLcheMTrainer from chemnlp.utils import ( collect_cpu_memory, collect_gpu_memory, diff --git a/src/chemnlp/data/constants.py b/src/chemnlp/data/constants.py index 1014b2369..5a4fdaec9 100644 --- a/src/chemnlp/data/constants.py +++ b/src/chemnlp/data/constants.py @@ -2,46 +2,46 @@ STANDARD_TABULAR_TEXT_TEMPLATES = [ - "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} has a {TARGET__names__noun} of {TARGET#} {TARGET__units}.", # noqa: E501 - "Based on the {SMILES__description} {#representation of |!}{SMILES#}, the molecule has a {TARGET__names__noun} of {TARGET#} {TARGET__units}.", # noqa: E501 - "The {SMILES__description} {SMILES#} {#represents|is representing!} a molecule {#that has a|with a!} {TARGET__names__noun} of {TARGET#} {TARGET__units}.", # noqa: E501 + "The molecule with the {SMILES__description} {#representation of |!}{SMILES#} has a {TARGET__names__noun} of {TARGET#} {TARGET__units}.", + "Based on the {SMILES__description} {#representation of |!}{SMILES#}, the molecule has a {TARGET__names__noun} of {TARGET#} {TARGET__units}.", + "The {SMILES__description} {SMILES#} {#represents|is representing!} a molecule {#that has a|with a!} {TARGET__names__noun} of {TARGET#} {TARGET__units}.", "The molecule with the {SMILES__description} {SMILES#} has a {TARGET__names__noun} of {TARGET#} {TARGET__units}.", # Instruction tuning text templates """Task: Please predict a molecule feature based on the description. Description: Predict the {TARGET__names__noun} in {TARGET__units}. {#Molecule |!}{SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must answer with a numeric value in {TARGET__units} without using any {#other|additional!} words. -Result: {TARGET#} {TARGET__units}""", # noqa: E501 +Result: {TARGET#} {TARGET__units}""", """Task: Please predict a molecule feature based on the description. Description: The {TARGET__names__noun} in {TARGET__units}. {SMILES__description}: {SMILES#} Constraint: Even if you are {#uncertain|not sure!}, you must answer with a numeric value in {TARGET__units} without the unit and without using any {#other|additional!} words. -Result: {TARGET#}""", # noqa: E501 +Result: {TARGET#}""", """Task: Please {#give me|create|generate!} a {#molecule|chemical|compound!} with {SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}. -Result: {SMILES#}""", # noqa: E501 +Result: {SMILES#}""", # Conversational text templates """User: Can you {#tell me|derive|estimate!} the {TARGET__names__noun} in {TARGET__units} of the molecule with the {SMILES__description} {SMILES#}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, this molecule has a {TARGET__names__noun} of {TARGET#} {TARGET__units}.""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, this molecule has a {TARGET__names__noun} of {TARGET#} {TARGET__units}.""", """User: Can you {#give me|create|generate!} the {SMILES__description} of a molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}? -Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", # noqa: E501 +Assistant: {#Yes|Of course|Sure|Yes, I'm happy to help!}, here you go: {SMILES#}""", """User: I'm {#searching|looking!} for the {SMILES__description} of a molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}. -Assistant: This is a molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}: {SMILES#}""", # noqa: E501 +Assistant: This is a molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}: {SMILES#}""", """User: I want to {#come up with|create|generate!} the {SMILES__description} of a {#molecule|chemical|chemical compound!}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should I consider any {#constraints|specific points!} for the {#generation|creation!}? User: Yes, please. The molecule should have a {TARGET__names__noun} of {TARGET#} {TARGET__units}. -Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} represents a molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}: {SMILES#}""", # noqa: E501 +Assistant: {#Ok|Got it!},{# here you go,|!} this {SMILES__description} represents a molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}: {SMILES#}""", """User: I want to {#come up with|create|generate!} a {SMILES__description} of a {#molecule|chemical|chemical structure!}. Assistant: {#This sounds very exciting. |This sounds very interesting. !}Should it be a special {#molecule|one!}? User: Yes, the molecule should have a {TARGET__names__noun} of {TARGET#} {TARGET__units}. -Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} represents a molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}: {SMILES#}""", # noqa: E501 +Assistant: {#Understood|Got it|Ok!}, this {SMILES__description} represents a molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}: {SMILES#}""", # Benchmarking text templates - "The {TARGET__names__noun} of the molecule with the {SMILES__description} {SMILES#} is:{TARGET#} {TARGET__units}", # noqa: E501 - "The {TARGET__names__noun} of the {SMILES__description} {SMILES#} is:{TARGET#} {TARGET__units}", # noqa: E501 - "The {TARGET__names__noun} of the molecule {SMILES__description} {SMILES#} is:{TARGET#} {TARGET__units}", # noqa: E501 + "The {TARGET__names__noun} of the molecule with the {SMILES__description} {SMILES#} is:{TARGET#} {TARGET__units}", + "The {TARGET__names__noun} of the {SMILES__description} {SMILES#} is:{TARGET#} {TARGET__units}", + "The {TARGET__names__noun} of the molecule {SMILES__description} {SMILES#} is:{TARGET#} {TARGET__units}", """Task: Please {#give me|create|generate!} a {#molecule |!}{SMILES__description} based on the {#text |!}description{# below|!}. Description: A molecule that has a {TARGET__names__noun} of {TARGET#} {TARGET__units}. -Result:{SMILES#}""", # noqa: E501 +Result:{SMILES#}""", ] diff --git a/src/chemnlp/data/meta_yaml_augmentor.py b/src/chemnlp/data/meta_yaml_augmentor.py index cdbbf0f2e..6793843f3 100644 --- a/src/chemnlp/data/meta_yaml_augmentor.py +++ b/src/chemnlp/data/meta_yaml_augmentor.py @@ -1,6 +1,6 @@ -from litellm import completion -import yaml import fire +import yaml +from litellm import completion CONSTANT_PROMPT_FOR_TEMPLATE_AUGMENTATION = """ diff --git a/src/chemnlp/data/meta_yaml_generator.py b/src/chemnlp/data/meta_yaml_generator.py index 66b2b389d..97e3eb3e7 100644 --- a/src/chemnlp/data/meta_yaml_generator.py +++ b/src/chemnlp/data/meta_yaml_generator.py @@ -1,8 +1,9 @@ +from typing import Any, Dict + +import fire import pandas as pd import yaml -from typing import Dict, Any from litellm import completion -import fire CONSTANT_PROMPT_FOR_META_GENERATION = """ diff --git a/src/chemnlp/data/sampler.py b/src/chemnlp/data/sampler.py index 539733587..a3a8f31f0 100644 --- a/src/chemnlp/data/sampler.py +++ b/src/chemnlp/data/sampler.py @@ -1,20 +1,21 @@ -from chemnlp.data.constants import DEFAULT_SIGNIFICANT_DIGITS -import pandas as pd -import random +import json import math -from typing import List, Dict, Union, Callable, Optional, Tuple, Any +import os +import random import re +from functools import cache, partial from string import ascii_lowercase, ascii_uppercase -from chemnlp.data.random_variable import RandomVariable -from functools import partial -from functools import lru_cache -from chemnlp.data_val.model import IdentifierEnum -import os +from typing import Any, Callable, Dict, List, Optional, Tuple, Union + +import pandas as pd import yaml -import json from loguru import logger from tqdm import tqdm +from chemnlp.data.constants import DEFAULT_SIGNIFICANT_DIGITS +from chemnlp.data.random_variable import RandomVariable +from chemnlp.data_val.model import IdentifierEnum + class TemplateSampler: """ @@ -48,20 +49,20 @@ class TemplateSampler: """ __slots__ = ( + "additional_targets", + "balance_column", + "benchmarking_templates", + "class_balanced", + "column_datafield_sampler", + "config", "df", + "df_orig", "meta", - "config", - "path_data_dir", - "column_datafield_sampler", - "benchmarking_templates", - "multiple_choice_benchmarking_templates", "multiple_choice_benchmarking_format", + "multiple_choice_benchmarking_templates", + "path_data_dir", "templates", - "additional_targets", - "df_orig", - "class_balanced", "wrap_identifiers", - "balance_column", ) def __init__( @@ -567,7 +568,7 @@ def _get_symbol_affixes(self, symbol: str) -> Tuple[str, str]: def _get_input_variables_from_template(self, template: str) -> List[str]: return re.findall(r"\{([^}]+)\}", template) - @lru_cache(maxsize=None) + @cache def _get_random_text_identifiers_and_targets(self) -> dict: """Cached version of get_random_text_identifiers_and_targets""" rnd_texts = {} @@ -721,10 +722,8 @@ def _create_config(self, output_dir: str) -> Dict[str, Any]: Dict[str, Any]: A dictionary containing the configuration. """ if self.path_data_dir is None: - raise ValueError( - "The path to the data directory is not set. \ - For the export to work, the path must be set." - ) + raise ValueError("The path to the data directory is not set. \ + For the export to work, the path must be set.") group_name = os.path.basename(os.path.dirname(self.path_data_dir)) task_name = os.path.basename(self.path_data_dir) diff --git a/src/chemnlp/data/sampler_cli.py b/src/chemnlp/data/sampler_cli.py index 3beaffdbc..769e989e3 100644 --- a/src/chemnlp/data/sampler_cli.py +++ b/src/chemnlp/data/sampler_cli.py @@ -1,18 +1,20 @@ import os -import fire -import pandas as pd import random import warnings -from typing import Optional, List -from chemnlp.data.sampler import TemplateSampler -from chemnlp.data.utils import load_yaml +from pathlib import Path +from typing import List, Optional + +import fire +import pandas as pd +from loguru import logger + from chemnlp.data.constants import ( - STANDARD_TABULAR_TEXT_TEMPLATES, - EXCLUDE_FROM_STANDARD_TABULAR_TEXT_TEMPLATES, DEFAULT_SIGNIFICANT_DIGITS, + EXCLUDE_FROM_STANDARD_TABULAR_TEXT_TEMPLATES, + STANDARD_TABULAR_TEXT_TEMPLATES, ) -from loguru import logger -from pathlib import Path +from chemnlp.data.sampler import TemplateSampler +from chemnlp.data.utils import load_yaml def determine_balance_column(meta: dict, template: str) -> Optional[str]: diff --git a/src/chemnlp/data/split.py b/src/chemnlp/data/split.py index 05ac2f76c..df9affd53 100644 --- a/src/chemnlp/data/split.py +++ b/src/chemnlp/data/split.py @@ -1,6 +1,7 @@ from collections import defaultdict +from collections.abc import Iterable from random import Random -from typing import Dict, Iterable, List +from typing import Dict, List import pandas as pd from rdkit import Chem diff --git a/src/chemnlp/data/utils.py b/src/chemnlp/data/utils.py index 06c408544..05921b7fc 100644 --- a/src/chemnlp/data/utils.py +++ b/src/chemnlp/data/utils.py @@ -1,14 +1,10 @@ -from typing import List - -import yaml -from typing import Any +from pathlib import Path +from typing import Any, List import fire import numpy as np import pandas as pd - - -from pathlib import Path +import yaml def get_all_datasets(root_dir): @@ -38,8 +34,7 @@ def concatenate_jsonl_files(root_dir, output_file, datasets=None, file_type="tra jsonl_file = template_dir / f"{file_type}.jsonl" if jsonl_file.is_file(): with open(jsonl_file, "r") as infile: - for line in infile: - outfile.write(line) + outfile.writelines(infile) print(f"Concatenated {file_type}.jsonl files have been saved to {output_file}") diff --git a/src/chemnlp/data_val/validate.py b/src/chemnlp/data_val/validate.py index 8acd0f7b0..bcd5575b3 100644 --- a/src/chemnlp/data_val/validate.py +++ b/src/chemnlp/data_val/validate.py @@ -11,7 +11,7 @@ def validate_meta(file): try: with open(file, "r") as f: - _model = Dataset.parse_raw(f.read()) # noqa: F841 + _model = Dataset.parse_raw(f.read()) except Exception as e: raise ValueError(f"Error parsing {file}: {e}") diff --git a/tests/data/test_sampler.py b/tests/data/test_sampler.py index 94cd58320..468ff6f21 100644 --- a/tests/data/test_sampler.py +++ b/tests/data/test_sampler.py @@ -1,8 +1,10 @@ -import pytest +import re + +import numpy as np import pandas as pd +import pytest + from chemnlp.data.sampler import TemplateSampler -import numpy as np -import re @pytest.fixture diff --git a/tests/data/test_sampler_cli.py b/tests/data/test_sampler_cli.py index f5df4b1a7..076f258e6 100644 --- a/tests/data/test_sampler_cli.py +++ b/tests/data/test_sampler_cli.py @@ -1,9 +1,11 @@ -import pytest +import json + import pandas as pd +import pytest import yaml -import json -from chemnlp.data.sampler_cli import process_dataset + from chemnlp.data.constants import STANDARD_TABULAR_TEXT_TEMPLATES +from chemnlp.data.sampler_cli import process_dataset @pytest.fixture diff --git a/tests/test_ner.py b/tests/test_ner.py index 09b1a65be..af102d46f 100644 --- a/tests/test_ner.py +++ b/tests/test_ner.py @@ -59,5 +59,5 @@ def test_join_punctuation(): print(sentence) assert ( sentence - == "This is a list of tokens with 2.5, and 3 numbers intact semi-colon separated words with decimal numbers split at dots. This is a comma, and a dot (test)." # noqa + == "This is a list of tokens with 2.5, and 3 numbers intact semi-colon separated words with decimal numbers split at dots. This is a comma, and a dot (test)." )