CoolFace
Modelpublic

pankajrajdeo/BioForge-bioformer-16L-clinical-trials

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes14downloads
Model Card

SentenceTransformer

This is a sentence-transformers model trained. It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.

Model Details

Model Description

  • —Model Type: Sentence Transformer <!-- - Base model: Unknown -->
  • —Maximum Sequence Length: 256 tokens
  • —Output Dimensionality: 384 dimensions
  • —Similarity Function: Cosine Similarity <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 256, 'do_lower_case': False}) with Transformer model: BertModel 
  (1): Pooling({'word_embedding_dimension': 384, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

bash
pip install -U sentence-transformers

Then you can load this model and run inference.

python
from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("pankajrajdeo/BioForge-bioformer-16L-clinical-trials")
# Run inference
sentences = [
    'Gaucher Disease',
    'OTHER: Digital Engagement Application (GD App)|OTHER: No Intervention',
    'Pregnancy Complications|Gestational Diabetes|Obstetric Labor Complications|Neurodevelopmental Disorders|Childhood Obesity',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

<!--

Direct Usage (Transformers)

<details><summary>Click to see the direct usage in Transformers</summary>

</details> -->

<!--

Downstream Usage (Sentence Transformers)

You can finetune this model on your own dataset.

<details><summary>Click to expand</summary>

</details> -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

Evaluation

Metrics

Information Retrieval
MetricValue
cosine_accuracy@10.6569
cosine_accuracy@30.7522
cosine_accuracy@50.7922
cosine_accuracy@100.8405
cosine_precision@10.6569
cosine_precision@30.2827
cosine_precision@50.1858
cosine_precision@100.1034
cosine_recall@10.543
cosine_recall@30.6531
cosine_recall@50.6999
cosine_recall@100.7596
cosine_ndcg@100.6889
cosine_mrr@100.7148
cosine_map@1000.6492

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Dataset

Unnamed Dataset
  • —Size: 3,977,498 training samples
  • —Columns: <code>anchor</code> and <code>positive</code>
  • —Approximate statistics based on the first 1000 samples: | | anchor | positive | |:--------|:----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 3 tokens</li><li>mean: 31.98 tokens</li><li>max: 75 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 30.28 tokens</li><li>max: 102 tokens</li></ul> |
  • —Samples: | anchor | positive | |:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <code>Kinesiotape for Edema After Bilateral Total Knee Arthroplasty</code> | <code>The purpose of this study is to determine if kinesiotaping for edema management will decrease post-operative edema in patients with bilateral total knee arthroplasty. The leg receiving kinesiotaping during inpatient rehabilitation may have decreased edema </code> | | <code>Kinesiotape for Edema After Bilateral Total Knee Arthroplasty</code> | <code>Arthroplasty Complications|Arthroplasty, Replacement, Knee</code> | | <code>The purpose of this study is to determine if kinesiotaping for edema management will decrease post-operative edema in patients with bilateral total knee arthroplasty. The leg receiving kinesiotaping during inpatient rehabilitation may have decreased edema </code> | <code>Change from baseline and during 1-2-day time intervals of circumferences of both knees and lower extremities, Bilateral circumferences, in centimeters, at the following points: 10 cm above the superior pole of the patella; middle of the knee joint; calf ci</code> |
  • —Loss: <code>CachedMultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim"
  }

Training Hyperparameters

Non-Default Hyperparameters
  • —eval_strategy: steps
  • —per_device_train_batch_size: 512
  • —learning_rate: 2e-05
  • —lr_scheduler_type: cosine
  • —warmup_ratio: 0.05
  • —bf16: True
  • —dataloader_num_workers: 16
  • —load_best_model_at_end: True
  • —gradient_checkpointing: True
All Hyperparameters

<details><summary>Click to expand</summary>

  • —overwrite_output_dir: False
  • —do_predict: False
  • —eval_strategy: steps
  • —prediction_loss_only: True
  • —per_device_train_batch_size: 512
  • —per_device_eval_batch_size: 8
  • —per_gpu_train_batch_size: None
  • —per_gpu_eval_batch_size: None
  • —gradient_accumulation_steps: 1
  • —eval_accumulation_steps: None
  • —torch_empty_cache_steps: None
  • —learning_rate: 2e-05
  • —weight_decay: 0.0
  • —adam_beta1: 0.9
  • —adam_beta2: 0.999
  • —adam_epsilon: 1e-08
  • —max_grad_norm: 1.0
  • —num_train_epochs: 3
  • —max_steps: -1
  • —lr_scheduler_type: cosine
  • —lr_scheduler_kwargs: {}
  • —warmup_ratio: 0.05
  • —warmup_steps: 0
  • —log_level: passive
  • —log_level_replica: warning
  • —log_on_each_node: True
  • —logging_nan_inf_filter: True
  • —save_safetensors: True
  • —save_on_each_node: False
  • —save_only_model: False
  • —restore_callback_states_from_checkpoint: False
  • —no_cuda: False
  • —use_cpu: False
  • —use_mps_device: False
  • —seed: 42
  • —data_seed: None
  • —jit_mode_eval: False
  • —use_ipex: False
  • —bf16: True
  • —fp16: False
  • —fp16_opt_level: O1
  • —half_precision_backend: auto
  • —bf16_full_eval: False
  • —fp16_full_eval: False
  • —tf32: None
  • —local_rank: 0
  • —ddp_backend: None
  • —tpu_num_cores: None
  • —tpu_metrics_debug: False
  • —debug: []
  • —dataloader_drop_last: False
  • —dataloader_num_workers: 16
  • —dataloader_prefetch_factor: None
  • —past_index: -1
  • —disable_tqdm: False
  • —remove_unused_columns: True
  • —label_names: None
  • —load_best_model_at_end: True
  • —ignore_data_skip: False
  • —fsdp: []
  • —fsdp_min_num_params: 0
  • —fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • —fsdp_transformer_layer_cls_to_wrap: None
  • —accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • —deepspeed: None
  • —label_smoothing_factor: 0.0
  • —optim: adamw_torch
  • —optim_args: None
  • —adafactor: False
  • —group_by_length: False
  • —length_column_name: length
  • —ddp_find_unused_parameters: None
  • —ddp_bucket_cap_mb: None
  • —ddp_broadcast_buffers: False
  • —dataloader_pin_memory: True
  • —dataloader_persistent_workers: False
  • —skip_memory_metrics: True
  • —use_legacy_prediction_loop: False
  • —push_to_hub: False
  • —resume_from_checkpoint: None
  • —hub_model_id: None
  • —hub_strategy: every_save
  • —hub_private_repo: None
  • —hub_always_push: False
  • —hub_revision: None
  • —gradient_checkpointing: True
  • —gradient_checkpointing_kwargs: None
  • —include_inputs_for_metrics: False
  • —include_for_metrics: []
  • —eval_do_concat_batches: True
  • —fp16_backend: auto
  • —push_to_hub_model_id: None
  • —push_to_hub_organization: None
  • —mp_parameters:
  • —auto_find_batch_size: False
  • —full_determinism: False
  • —torchdynamo: None
  • —ray_scope: last
  • —ddp_timeout: 1800
  • —torch_compile: False
  • —torch_compile_backend: None
  • —torch_compile_mode: None
  • —include_tokens_per_second: False
  • —include_num_input_tokens_seen: False
  • —neftune_noise_alpha: None
  • —optim_target_modules: None
  • —batch_eval_metrics: False
  • —eval_on_start: False
  • —use_liger_kernel: False
  • —liger_kernel_config: None
  • —eval_use_gather_object: False
  • —average_tokens_across_devices: False
  • —prompts: None
  • —batch_sampler: batch_sampler
  • —multi_dataset_batch_sampler: proportional

</details>

Training Logs

<details><summary>Click to expand</summary>

EpochStepTraining Lossct-pubmed-clean-eval_cosine_ndcg@10
0.01291002.2196-
0.02572001.7937-
0.03863001.5607-
0.05154001.4738-
0.06445001.4141-
0.07726001.3807-
0.09017001.3341-
0.10308001.3077-
0.11589001.3093-
0.128710001.2638-
0.141611001.2509-
0.154512001.2333-
0.167313001.2375-
0.180214001.2022-
0.193115001.1917-
0.205916001.1853-
0.218817001.1842-
0.231718001.1748-
0.244619001.1735-
0.257420001.1457-
0.270321001.1445-
0.283222001.1448-
0.296023001.1313-
0.308924001.1301-
0.321825001.1281-
0.334726001.1139-
0.347527001.1062-
0.360428001.0989-
0.373329001.1147-
0.386230001.106-
0.399031001.1074-
0.411932001.0853-
0.424833001.0918-
0.437634001.0857-
0.450535001.0774-
0.463436001.0744-
0.476337001.0799-
0.489138001.0791-
0.49993884-0.6628
0.502039001.077-
0.514940001.0531-
0.527741001.0449-
0.540642001.0544-
0.553543001.0496-
0.566444001.0508-
0.579245001.0649-
0.592146001.0633-
0.605047001.0576-
0.617848001.0398-
0.630749001.0311-
0.643650001.0558-
0.656551001.0355-
0.669352001.0221-
0.682253001.0188-
0.695154001.0266-
0.707955001.0254-
0.720856001.0229-
0.733757001.0199-
0.746658001.0187-
0.759459001.0143-
0.772360001.0241-
0.785261001.0174-
0.798062001.0069-
0.810963001.0008-
0.823864001.0083-
0.836765001.0047-
0.849566001.0134-
0.862467001.0021-
0.875368000.9956-
0.888169001.0-
0.901070001.0098-
0.913971000.9991-
0.926872001.0003-
0.939673000.965-
0.952574000.9992-
0.965475000.9889-
0.978276000.9961-
0.991177000.9912-
0.99997768-0.6744
1.004078000.9734-
1.016979000.9606-
1.029780000.9552-
1.042681000.953-
1.055582000.9701-
1.068383000.9603-
1.081284000.9448-
1.094185000.9332-
1.107086000.9427-
1.119887000.9512-
1.132788000.9441-
1.145689000.9509-
1.158590000.9568-
1.171391000.9473-
1.184292000.9434-
1.197193000.9329-
1.209994000.932-
1.222895000.9513-
1.235796000.9476-
1.248697000.933-
1.261498000.9243-
1.274399000.9422-
1.2872100000.9249-
1.3000101000.9297-
1.3129102000.9285-
1.3258103000.9364-
1.3387104000.9339-
1.3515105000.9395-
1.3644106000.9365-
1.3773107000.9223-
1.3901108000.926-
1.4030109000.925-
1.4159110000.9373-
1.4288111000.9304-
1.4416112000.9251-
1.4545113000.9315-
1.4674114000.9301-
1.4802115000.9292-
1.4931116000.9187-
1.499811652-0.6844
1.5060117000.9195-
1.5189118000.9251-
1.5317119000.9292-
1.5446120000.913-
1.5575121000.9262-
1.5703122000.9199-
1.5832123000.9216-
1.5961124000.9307-
1.6090125000.9257-
1.6218126000.9242-
1.6347127000.9225-
1.6476128000.9155-
1.6604129000.9175-
1.6733130000.9114-
1.6862131000.9201-
1.6991132000.9233-
1.7119133000.9129-
1.7248134000.9192-
1.7377135000.9042-
1.7505136000.9048-
1.7634137000.9116-
1.7763138000.9119-
1.7892139000.9095-
1.8020140000.909-
1.8149141000.9091-
1.8278142000.902-
1.8406143000.8988-
1.8535144000.9025-
1.8664145000.9031-
1.8793146000.9221-
1.8921147000.9022-
1.9050148000.9081-
1.9179149000.9051-
1.9308150000.9006-
1.9436151000.9158-
1.9565152000.9077-
1.9694153000.8976-
1.9822154000.899-
1.9951155000.9096-
1.999715536-0.6843
2.0080156000.8844-
2.0209157000.8738-
2.0337158000.8896-
2.0466159000.8892-
2.0595160000.8805-
2.0723161000.8732-
2.0852162000.8821-
2.0981163000.8903-
2.1110164000.8901-
2.1238165000.8844-
2.1367166000.8887-
2.1496167000.871-
2.1624168000.8776-
2.1753169000.8754-
2.1882170000.8949-
2.2011171000.8835-
2.2139172000.8694-
2.2268173000.8773-
2.2397174000.8808-
2.2525175000.8908-
2.2654176000.8854-
2.2783177000.8813-
2.2912178000.8813-
2.3040179000.8805-
2.3169180000.8666-
2.3298181000.8851-
2.3426182000.8719-
2.3555183000.8819-
2.3684184000.8695-
2.3813185000.8778-
2.3941186000.8673-
2.4070187000.8868-
2.4199188000.886-
2.4327189000.882-
2.4456190000.8701-
2.4585191000.874-
2.4714192000.8681-
2.4842193000.886-
2.4971194000.882-
2.499719420-0.6884
2.5100195000.8837-
2.5228196000.8765-
2.5357197000.8771-
2.5486198000.8727-
2.5615199000.8735-
2.5743200000.8765-
2.5872201000.8701-
2.6001202000.8804-
2.6129203000.8785-
2.6258204000.8719-
2.6387205000.8758-
2.6516206000.8868-
2.6644207000.8684-
2.6773208000.8636-
2.6902209000.8942-
2.7031210000.8726-
2.7159211000.8704-
2.7288212000.8728-
2.7417213000.8708-
2.7545214000.8654-
2.7674215000.8599-
2.7803216000.8714-
2.7932217000.8753-
2.8060218000.8793-
2.8189219000.8787-
2.8318220000.8797-
2.8446221000.876-
2.8575222000.8732-
2.8704223000.8687-
2.8833224000.871-
2.8961225000.8796-
2.9090226000.8812-
2.9219227000.8659-
2.9347228000.8625-
2.9476229000.8755-
2.9605230000.8767-
2.9734231000.8658-
2.9862232000.8751-
2.9991233000.8774-
2.999623304-0.6889

</details>

Framework Versions

  • —Python: 3.11.11
  • —Sentence Transformers: 3.4.1
  • —Transformers: 4.53.2
  • —PyTorch: 2.6.0+cu124
  • —Accelerate: 1.5.2
  • —Datasets: 3.2.0
  • —Tokenizers: 0.21.0

Citation

BibTeX

Sentence Transformers
bibtex
@inproceedings{reimers-2019-sentence-bert,
    title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
    author = "Reimers, Nils and Gurevych, Iryna",
    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
    month = "11",
    year = "2019",
    publisher = "Association for Computational Linguistics",
    url = "https://arxiv.org/abs/1908.10084",
}
CachedMultipleNegativesRankingLoss
bibtex
@misc{gao2021scaling,
    title={Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup},
    author={Luyu Gao and Yunyi Zhang and Jiawei Han and Jamie Callan},
    year={2021},
    eprint={2101.06983},
    archivePrefix={arXiv},
    primaryClass={cs.LG}
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->