Skip to content

Commit 05b0bf8

Browse files
authored
Add files via upload
1 parent 127db4f commit 05b0bf8

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

structure_mol_example_python.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from rdkit import Chem
2+
from rdkit.Chem import Draw
3+
from drug_named_entity_recognition import find_drugs
4+
sentences = "I prescribed semaglutide"
5+
drugs = find_drugs(sentences.split(), is_include_structure=True)
6+
for drug in drugs:
7+
structure_mol = drug[0]["structure_mol"]
8+
break
9+
print (structure_mol)
10+
11+
mol = Chem.MolFromMolBlock(structure_mol)
12+
image = Draw.MolToImage(mol)
13+
image.show()

0 commit comments

Comments
 (0)