| --- |
| license: cc-by-4.0 |
| task_categories: |
| - sentence-similarity |
| - feature-extraction |
| language: |
| - en |
| tags: |
| - biomedical |
| - scientific-literature |
| - pubmed |
| - pmc |
| - embeddings |
| - soda-vec |
| - negative-sampling |
| - sentence-transformers |
| size_categories: |
| - 10M<n<100M |
| --- |
| |
| # SODA-VEC Paired Dataset for Negative Sampling |
|
|
| This is a **paired version** of the SODA-VEC dataset, specifically formatted for negative sampling training with `MultipleNegativesRankingLoss`. |
|
|
| ## Dataset Overview |
|
|
| - **Total examples**: 26,573,900 |
| - **Format**: Paired (anchor-positive) for contrastive learning |
| - **Source**: [EMBO/soda-vec-data-full_pmc_title_abstract](https://huggingface.co/datasets/EMBO/soda-vec-data-full_pmc_title_abstract) |
| - **Purpose**: Training sentence transformers with negative sampling |
|
|
| ## Data Format |
|
|
| Each example contains: |
| - **`anchor`** (string): The title of the scientific article |
| - **`positive`** (string): The abstract of the scientific article |
| - **`pmcid`** (string): PubMed Central ID for reference |
|
|
| ## Usage |
|
|
| ```python |
| from datasets import load_dataset |
| from sentence_transformers import SentenceTransformer |
| from sentence_transformers.losses import MultipleNegativesRankingLoss |
| |
| # Load the paired dataset |
| dataset = load_dataset("EMBO/soda-vec-data-full_pmc_title_abstract_paired") |
| |
| # Use with MultipleNegativesRankingLoss |
| model = SentenceTransformer('all-MiniLM-L6-v2') |
| loss = MultipleNegativesRankingLoss(model) |
| |
| # The dataset is ready for training |
| train_dataset = dataset['train'] |
| ``` |
|
|
| ## Training Example |
|
|
| ```python |
| from sentence_transformers import SentenceTransformerTrainer, SentenceTransformerTrainingArguments |
| |
| # Training arguments |
| args = SentenceTransformerTrainingArguments( |
| output_dir="./soda-vec-negative-sampling", |
| num_train_epochs=3, |
| per_device_train_batch_size=32, |
| learning_rate=2e-5, |
| fp16=True, |
| ) |
| |
| # Create trainer |
| trainer = SentenceTransformerTrainer( |
| model=model, |
| args=args, |
| train_dataset=dataset['train'], |
| eval_dataset=dataset['validation'], |
| loss=loss, |
| ) |
| |
| # Start training |
| trainer.train() |
| ``` |
|
|
| ## Citation |
|
|
| If you use this dataset, please cite the original SODA-VEC work: |
|
|
| ```bibtex |
| @software{soda_vec_2025, |
| title={SODA-VEC: Optimized Sentence Transformer for Biomedical Text}, |
| author={EMBO}, |
| year={2025}, |
| url={https://github.com/source-data/soda-vec}, |
| note={Dataset: EMBO/soda-vec-data-full_pmc_title_abstract_paired} |
| } |
| ``` |
|
|
| ## License |
|
|
| This dataset is released under the **CC-BY-4.0** license, consistent with PubMed Central's open access requirements. |
|
|