Downloads · 30 days
40
22% of all-time downloads
umakantcurateai/qwen_embedding_4b_disease_drug_relationship_similarity
qwen_embedding_4b_disease_drug_relationship_similarity is a sentence similarity model from umakantcurateai. Use it when you need a score for how close two texts are. It is set up for sentence-transformers. The card lists the license as apache-2.0.
This is a fine-tuned version of unsloth/Qwen3-Embedding-4B, adapted to better capture disease-to-drug therapeutic relationships. It was trained using Unsloth with LoRA adapters merged back into the base weights, so th…
Downloads · 30 days
40
22% of all-time downloads
All-time downloads
185
Public
Parameters
4B
8.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors8 GB · 100%
From the Hugging Face model README
This is a fine-tuned version of unsloth/Qwen3-Embedding-4B, adapted to better capture disease-to-drug therapeutic relationships. It was trained using Unsloth with LoRA adapters merged back into the base weights, so this repo contains a complete, standalone model, no separate adapter loading required.
Given a disease description as a query, this model produces embeddings where drugs that treat that disease are pulled closer in vector space, while unrelated drugs are pushed further away. It was built as a small, educational fine-tuning exercise, not an industry-grade clinical tool, to demonstrate how domain-specific embedding fine-tuning works end to end.
The training set was built from the DISEASE and DRUG databases, using each disease's DESCRIPTION field (combined with its name) as the anchor, and its listed therapeutic drugs as positives.
Column breakdown:
The dataset contains 2,950 anchor-positive pairs, deduplicated, and split by disease (not by row) to prevent the same disease appearing in both train and eval sets.
Example query: "lung cancer"
| Candidate | Before fine-tuning | After fine-tuning |
|---|---|---|
| Erlotinib hydrochloride (treats lung cancer) | 0.5983 | 0.5973 |
| Gemcitabine hydrochloride (treats lung cancer) | 0.5787 | 0.4176 |
| Water (unrelated) | 0.4716 | 0.1344 |
Fine-tuning clearly pushed the unrelated candidate (Water) much further away, confirming the model learned to separate irrelevant drugs from disease-relevant ones. Note that not all correct positives moved in the same direction (Gemcitabine's similarity dropped), this is an honest artifact of training on a small dataset for a limited number of epochs, and is discussed further in the accompanying Medium article as a teaching point about the practical realities of small-scale contrastive fine-tuning.
from sentence_transformers import SentenceTransformer
from sentence_transformers import util
model = SentenceTransformer("umakantcurateai/qwen_embedding_4b_disease_drug_relationship_similarity")
query = "lung cancer"
candidates = ["Erlotinib hydrochloride", "Gemcitabine hydrochloride", "Water (JP19/USP)"]
query_emb = model.encode(query)
candidate_embs = model.encode(candidates)
scores = util.cos_sim(query_emb, candidate_embs)
print(scores)