Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add mol2svg #469

Merged
merged 4 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions data/tabular/mol2svg/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: chem_caption_smarts
description: |-
This dataset contains SVG images of molecules, including some with substructures
highlighted.
targets:
- id: completion
type: text
description: completion
identifiers:
- id: prompt
type: text
description: prompt
- id: smiles
type: SMILES
description: SMILES
license: CC BY 4.0
num_points: 16019
links:
- url: https://github.com/lamalab-org/chem-caption
description: Original codebase used to generate this dataset
templates:
- |-
{prompt#}
{completion#}
13 changes: 13 additions & 0 deletions data/tabular/mol2svg/transform.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from datasets import load_dataset


def preprocess():
dataset = load_dataset("kjappelbaum/chemnlp-mol-svg")
df = dataset["train"].to_pandas()
df.dropna(inplace=True)
print(len(df))
df.to_csv("data_clean.csv", index=False)


if __name__ == "__main__":
preprocess()