sentence-transformers How to use Stevenf232/SapBERT_ContrastiveLoss_BC5CDR_Context with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("Stevenf232/SapBERT_ContrastiveLoss_BC5CDR_Context")
sentences = [
"liver injury [SEP] d up all transplant-free survivors of paracetamol-induced acute liver injury, hospitalized in a Danish national referral centre during 1984-",
"Drug-Induced Liver Injury [SEP] A spectrum of clinical liver diseases ranging from mild biochemical abnormalities to ACUTE LIVER FAILURE, caused by drugs, drug ",
"Venous Thrombosis [SEP] The formation or presence of a blood clot (THROMBUS) within a vein.\n ",
"Isoflurophate [SEP] A di-isopropyl-fluorophosphate which is an irreversible cholinesterase inhibitor used to investigate the NERVOUS SYSTEM.\n "
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]