How to use from the
Use from the
sentence-transformers library
from sentence_transformers import SentenceTransformer

model = SentenceTransformer("richardyoung/CardioEmbed-BGE-M3")

sentences = [
    "That is a happy person",
    "That is a happy dog",
    "That is a very happy person",
    "Today is a sunny day"
]
embeddings = model.encode(sentences)

similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]

CardioEmbed-BGE-M3

Domain-specialized cardiology text embeddings using LoRA-adapted BGE-M3

Part of a comparative study of 10 embedding architectures for clinical cardiology.

Performance

Metric Score
Separation Score 0.209

Usage

from transformers import AutoModel, AutoTokenizer
from peft import PeftModel

base_model = AutoModel.from_pretrained("BAAI/bge-m3")
tokenizer = AutoTokenizer.from_pretrained("BAAI/bge-m3")
model = PeftModel.from_pretrained(base_model, "richardyoung/CardioEmbed-BGE-M3")

Training

  • Training Data: 106,535 cardiology text pairs from medical textbooks
  • Method: LoRA fine-tuning (r=16, alpha=32)
  • Loss: Multiple Negatives Ranking Loss (InfoNCE)

Citation

@article{young2024comparative,
  title={Comparative Analysis of LoRA-Adapted Embedding Models for Clinical Cardiology Text Representation},
  author={Young, Richard J and Matthews, Alice M},
  journal={arXiv preprint},
  year={2024}
}
Downloads last month
1
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for richardyoung/CardioEmbed-BGE-M3

Base model

BAAI/bge-m3
Adapter
(9)
this model

Collection including richardyoung/CardioEmbed-BGE-M3