Code for the "Bridging the Gap Between Molecule and Textual Descriptions via Substructure-aware Alignment (EMNLP 2025 main)"
Python
21
23 commits
updated Dec 23, 2025
Bridging the Gap Between Molecule and Textual Descriptions via Substructure-aware Alignment
EMNLP 2025 Main Conference
MolBridge is a substructure-aware generative model designed to align molecular structures and textual descriptions.
We release checkpoints for bidirectional generation between molecule representations and natural language captions.
| Model | Description | Link |
|---|---|---|
| MolBridge | SMIELS + Text encoders | Google Drive |
| MolBridge-Gen-Base | Pre-traind with local alignment pairs | PhTae/MolBridge-Gen-Base |
| MolBridge-Gen-Base-C2S | Caption → SMILES generation | PhTae/MolBridge-Gen-Base-C2S |
| MolBridge-Gen-Base-S2C | SMILES → Caption generation | PhTae/MolBridge-Gen-Base-S2C |
All datasets for MolBridge and MolBridge-Gen can be found here: Google Drive.
For the CHEBI-20 dataset, please refer to the original MolT5 repository and documentation.
from transformers import AutoTokenizer, T5ForConditionalGeneration
tokenizer = AutoTokenizer.from_pretrained("laituan245/molt5-base", model_max_length=512)
model = T5ForConditionalGeneration.from_pretrained("PhTae/MolBridge-Gen-Base-C2S")
caption = "The molecule is a monoterpene that is bicyclo[2.2.1]heptane substituted by methyl groups at positions 1, 3 and 3. It is a monoterpene, a terpenoid fundamental parent and a carbobicyclic compound."
caption = "Provide a molecule based on this description: " + caption
token = tokenizer(caption, return_tensors="pt", padding="longest", truncation=True)
gen_results = model.generate(
input_ids=token["input_ids"],
attention_mask=token["attention_mask"],
num_beams=5,
max_new_tokens=512
)
from transformers import AutoTokenizer, T5ForConditionalGeneration
tokenizer = AutoTokenizer.from_pretrained("laituan245/molt5-base", model_max_length=512)
model = T5ForConditionalGeneration.from_pretrained("PhTae/MolBridge-Gen-Base-S2C")
canonicalized_smiles = "CC(=O)N[C@@H](CCCN=C(N)N)C(=O)[O-]"
canonicalized_smiles = "Provide a whole description of this molecule: " + canonicalized_smiles
token = tokenizer(canonicalized_smiles, return_tensors="pt", padding="longest", truncation=True)
gen_results = model.generate(
input_ids=token["input_ids"],
attention_mask=token["attention_mask"],
num_beams=5,
max_new_tokens=512
)
141 followers · starred Nov 2025
Code for the "Bridging the Gap Between Molecule and Textual Descriptions via Substructure-aware Alignment (EMNLP 2025 main)"
Python
21
23 commits
updated Dec 23, 2025
Bridging the Gap Between Molecule and Textual Descriptions via Substructure-aware Alignment
EMNLP 2025 Main Conference
MolBridge is a substructure-aware generative model designed to align molecular structures and textual descriptions.
We release checkpoints for bidirectional generation between molecule representations and natural language captions.
| Model | Description | Link |
|---|---|---|
| MolBridge | SMIELS + Text encoders | Google Drive |
| MolBridge-Gen-Base | Pre-traind with local alignment pairs | PhTae/MolBridge-Gen-Base |
| MolBridge-Gen-Base-C2S | Caption → SMILES generation | PhTae/MolBridge-Gen-Base-C2S |
| MolBridge-Gen-Base-S2C | SMILES → Caption generation | PhTae/MolBridge-Gen-Base-S2C |
All datasets for MolBridge and MolBridge-Gen can be found here: Google Drive.
For the CHEBI-20 dataset, please refer to the original MolT5 repository and documentation.
from transformers import AutoTokenizer, T5ForConditionalGeneration
tokenizer = AutoTokenizer.from_pretrained("laituan245/molt5-base", model_max_length=512)
model = T5ForConditionalGeneration.from_pretrained("PhTae/MolBridge-Gen-Base-C2S")
caption = "The molecule is a monoterpene that is bicyclo[2.2.1]heptane substituted by methyl groups at positions 1, 3 and 3. It is a monoterpene, a terpenoid fundamental parent and a carbobicyclic compound."
caption = "Provide a molecule based on this description: " + caption
token = tokenizer(caption, return_tensors="pt", padding="longest", truncation=True)
gen_results = model.generate(
input_ids=token["input_ids"],
attention_mask=token["attention_mask"],
num_beams=5,
max_new_tokens=512
)
from transformers import AutoTokenizer, T5ForConditionalGeneration
tokenizer = AutoTokenizer.from_pretrained("laituan245/molt5-base", model_max_length=512)
model = T5ForConditionalGeneration.from_pretrained("PhTae/MolBridge-Gen-Base-S2C")
canonicalized_smiles = "CC(=O)N[C@@H](CCCN=C(N)N)C(=O)[O-]"
canonicalized_smiles = "Provide a whole description of this molecule: " + canonicalized_smiles
token = tokenizer(canonicalized_smiles, return_tensors="pt", padding="longest", truncation=True)
gen_results = model.generate(
input_ids=token["input_ids"],
attention_mask=token["attention_mask"],
num_beams=5,
max_new_tokens=512
)
141 followers · starred Nov 2025