Downloads · 30 days
0
genomenet/bert-metagenome
bert-metagenome is a feature extraction model from genomenet. Use it when you need embeddings to search or compare text. It is set up for keras. The card lists the license as mit.
BERT model pretrained on metagenomic contigs and complete microbial genomes for DNA sequence embedding.
Downloads · 30 days
0
Access
Public
Updated Apr 24, 2026
Repo size
3.6 GB
Likes
0
Public
Click a slice to open those files.
.h53.6 GB · 100%
From the Hugging Face model README
BERT model pretrained on metagenomic contigs and complete microbial genomes for DNA sequence embedding.
| architecture | BERT, 24 layers, 768 hidden, 12 heads |
| parameters | ~430M |
| input | 1000 bp DNA sequence (ACGT) |
| output | 768-dim embedding per position |
| pretraining | metagenomic contigs + microbial genomes |
import tensorflow as tf
from huggingface_hub import hf_hub_download
# download model
model_path = hf_hub_download(
repo_id="genomenet/bert-metagenome",
filename="bert_1k_3.h5"
)
# load with custom objects (if needed)
model = tf.keras.models.load_model(model_path, compile=False)
# get embeddings from layer 21
embedding_model = tf.keras.Model(
inputs=model.input,
outputs=model.get_layer("layer_transformer_block_21").output
)
# input: one-hot encoded DNA (batch, 1000, 4)
# output: embeddings (batch, 1000, 768)
DNA sequences are one-hot encoded:
Input shape: (batch_size, 1000, 4)