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

SMILES tokenizer ids #2

Open
elemets opened this issue Sep 23, 2020 · 1 comment
Open

SMILES tokenizer ids #2

elemets opened this issue Sep 23, 2020 · 1 comment

Comments

@elemets
Copy link

elemets commented Sep 23, 2020

Hi,

Thanks for this project, it looks like it could be really helpful. Sorry if this is a stupid question but I was wondering, once I've tokenized a set of SMILES using the pre-trained SMILES model how would I get the token ids?

Thanks
A

@lianghsun
Copy link

There is a way you can get the ID for each SMILES

test_spe_word = spe.tokenize(...)
for word in test_spe_word.split(' '):
    print(spe.bpe_codes[spe.bpe_codes_reverse[word]]) # output ID

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants