Downloads · 30 days
11
13% of all-time downloads
EMBO/soda-vec-negative-sampling
soda-vec-negative-sampling is a machine learning model from EMBO. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
SODA-VEC Negative Sampling is a specialized sentence embedding model trained on 26.5M biomedical text pairs using the MultipleNegativesRankingLoss from sentence-transformers. This model is optimized for biomedical and…
Downloads · 30 days
11
13% of all-time downloads
All-time downloads
82
Public
Parameters
149M
596 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors596 MB · 99%
From the Hugging Face model README
SODA-VEC Negative Sampling is a specialized sentence embedding model trained on 26.5M biomedical text pairs using the MultipleNegativesRankingLoss from sentence-transformers. This model is optimized for biomedical and life sciences applications, providing high-quality semantic representations for scientific literature.
pip install sentence-transformers
from sentence_transformers import SentenceTransformer
# Load the model
model = SentenceTransformer('EMBO/soda-vec-negative-sampling')
# Encode biomedical texts
texts = [
"CRISPR-Cas9 gene editing in human embryos",
"mRNA vaccine efficacy against COVID-19 variants",
"Protein folding mechanisms in neurodegenerative diseases"
]
embeddings = model.encode(texts)
print(f"Embeddings shape: {embeddings.shape}") # (3, 768)
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity
# Query and corpus
query = "Alzheimer's disease biomarkers"
corpus = [
"Tau protein aggregation in neurodegeneration",
"COVID-19 vaccine development strategies",
"Beta-amyloid plaques in dementia patients"
]
# Encode
query_embedding = model.encode([query])
corpus_embeddings = model.encode(corpus)
# Find most similar
similarities = cosine_similarity(query_embedding, corpus_embeddings)[0]
best_match = np.argmax(similarities)
print(f"Best match: {corpus[best_match]} (similarity: {similarities[best_match]:.3f})")
The model uses MultipleNegativesRankingLoss, which:
| Feature | SODA-VEC (VICReg) | SODA-VEC Negative Sampling |
|---|---|---|
| Loss Function | VICReg (custom biomedical) | MultipleNegativesRankingLoss |
| Optimization | Empirically tuned coefficients | Standard contrastive learning |
| Training Data | Same (26.5M pairs) | Same (26.5M pairs) |
| Use Case | Biomedical research focus | General semantic similarity |
| Framework | Custom implementation | sentence-transformers standard |
If you use this model in your research, please cite:
@misc{soda-vec-negative-sampling-2024,
title={SODA-VEC Negative Sampling: Biomedical Sentence Embeddings},
author={EMBO},
year={2024},
url={https://huggingface.co/EMBO/soda-vec-negative-sampling},
note={Trained on 26.5M PubMed text pairs using MultipleNegativesRankingLoss}
}
This model is released under the same license as the base ModernBERT model. Please refer to the original model card for licensing details.
For questions about this model, please contact EMBO or open an issue in the associated repository.
Last Updated: August 2024
Model Version: 1.0
Training Completion: In Progress (ETA: 4 days)