Views
No views yet
[!TIP] The MultiMolecule team has confirmed that the provided model and checkpoints are producing the same intermediate representations as the original implementation.
| Variants | Num Layers | Hidden Size | Num Heads | Intermediate Size | Num Parameters (M) | FLOPs (G) | MACs (G) | Max Num Tokens |
|---|---|---|---|---|---|---|---|---|
| splicebert | 6 | 512 | 16 | 2048 | 19.72 | 22.66 | 11.27 | 1024 |
| splicebert.510 | 19.45 | 22.56 | 11.22 | 510 | ||||
| splicebert-human.510 |
multimolecule library. You can install it using pip:pip install multimolecule1import multimolecule # you must import multimolecule to register models
2from transformers import pipeline
3
4predictor = pipeline("fill-mask", model="multimolecule/splicebert")
5output = predictor("gguc<mask>cucugguuagaccagaucugagccu")1from multimolecule import RnaTokenizer, SpliceBertModel
2
3
4tokenizer = RnaTokenizer.from_pretrained("multimolecule/splicebert")
5model = SpliceBertModel.from_pretrained("multimolecule/splicebert")
6
7text = "UAGCUUAUCAGACUGAUGUUG"
8input = tokenizer(text, return_tensors="pt")
9
10output = model(**input)[!NOTE] This model is not fine-tuned for any specific task. You will need to fine-tune the model on a downstream task to use it for sequence classification or regression.
1import torch
2from multimolecule import RnaTokenizer, SpliceBertForSequencePrediction
3
4
5tokenizer = RnaTokenizer.from_pretrained("multimolecule/splicebert")
6model = SpliceBertForSequencePrediction.from_pretrained("multimolecule/splicebert")
7
8text = "UAGCUUAUCAGACUGAUGUUG"
9input = tokenizer(text, return_tensors="pt")
10label = torch.tensor([1])
11
12output = model(**input, labels=label)[!NOTE] This model is not fine-tuned for any specific task. You will need to fine-tune the model on a downstream task to use it for token classification or regression.
1import torch
2from multimolecule import RnaTokenizer, SpliceBertForTokenPrediction
3
4
5tokenizer = RnaTokenizer.from_pretrained("multimolecule/splicebert")
6model = SpliceBertForTokenPrediction.from_pretrained("multimolecule/splicebert")
7
8text = "UAGCUUAUCAGACUGAUGUUG"
9input = tokenizer(text, return_tensors="pt")
10label = torch.randint(2, (len(text), ))
11
12output = model(**input, labels=label)[!NOTE] This model is not fine-tuned for any specific task. You will need to fine-tune the model on a downstream task to use it for contact classification or regression.
1import torch
2from multimolecule import RnaTokenizer, SpliceBertForContactPrediction
3
4
5tokenizer = RnaTokenizer.from_pretrained("multimolecule/splicebert")
6model = SpliceBertForContactPrediction.from_pretrained("multimolecule/splicebert")
7
8text = "UAGCUUAUCAGACUGAUGUUG"
9input = tokenizer(text, return_tensors="pt")
10label = torch.randint(2, (len(text), len(text)))
11
12output = model(**input, labels=label)RnaTokenizer][multimolecule.RnaTokenizer] will convert "T"s to "U"s for you, you may disable this behaviour by passing replace_T_with_U=False.<mask> for 80% of masked tokensmultimolecule/splicebert.510.multimolecule/splicebert-human.510.1@article {chen2023self,
2 author = {Chen, Ken and Zhou, Yue and Ding, Maolin and Wang, Yu and Ren, Zhixiang and Yang, Yuedong},
3 title = {Self-supervised learning on millions of pre-mRNA sequences improves sequence-based RNA splicing prediction},
4 elocation-id = {2023.01.31.526427},
5 year = {2023},
6 doi = {10.1101/2023.01.31.526427},
7 publisher = {Cold Spring Harbor Laboratory},
8 abstract = {RNA splicing is an important post-transcriptional process of gene expression in eukaryotic cells. Predicting RNA splicing from primary sequences can facilitate the interpretation of genomic variants. In this study, we developed a novel self-supervised pre-trained language model, SpliceBERT, to improve sequence-based RNA splicing prediction. Pre-training on pre-mRNA sequences from vertebrates enables SpliceBERT to capture evolutionary conservation information and characterize the unique property of splice sites. SpliceBERT also improves zero-shot prediction of variant effects on splicing by considering sequence context information, and achieves superior performance for predicting branchpoint in the human genome and splice sites across species. Our study highlighted the importance of pre-training genomic language models on a diverse range of species and suggested that pre-trained language models were promising for deciphering the sequence logic of RNA splicing.Competing Interest StatementThe authors have declared no competing interest.},
9 URL = {https://www.biorxiv.org/content/early/2023/05/09/2023.01.31.526427},
10 eprint = {https://www.biorxiv.org/content/early/2023/05/09/2023.01.31.526427.full.pdf},
11 journal = {bioRxiv}
12}[!NOTE] The artifacts distributed in this repository are part of the MultiMolecule project. If MultiMolecule supports your research, please cite the MultiMolecule project as follows:
1@software{chen_2024_12638419,
2 author = {Chen, Zhiyuan and Zhu, Sophia Y.},
3 title = {MultiMolecule},
4 doi = {10.5281/zenodo.12638419},
5 publisher = {Zenodo},
6 url = {https://doi.org/10.5281/zenodo.12638419},
7 year = 2024,
8 month = may,
9 day = 4
10}SPDX-License-Identifier: AGPL-3.0-or-later