Model reference · open weights

SapBERT-UMLS-2020AB-all-lang-from-XLMR

Embeddings cambridgeltl Embeddings 1 build Licence not stated 200k dl/mo

SapBERT-UMLS-2020AB-all-lang-from-XLMR is an open-weight embedding model from cambridgeltl. SapBERT-UMLS-2020AB-all-lang-from-XLMR (FP32) weighs 556 MB; the smallest configuration that runs it is RTX 3060 12 GB.

For self-hosting, compare this build's requirements below with the GPU you plan to rent.

  • SapBERT-UMLS-2020AB-all-lang-from-XLMR is a multilingual feature-extraction model developed by cambridgeltl for biomedical lexical semantics and cross-lingual entity linking.
  • It is built on the xlm-roberta-base architecture with 278M parameters and a context length of 514 tokens.
  • The model was trained on the UMLS 2020AB dataset and is designed to generate embeddings for biomedical entity names across multiple languages.

Summary of the cambridgeltl/SapBERT-UMLS-2020AB-all-lang-from-XLMR model card, 2026-10-01

What it is

Released bycambridgeltl
Released2022-03-02
Parameters278M
VRAM556 MB for the weights

What it runs on

Memory and cards for SapBERT-UMLS-2020AB-all-lang-from-XLMR (FP32)

556 MBweights, file size
1.1 GBruntime overhead
CardRunsMemory
RTX 3060 12 GBfits11.6 GB
RTX 4060 Ti 16 GBfits15.4 GB
RTX 3090 24 GBfits23.4 GB
RTX 4090 24 GBfits23.4 GB
RTX 5090 32 GBfits31.0 GB
L40S 48 GBfits44.0 GB
A100 80 GBfits78.2 GB
H100 80 GBfits78.1 GB
RTX PRO 6000 Blackwell 96 GBfits93.8 GB
DGX Spark (GB10) 128 GB unifiedfits107 GB
H200 141 GBfits138 GB
B200 180 GBfits176 GB

From the model card

What cambridgeltl says about SapBERT-UMLS-2020AB-all-lang-from-XLMR

Read the model card

language: multilingual

tags:

  • biomedical
  • lexical-semantics
  • cross-lingual

datasets:

  • UMLS

[news] A cross-lingual extension of SapBERT will appear in the main onference of ACL 2021! [news] SapBERT will appear in the conference proceedings of NAACL 2021!

SapBERT-XLMR

SapBERT (Liu et al. 2020) trained with UMLS 2020AB, using xlm-roberta-base as the base model. Please use [CLS] as the representation of the input.

Extracting embeddings from SapBERT

The following script converts a list of strings (entity names) into embeddings.

import numpy as np
import torch
from tqdm.auto import tqdm
from transformers import AutoTokenizer, AutoModel

tokenizer = AutoTokenizer.from_pretrained("cambridgeltl/SapBERT-from-PubMedBERT-fulltext")
model = AutoModel.from_pretrained("cambridgeltl/SapBERT-from-PubMedBERT-fulltext").cuda()

# replace with your own list of entity names
all_names = ["covid-19", "Coronavirus infection", "high fever", "Tumor of posterior wall of oropharynx"]

bs = 128 # batch size during inference
all_embs = []
for i in tqdm(np.arange(0, len(all_names), bs)):
    toks = tokenizer.batch_encode_plus(all_names[i:i+bs],
                                       padding="max_length",
                                       max_length=25,
                                       truncation=True,
                                       return_tensors="pt")
    toks_cuda = {}
    for k,v in toks.items():
        toks_cuda[k] = v.cuda()
    cls_rep = model(**toks_cuda)[0][:,0,:] # use CLS representation as the embedding
    all_embs.append(cls_rep.cpu().detach().numpy())

all_embs = np.concatenate(all_embs, axis=0)

For more details about training and eval, see SapBERT github repo.

Citation

@inproceedings{liu2021learning,
	title={Learning Domain-Specialised Representations for Cross-Lingual Biomedical Entity Linking},
	author={Liu, Fangyu and Vuli{\'c}, Ivan and Korhonen, Anna and Collier, Nigel},
	booktitle={Proceedings of ACL-IJCNLP 2021},
	month = aug,
	year={2021}
}

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms