Views
No views yet
(=O)N(), matching the APE
behaviour described in Leon et al. — token boundaries are not guaranteed to be
balanced sub-structures.| special token | id |
|---|---|
<s> (BOS) | 0 |
<pad> | 1 |
</s> (EOS) | 2 |
<unk> | 3 |
<mask> | 4 |
1from transformers import AutoTokenizer
2
3tokenizer = AutoTokenizer.from_pretrained(
4 "HauserGroup/ApeTokenizer-SMILES",
5 trust_remote_code=True,
6 use_fast=False,
7)
8
9# A canonical SMILES — here aspirin.
10smiles = "CC(=O)Oc1ccccc1C(=O)O"
11
12tokens = tokenizer.tokenize(smiles)
13print(tokens)
14# ['CC(=O)', 'Oc1cc', 'ccc1', 'C(=O)O']
15
16inputs = tokenizer(smiles, return_tensors="pt")
17print(inputs["input_ids"])1@article{madsen_modernmolbert,
2 title = {ModernMolBERT: A ModernBERT Encoder Family for SELFIES Molecular Language Modeling},
3 author = {Madsen, Jakob S. and Angelucci, Sara and Hauser, Alexander S.},
4 year = {2026}
5}