olorenchemengine.external.HondaSTRep package#

Submodules#

olorenchemengine.external.HondaSTRep.main module#

class olorenchemengine.external.HondaSTRep.main.HondaSTRep#

Bases: BaseVecRepresentation

HondaSTRep is an implementation of the molecular representation provided by Honda et al. in SMILES Transformer: Pre-trained Molecular Fingerprint for Low Data Drug Discovery <https://arxiv.org/abs/1911.04738>.

olorenchemengine.external.HondaSTRep.operations module#

Code taken in part from https://github.com/DSPsleeporg/smiles-transformer under the following license:

MIT License

Copyright (c) 2019 Shion Honda

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Footer

class olorenchemengine.external.HondaSTRep.operations.TorchVocab(counter, max_size=None, min_freq=1, specials=['<pad>', '<oov>'], vectors=None, unk_init=None, vectors_cache=None)#

Bases: object

Property freqs:

collections.Counter, コーパス中の単語の出現頻度を保持するオブジェクト

Property stoi:

collections.defaultdict, string → id の対応を示す辞書

Property itos:

collections.defaultdict, id → string の対応を示す辞書

extend(v, sort=False)#
vocab_rerank()#
class olorenchemengine.external.HondaSTRep.operations.Vocab(counter, max_size=None, min_freq=1)#

Bases: TorchVocab

from_seq(seq, join=False, with_pad=False)#
static load_vocab(vocab_path: str) Vocab#
save_vocab(vocab_path)#
to_seq(sentece, seq_len, with_eos=False, with_sos=False) list#
class olorenchemengine.external.HondaSTRep.operations.WordVocab(texts, max_size=None, min_freq=1)#

Bases: Vocab

from_seq(seq, join=False, with_pad=False)#
static load_vocab(vocab_path: str)#
to_seq(sentence, seq_len=None, with_eos=False, with_sos=False, with_len=False)#
olorenchemengine.external.HondaSTRep.operations.split(sm)#

function: Split SMILES into words. Care for Cl, Br, Si, Se, Na etc. input: A SMILES output: A string with space between words

Module contents#