Downloads · 30 days
311
2% of all-time downloads
AIRI-Institute/gena-lm-bert-base
gena-lm-bert-base is a machine learning model from AIRI-Institute. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
GENA-LM is a Family of Open-Source Foundational Models for Long DNA Sequences.
Downloads · 30 days
311
2% of all-time downloads
All-time downloads
20.1K
Public
Repo size
1.1 GB
Likes
30
Public
Click a slice to open those files.
.bin543 MB · 100%
From the Hugging Face model README
GENA-LM is a Family of Open-Source Foundational Models for Long DNA Sequences.
GENA-LM models are transformer masked language models trained on human DNA sequence.
Differences between GENA-LM (gena-lm-bert-base) and DNABERT:
Source code and data: https://github.com/AIRI-Institute/GENA_LM
Paper: https://www.biorxiv.org/content/10.1101/2023.06.12.544594v1
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained('AIRI-Institute/gena-lm-bert-base')
model = AutoModel.from_pretrained('AIRI-Institute/gena-lm-bert-base', trust_remote_code=True)
Get model class from GENA-LM repository:
git clone https://github.com/AIRI-Institute/GENA_LM.git
from GENA_LM.src.gena_lm.modeling_bert import BertForSequenceClassification
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained('AIRI-Institute/gena-lm-bert-base')
model = BertForSequenceClassification.from_pretrained('AIRI-Institute/gena-lm-bert-base')
or you can just download modeling_bert.py and put it close to your code.
OR you can get model class from HuggingFace AutoModel:
from transformers import AutoTokenizer, AutoModel
model = AutoModel.from_pretrained('AIRI-Institute/gena-lm-bert-base', trust_remote_code=True)
gena_module_name = model.__class__.__module__
print(gena_module_name)
import importlib
# available class names:
# - BertModel, BertForPreTraining, BertForMaskedLM, BertForNextSentencePrediction,
# - BertForSequenceClassification, BertForMultipleChoice, BertForTokenClassification,
# - BertForQuestionAnswering
# check https://huggingface.co/docs/transformers/model_doc/bert
cls = getattr(importlib.import_module(gena_module_name), 'BertForSequenceClassification')
print(cls)
model = cls.from_pretrained('AIRI-Institute/gena-lm-bert-base', num_labels=2)
GENA-LM (gena-lm-bert-base) model is trained in a masked language model (MLM) fashion, following the methods proposed in the BigBird paper by masking 15% of tokens. Model config for gena-lm-bert-base is similar to the bert-base:
We pre-trained gena-lm-bert-base using the latest T2T human genome assembly (https://www.ncbi.nlm.nih.gov/assembly/GCA_009914755.3/). Pre-training was performed for 500,000 iterations with the same parameters as in BigBird, except sequence length was equal to 512 tokens. We modified Transformer with Pre-Layer normalization, but without the final layer LayerNorm.
For evaluation results, see our paper: https://www.biorxiv.org/content/10.1101/2023.06.12.544594v1
@article{GENA_LM,
author = {Veniamin Fishman and Yuri Kuratov and Maxim Petrov and Aleksei Shmelev and Denis Shepelin and Nikolay Chekanov and Olga Kardymon and Mikhail Burtsev},
title = {GENA-LM: A Family of Open-Source Foundational Models for Long DNA Sequences},
elocation-id = {2023.06.12.544594},
year = {2023},
doi = {10.1101/2023.06.12.544594},
publisher = {Cold Spring Harbor Laboratory},
URL = {https://www.biorxiv.org/content/early/2023/06/13/2023.06.12.544594},
eprint = {https://www.biorxiv.org/content/early/2023/06/13/2023.06.12.544594.full.pdf},
journal = {bioRxiv}
}