Model Details of mirrorbert_medroberta.nl_clstoken
Model Card for Mirrorbert Medroberta.Nl Clstoken
The model was trained on about 8 millions medical entity pairs (term, synonym)
Expected input and output
The input should be a string of biomedical entity names, e.g., "covid infection" or "Hydroxychloroquine". The [CLS] embedding of the last layer is regarded as the output.
Extracting embeddings from mirrorbert_MedRoBERTa.nl_clstoken
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("UMCU/mirrorbert_MedRoBERTa.nl_clstoken")
model = AutoModel.from_pretrained("UMCU/mirrorbert_MedRoBERTa.nl_clstoken").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,:]
all_embs.append(cls_rep.cpu().detach().numpy())
all_embs = np.concatenate(all_embs, axis=0)
Data description
Hard Dutch ontological synonym pairs (terms referring to the same CUI/SCUI).
For more details about training and eval, see MirrorBERT
github repo
.
Citation
@inproceedings{liu-etal-2021-fast,
title = "Fast, Effective, and Self-Supervised: Transforming Masked Language Models into Universal Lexical and Sentence Encoders",
author = "Liu, Fangyu and
Vuli{'c}, Ivan and
Korhonen, Anna and
Collier, Nigel",
booktitle = "Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing",
month = nov,
year = "2021",
address = "Online and Punta Cana, Dominican Republic",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2021.emnlp-main.109",
pages = "1442--1459",
}
For more details about training/eval and other scripts, see CardioNER
github repo
.
and for more information on the background, see Datatools4Heart
Huggingface
/
Website
Runs of UMCU mirrorbert_medroberta.nl_clstoken on huggingface.co
21
Total runs
1
24-hour runs
3
3-day runs
1
7-day runs
11
30-day runs
More Information About mirrorbert_medroberta.nl_clstoken huggingface.co Model
More mirrorbert_medroberta.nl_clstoken license Visit here:
mirrorbert_medroberta.nl_clstoken huggingface.co is an AI model on huggingface.co that provides mirrorbert_medroberta.nl_clstoken's model effect (), which can be used instantly with this UMCU mirrorbert_medroberta.nl_clstoken model. huggingface.co supports a free trial of the mirrorbert_medroberta.nl_clstoken model, and also provides paid use of the mirrorbert_medroberta.nl_clstoken. Support call mirrorbert_medroberta.nl_clstoken model through api, including Node.js, Python, http.
mirrorbert_medroberta.nl_clstoken huggingface.co is an online trial and call api platform, which integrates mirrorbert_medroberta.nl_clstoken's modeling effects, including api services, and provides a free online trial of mirrorbert_medroberta.nl_clstoken, you can try mirrorbert_medroberta.nl_clstoken online for free by clicking the link below.
UMCU mirrorbert_medroberta.nl_clstoken online free url in huggingface.co:
mirrorbert_medroberta.nl_clstoken is an open source model from GitHub that offers a free installation service, and any user can find mirrorbert_medroberta.nl_clstoken on GitHub to install. At the same time, huggingface.co provides the effect of mirrorbert_medroberta.nl_clstoken install, users can directly use mirrorbert_medroberta.nl_clstoken installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
mirrorbert_medroberta.nl_clstoken install url in huggingface.co: