SentenceTransformer based on BAAI/bge-base-en-v1.5

This is a sentence-transformers model finetuned from BAAI/bge-base-en-v1.5. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for retrieval.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: BAAI/bge-base-en-v1.5
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 768 dimensions
  • Similarity Function: Cosine Similarity
  • Supported Modality: Text

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'BertModel'})
  (1): Pooling({'embedding_dimension': 768, 'pooling_mode': 'mean', 'include_prompt': True})
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

pip install -U sentence-transformers

Then you can load this model and run inference.

from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("sentence_transformers_model_id")
# Run inference
sentences = [
    '<> OTPs must provide counseling on preventing exposure to, and the transmission of, human immunodeficiency virus (HIV), viral hepatitis, and sexually transmitted infections (STIs) and either directly provide services and treatments or actively link to treatment each patient admitted or readmitted to treatment who has received positive test results for these conditions from initial and/or periodic medical examinations. <> OTPs must provide directly, or through referral to adequate and reasonably accessible community resources, vocational training, education, and employment services for patients who request such services or for whom these needs have been identified and mutually agreed-upon as beneficial by the patient and program staff.',
    '<> OTPs must provide counseling on preventing exposure to, and the transmission of, human immunodeficiency virus (HIV), viral hepatitis, and sexually transmitted infections (STIs) and either directly provide services and treatments or actively link to treatment each patient admitted or readmitted to treatment who has received positive test results for these conditions from initial and/or periodic medical examinations. <> OTPs must provide directly, or through referral to adequate and reasonably accessible community resources, vocational training, education, and employment services for patients who request such services or for whom these needs have been identified and mutually agreed-upon as beneficial by the patient and program staff.',
    'c. State Practice - The PECOS record should not be switched to "Approved" until the contractor receives the state\'s approval recommendation. However, if the contractor knows that the state in question generally does not review this type of transaction, the contractor need not send the transaction to the state and shall instead follow the instructions in section 10.6.1.2(B)',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 1.0000, 0.5026],
#         [1.0000, 1.0000, 0.5026],
#         [0.5026, 0.5026, 1.0000]])

Training Details

Training Dataset

Unnamed Dataset

  • Size: 47,056 training samples
  • Columns: sentence_0 and sentence_1
  • Approximate statistics based on the first 100 samples:
    sentence_0 sentence_1
    type string string
    modality text text
    details
    • min: 23 tokens
    • mean: 81.8 tokens
    • max: 225 tokens
    • min: 35 tokens
    • mean: 117.99 tokens
    • max: 225 tokens
  • Samples:
    sentence_0 sentence_1
    <> percent of the site the as determined under paragraph (c)(1) this section; and <> 50 percent the standard Federal prospective rate amount for discharge as determined § 412.523. (1) For section, the discharge payment is a ratio, expressed a percentage, of Medicare that the criteria exclusion site neutral payment rate as under paragraph (a)(2) of to total Medicare discharges under subpart during cost <> 50 percent of the site neutral payment rate amount for the discharge as determined under paragraph (c)(1) of this section; and <> 50 percent of the standard Federal prospective payment rate amount for the discharge as determined under § 412.523. (1) For purposes of this section, the discharge payment percentage is a ratio, expressed as a percentage, of Medicare discharges that meet the criteria for exclusion from the site neutral payment rate as described under paragraph (a)(2) of this section to total Medicare discharges paid under this subpart during the cost reporting period.
    Respirators shall equipped a durable bearing markings which applicant's name, the commercial designation of the and all appropriate approval Respirators shall be equipped with a substantial, durable container bearing markings which show the applicant's name, the type and commercial designation of the respirator it contains and all appropriate approval labels.
    This chapter specifies and procedures to MACs, Recovery Auditors, and the SMRC. The shall instructions to identify verify potential errors to produce the greatest to Medicare Contractors should use analytical methodologies to evaluate potential errors and take administrative unless determined is a priority to the They should archive the error This chapter specifies resources and procedures to the MACs, UPICs, Recovery Auditors, and the SMRC. The contractors shall use these instructions to identify and verify potential errors to produce the greatest protection to the Medicare program. Contractors should objectively use analytical methodologies to evaluate potential errors and not take administrative action unless they have verified the error and determined that the error is a high enough priority to justify the action. They should also archive the error including
  • Loss: DenoisingAutoEncoderLoss with these parameters:
    {
        "decoder_name_or_path": "BAAI/bge-base-en-v1.5",
        "need_retokenization": false
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • num_train_epochs: 8
  • multi_dataset_batch_sampler: round_robin

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • prediction_loss_only: True
  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • 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: 5e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1
  • num_train_epochs: 8
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.0
  • 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: False
  • 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: 0
  • dataloader_prefetch_factor: None
  • past_index: -1
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_min_num_params: 0
  • fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
  • parallelism_config: None
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch_fused
  • 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: False
  • 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: round_robin
  • router_mapping: {}
  • learning_rate_mapping: {}

Training Logs

Epoch Step Training Loss
0.1700 500 7.5851
0.3400 1000 6.3479
0.5100 1500 5.5558
0.6800 2000 4.7201
0.8501 2500 4.28
1.0201 3000 3.9788
1.1901 3500 3.728
1.3601 4000 3.568
1.5301 4500 3.4469
1.7001 5000 3.3317
1.8701 5500 3.2348
2.0401 6000 3.1438
2.2101 6500 3.0118
2.3801 7000 2.9728
2.5502 7500 2.9188
2.7202 8000 2.8691
2.8902 8500 2.8345
3.0602 9000 2.7537
3.2302 9500 2.6734
3.4002 10000 2.6435
3.5702 10500 2.6327
3.7402 11000 2.5934
3.9102 11500 2.5739
4.0802 12000 2.5119
4.2503 12500 2.4507
4.4203 13000 2.4414
4.5903 13500 2.4174
4.7603 14000 2.419
4.9303 14500 2.3955
5.1003 15000 2.3289
5.2703 15500 2.2981
5.4403 16000 2.2936
5.6103 16500 2.2902
5.7803 17000 2.2897
5.9504 17500 2.2659
6.1204 18000 2.2225
6.2904 18500 2.2028
6.4604 19000 2.1958
6.6304 19500 2.205
6.8004 20000 2.2054
6.9704 20500 2.2045
7.1404 21000 2.177
7.3104 21500 2.1662
7.4804 22000 2.1731
7.6505 22500 2.1592
7.8205 23000 2.1557
7.9905 23500 2.1608

Training Time

  • Training: 2.8 hours

Framework Versions

  • Python: 3.12.6
  • Sentence Transformers: 5.6.0
  • Transformers: 4.56.0
  • PyTorch: 2.8.0+cu129
  • Accelerate: 1.10.1
  • Datasets: 5.0.0
  • Tokenizers: 0.22.0

Citation

BibTeX

Sentence Transformers

@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",
}

DenoisingAutoEncoderLoss

@inproceedings{wang-2021-TSDAE,
    title = "TSDAE: Using Transformer-based Sequential Denoising Auto-Encoderfor Unsupervised Sentence Embedding Learning",
    author = "Wang, Kexin and Reimers, Nils and Gurevych, Iryna",
    booktitle = "Findings of the Association for Computational Linguistics: EMNLP 2021",
    month = nov,
    year = "2021",
    address = "Punta Cana, Dominican Republic",
    publisher = "Association for Computational Linguistics",
    pages = "671--688",
    url = "https://arxiv.org/abs/2104.06979",
}
Downloads last month
80
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Komalverma/custom-bge-baai-base-cfr-cms

Finetuned
(479)
this model

Papers for Komalverma/custom-bge-baai-base-cfr-cms