Help preserve open and free AI for humanity's future

← All models

FremyCompany_BioLORD-2023

FremyCompany · View on Hugging Face ↗

Biomedical sentence embedding model (BioLORD 2023) for similarity and search over medical text.

✓ verified · rehash-vs-hf-metadata at 2026-08-24T10:17:39Z

custom/other license836.3 MB (876,941,878 bytes)sentence-transformerspytorchsafetensorsmpnetfeature-extractionsentence-similaritymedicalbiologytext-embeddings-inferenceendpoints_compatible1 language (en)paper: 2311.16075

Get this model

Download FremyCompany_BioLORD-2023.torrent

Recommended — the .torrent carries the webseed url-list, so your client can fall back to plain HTTPS if the swarm is thin. See/verify for the full download + verification walkthrough.

Model card

The complete upstream card, rendered from this payload's README.md — the same hash-verified bytes the torrent distributes. Images and off-site links are removed; the original card on Hugging Face carries them.


pipeline_tag: sentence-similarity tags:

  • sentence-transformers
  • feature-extraction
  • sentence-similarity
  • medical
  • biology language: en license: other license_name: ihtsdo-and-nlm-licences license_link: https://www.nlm.nih.gov/databases/umls.html datasets:
  • FremyCompany/BioLORD-Dataset
  • FremyCompany/AGCT-Dataset widget:
  • source_sentence: bartonellosis sentences:
    • cat scratch disease
    • cat scratch wound
    • tick-borne orbivirus fever
    • cat fur

🙏 If you are able to, please help me fund my open research. 🙏 Thank you for your generosity! 🤗

FremyCompany/BioLORD-2023

This model was trained using BioLORD, a new pre-training strategy for producing meaningful representations for clinical sentences and biomedical concepts.

State-of-the-art methodologies operate by maximizing the similarity in representation of names referring to the same concept, and preventing collapse through contrastive learning. However, because biomedical names are not always self-explanatory, it sometimes results in non-semantic representations.

BioLORD overcomes this issue by grounding its concept representations using definitions, as well as short descriptions derived from a multi-relational knowledge graph consisting of biomedical ontologies. Thanks to this grounding, our model produces more semantic concept representations that match more closely the hierarchical structure of ontologies. BioLORD-2023 establishes a new state of the art for text similarity on both clinical sentences (MedSTS) and biomedical concepts (EHR-Rel-B).

This model is based on sentence-transformers/all-mpnet-base-v2 and was further finetuned on the BioLORD-Dataset and LLM-generated definitions from the Automatic Glossary of Clinical Terminology (AGCT).

Sibling models

This model is accompanied by other models in the BioLORD-2023 series, which you might want to check:

You can also take a look at last year's model and paper:

Training strategy

Summary of the 3 phases

Contrastive phase: details

Self-distallation phase: details

Citation

This model accompanies the BioLORD-2023: Learning Ontological Representations from Definitions paper. When you use this model, please cite the original paper as follows:

@article{remy-etal-2023-biolord,
    author = {Remy, François and Demuynck, Kris and Demeester, Thomas},
    title = "{BioLORD-2023: semantic textual representations fusing large language models and clinical knowledge graph insights}",
    journal = {Journal of the American Medical Informatics Association},
    pages = {ocae029},
    year = {2024},
    month = {02},
    issn = {1527-974X},
    doi = {10.1093/jamia/ocae029},
    url = {https://doi.org/10.1093/jamia/ocae029},
    eprint = {https://academic.oup.com/jamia/advance-article-pdf/doi/10.1093/jamia/ocae029/56772025/ocae029.pdf},
}

Usage (Sentence-Transformers)

This is a sentence-transformers model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search. This model has been finentuned for the biomedical domain. While it preserves a good ability to produce embeddings for general-purpose text, it will be more useful to you if you are trying to process medical documents such as EHR records or clinical notes. Both sentences and phrases can be embedded in the same latent space.

Using this model becomes easy when you have sentence-transformers installed:

pip install -U sentence-transformers

Then you can use the model like this:

from sentence_transformers import SentenceTransformer
sentences = ["Cat scratch injury", "Cat scratch disease", "Bartonellosis"]

model = SentenceTransformer('FremyCompany/BioLORD-2023')
embeddings = model.encode(sentences)
print(embeddings)

Usage (HuggingFace Transformers)

Without sentence-transformers, you can use the model like this: First, you pass your input through the transformer model, then you have to apply the right pooling-operation on-top of the contextualized word embeddings.

from transformers import AutoTokenizer, AutoModel
import torch
import torch.nn.functional as F

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

# Sentences we want sentence embeddings for
sentences = ["Cat scratch injury", "Cat scratch disease", "Bartonellosis"]

# Load model from HuggingFace Hub
tokenizer = AutoTokenizer.from_pretrained('FremyCompany/BioLORD-2023')
model = AutoModel.from_pretrained('FremyCompany/BioLORD-2023')

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

# Compute token embeddings
with torch.no_grad():
    model_output = model(**encoded_input)
# Perform pooling
sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
# Normalize embeddings
sentence_embeddings = F.normalize(sentence_embeddings, p=2, dim=1)
print("Sentence embeddings:")
print(sentence_embeddings)

License

My own contributions for this model are covered by the MIT license. However, given the data used to train this model originates from UMLS and SnomedCT, you will need to ensure you have proper licensing of UMLS and SnomedCT before using this model. Both UMLS and SnomedCT are free of charge in most countries, but you might have to create an account and report on your usage of the data yearly to keep a valid license.

Magnet link (secondary — no webseeds)

Opens the swarm directly, but carries no webseed url-list. Prefer the.torrent download above — HTTP fallback seeds ride inside it.

magnet:?xt=urn:btih:be5ac9a00a89dacfa75c7a014790a0dc02bff765&dn=FremyCompany_BioLORD-2023

Open magnet in torrent client · infohash be5ac9a00a89dacfa75c7a014790a0dc02bff765

Files & hashes

PathSizeMethodHash
1_Pooling/config.json190 B (190 B)sha1-git-blob4e09f293dfe90bba49f87cfe7996271f07be2666
README.md7.0 KB (7,166 B)sha1-git-blobd3bd886058fdceccba3ff7fab54ef01d01c08af2
config.json649 B (649 B)sha1-git-blob4aa02e0f70fcc8038a0c4f3168e91b6ed98a45d8
config_sentence_transformers.json124 B (124 B)sha1-git-blob15a12836ca8159f28549138bbdc1f963b0d17b64
model.safetensors417.7 MB (437,971,872 B)sha256-lfsf8c969586cc6b0fd393faa7d879de93d6cc532123956041fefd3474194322050
modules.json229 B (229 B)sha1-git-blobf7640f94e81bb7f4f04daf1668850b38763a13d9
pytorch_model.bin417.7 MB (438,016,493 B)sha256-lfsafdf32059149be0743903b84598a0f2af1b4e87549cc8543a7d18a947b1d77f0
sentence_bert_config.json53 B (53 B)sha1-git-blob5fd10429389515d3e5cccdeda08cae5fea1ae82e
special_tokens_map.json280 B (280 B)sha1-git-blob2eb83d0a28d775b0e8a2f672638f18cce5411c76
tokenizer.json695.1 KB (711,831 B)sha1-git-blobebc2db8c6be1e7ff2847ead50e5de7e1a77d5c06
tokenizer_config.json1.4 KB (1,455 B)sha1-git-blob54d3e7883484b901fe82d59065c55289d041f8fa
vocab.txt226.1 KB (231,536 B)sha1-git-blob1c51ab79a2298a340952d3e6012042a9c84bbe4d

Provenance

Upstream repositoryFremyCompany/BioLORD-2023
Revision (pinned)167aab527b238a50ca65224e6319215d2ff4fc9f
Fetched at2026-08-24T10:17:12Z
License at fetchother
Snapshot toolhuggingface · seedbank 0.1.0

Trackers

Webseeds