Views
No views yet

pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3model = SentenceTransformer("SalmanFaroz/DisEmbed-v1")
4# Run inference
5sentences = [
6 'Chronic cough with blood-streaked sputum, severe night sweats, and unintentional weight loss.Painful breathing or chest pain, often worsened by coughing.Swelling in the neck or lymph nodes, and frequent fatigue.',
7 'Asthma',
8 'Tuberculosis'
9]
10embeddings = model.encode(sentences)
11print(embeddings.shape)
12# [3, 384]
13
14# Get the similarity scores for the embeddings
15similarities = model.similarity(embeddings, embeddings)
16print(similarities)
17@article{faroz2024disembed,
title={DisEmbed: Transforming Disease Understanding through Embeddings},
author={Faroz, Salman},
journal={arXiv preprint arXiv:2412.15258},
year={2024},
doi={10.48550/arXiv.2412.15258},
url={https://arxiv.org/abs/2412.15258}
}