A python library for extracting molecular SMILES embeddings from language models pre-trained with various objectives and/or architectures.
Project description
SMILES Featurizers
Extract SMILES embeddings from language models pre-trained with various objectives architectures.
Getting Started
pip install smiles-featurizers
Model List
Our released models are listed as following. You can import these models by using the smiles-featurizers
package or using HuggingFace's Transformers.
Model | Type |
---|---|
shahrukhx01/smole-bert | Bert |
shahrukhx01/smole-bert-mtr | Bert |
shahrukhx01/smole-bart | Bart |
shahrukhx01/muv2x-simcse-smole-bart | Simcse |
shahrukhx01/siamese-smole-bert-muv-1x | SentenceTransformer |
Use SMILES Featurizers
Bert Featurizer
from smiles_featurizers import BertFeaturizer
## set device
use_gpu = True if torch.cuda.is_available() else False
featurizer = BertFeaturizer("shahrukhx01/smole-bert", use_gpu=use_gpu)
embeddings = featurizer.embed(["CCC(C)(C)Br"])
Bart (Encoder) Featurizer
from smiles_featurizers import BartFeaturizer
featurizer = BartFeaturizer("shahrukhx01/smole-bart")
embeddings = featurizer.embed(["CCC(C)(C)Br"], embedder="encoder")
Bart (Decoder) Featurizer
from smiles_featurizers import BartFeaturizer
featurizer = BartFeaturizer("shahrukhx01/smole-bart")
embeddings = featurizer.embed(["CCC(C)(C)Br"], embedder="decoder")
SimCSE Featurizer
from smiles_featurizers import SimcseFeaturizer
## set device
device = "cuda" if torch.cuda.is_available() else "cpu"
featurizer = SimcseFeaturizer("shahrukhx01/mv2x-simcse-smole-bert")
embeddings = featurizer.embed(["CCC(C)(C)Br"], device=device)
SentenceTransformer Featurizer
from smiles_featurizers import SentenceTransformersFeaturizer
## set device
device = "cuda" if torch.cuda.is_available() else "cpu"
featurizer = SentenceTransformersFeaturizer("shahrukhx01/siamese-smole-bert-muv-1x")
embeddings = featurizer.embed(["CCC(C)(C)Br"], device=device)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for smiles_featurizers-1.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ea8d26ba70f79521ffc782ce022c19440629ce01f795f09f89105e4b090db30 |
|
MD5 | e138dd368c2bd4894112cbca76cdcb73 |
|
BLAKE2b-256 | 1df153eb34296cb47dde78feb6902d12c0bc988408cf4af7edf9502c1cdec023 |