NeuML / bioclinical-modernbert-base-embeddings

huggingface.co
Total runs: 2.4K
24-hour runs: 0
7-day runs: 113
30-day runs: -1.4K
Model's Last Updated: August 06 2025
sentence-similarity

Introduction of bioclinical-modernbert-base-embeddings

Model Details of bioclinical-modernbert-base-embeddings

BioClinical ModernBERT Embeddings

This is a BioClinical ModernBERT model fined-tuned using sentence-transformers . It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search. The training dataset was generated using a random sample of PubMed title-abstract pairs along with similar title pairs.

Given that this is a ModernBERT model, it supports a longer context length of up to 8,192 tokens vs the 512 tokens supported by standard BERT models.

Usage (txtai)

This model can be used to build embeddings databases with txtai for semantic search and/or as a knowledge source for retrieval augmented generation (RAG).

import txtai

embeddings = txtai.Embeddings(path="neuml/bioclinical-modernbert-base-embeddings", content=True)
embeddings.index(documents())

# Run a query
embeddings.search("query to run")
Usage (Sentence-Transformers)

Alternatively, the model can be loaded with sentence-transformers .

from sentence_transformers import SentenceTransformer
sentences = ["This is an example sentence", "Each sentence is converted"]

model = SentenceTransformer("neuml/bioclinical-modernbert-base-embeddings")
embeddings = model.encode(sentences)
print(embeddings)
Usage (Hugging Face Transformers)

The model can also be used directly with Transformers.

from transformers import AutoTokenizer, AutoModel
import torch

# Mean Pooling - Take attention mask into account for correct averaging
def meanpooling(output, mask):
    embeddings = output[0] # First element of model_output contains all token embeddings
    mask = mask.unsqueeze(-1).expand(embeddings.size()).float()
    return torch.sum(embeddings * mask, 1) / torch.clamp(mask.sum(1), min=1e-9)

# Sentences we want sentence embeddings for
sentences = ['This is an example sentence', 'Each sentence is converted']

# Load model from HuggingFace Hub
tokenizer = AutoTokenizer.from_pretrained("neuml/bioclinical-modernbert-base-embeddings")
model = AutoModel.from_pretrained("neuml/bioclinical-modernbert-base-embeddings")

# Tokenize sentences
inputs = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')

# Compute token embeddings
with torch.no_grad():
    output = model(**inputs)

# Perform pooling. In this case, mean pooling.
embeddings = meanpooling(output, inputs['attention_mask'])

print("Sentence embeddings:")
print(embeddings)
Evaluation Results

Performance of this model compared to the top base models on the MTEB leaderboard is shown below. A popular smaller model was also evaluated along with the most downloaded PubMed similarity model on the Hugging Face Hub.

The following datasets were used to evaluate model performance.

Evaluation results are shown below. The Pearson correlation coefficient is used as the evaluation metric.

Model PubMed QA PubMed Subset PubMed Summary Average
all-MiniLM-L6-v2 90.40 95.92 94.07 93.46
bioclinical-modernbert-base-embeddings 92.49 97.13 97.04 95.54
bge-base-en-v1.5 91.02 95.82 94.49 93.78
gte-base 92.97 96.90 96.24 95.37
pubmedbert-base-embeddings 93.27 97.00 96.58 95.62
S-PubMedBert-MS-MARCO 90.86 93.68 93.54 92.69

Note that while this model scores slightly lower than the PubMedBERT embeddings model, it supports a longer context of 8,192 tokens vs 512 .

Training

The model was trained with the parameters:

DataLoader :

{'batch_size': 8, 'sampler': 'torch.utils.data.sampler.RandomSampler', 'batch_sampler': 'torch.utils.data.sampler.BatchSampler'}

Loss :

sentence_transformers.losses.MultipleNegativesRankingLoss.MultipleNegativesRankingLoss with parameters:

{'scale': 20.0, 'similarity_fct': 'cos_sim'}

Parameters of the fit() method:

{
    "epochs": 1,
    "evaluation_steps": 2000,
    "evaluator": "sentence_transformers.evaluation.EmbeddingSimilarityEvaluator.EmbeddingSimilarityEvaluator",
    "max_grad_norm": 1,
    "optimizer_class": "<class 'torch.optim.adamw.AdamW'>",
    "optimizer_params": {
        "lr": 2e-05
    },
    "scheduler": "WarmupLinear",
    "steps_per_epoch": null,
    "warmup_steps": 10000,
    "weight_decay": 0.01
}
Full Model Architecture
SentenceTransformer(
  (0): Transformer({'max_seq_length': 8192, 'do_lower_case': False}) with Transformer model: ModernBertModel 
  (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)
More Information

This model was trained using the same method described in this article .

Runs of NeuML bioclinical-modernbert-base-embeddings on huggingface.co

2.4K
Total runs
0
24-hour runs
-6
3-day runs
113
7-day runs
-1.4K
30-day runs

More Information About bioclinical-modernbert-base-embeddings huggingface.co Model

More bioclinical-modernbert-base-embeddings license Visit here:

https://choosealicense.com/licenses/apache-2.0

bioclinical-modernbert-base-embeddings huggingface.co

bioclinical-modernbert-base-embeddings huggingface.co is an AI model on huggingface.co that provides bioclinical-modernbert-base-embeddings's model effect (), which can be used instantly with this NeuML bioclinical-modernbert-base-embeddings model. huggingface.co supports a free trial of the bioclinical-modernbert-base-embeddings model, and also provides paid use of the bioclinical-modernbert-base-embeddings. Support call bioclinical-modernbert-base-embeddings model through api, including Node.js, Python, http.

bioclinical-modernbert-base-embeddings huggingface.co Url

https://huggingface.co/NeuML/bioclinical-modernbert-base-embeddings

NeuML bioclinical-modernbert-base-embeddings online free

bioclinical-modernbert-base-embeddings huggingface.co is an online trial and call api platform, which integrates bioclinical-modernbert-base-embeddings's modeling effects, including api services, and provides a free online trial of bioclinical-modernbert-base-embeddings, you can try bioclinical-modernbert-base-embeddings online for free by clicking the link below.

NeuML bioclinical-modernbert-base-embeddings online free url in huggingface.co:

https://huggingface.co/NeuML/bioclinical-modernbert-base-embeddings

bioclinical-modernbert-base-embeddings install

bioclinical-modernbert-base-embeddings is an open source model from GitHub that offers a free installation service, and any user can find bioclinical-modernbert-base-embeddings on GitHub to install. At the same time, huggingface.co provides the effect of bioclinical-modernbert-base-embeddings install, users can directly use bioclinical-modernbert-base-embeddings installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

bioclinical-modernbert-base-embeddings install url in huggingface.co:

https://huggingface.co/NeuML/bioclinical-modernbert-base-embeddings

Url of bioclinical-modernbert-base-embeddings

bioclinical-modernbert-base-embeddings huggingface.co Url

Provider of bioclinical-modernbert-base-embeddings huggingface.co

NeuML
ORGANIZATIONS

Other API from NeuML

huggingface.co

Total runs: 1.9K
Run Growth: 1.6K
Growth Rate: 84.98%
Updated:January 27 2025
huggingface.co

Total runs: 1.1K
Run Growth: -170
Growth Rate: -16.18%
Updated:January 27 2025
huggingface.co

Total runs: 1.0K
Run Growth: 199
Growth Rate: 19.19%
Updated:February 21 2023
huggingface.co

Total runs: 853
Run Growth: 250
Growth Rate: 29.31%
Updated:February 21 2023
huggingface.co

Total runs: 521
Run Growth: -99.9K
Growth Rate: -19182.34%
Updated:January 27 2025
huggingface.co

Total runs: 285
Run Growth: 98
Growth Rate: 34.39%
Updated:January 27 2025
huggingface.co

Total runs: 186
Run Growth: 113
Growth Rate: 62.78%
Updated:April 21 2026
huggingface.co

Total runs: 31
Run Growth: 14
Growth Rate: 45.16%
Updated:October 10 2025
huggingface.co

Total runs: 15
Run Growth: -2
Growth Rate: -13.33%
Updated:November 23 2024
huggingface.co

Total runs: 8
Run Growth: -75
Growth Rate: -937.50%
Updated:April 13 2026
huggingface.co

Total runs: 8
Run Growth: 2
Growth Rate: 25.00%
Updated:July 21 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:November 11 2025