CoolFace
Modelpublic

LeiPricingManager/02262025_fine-tuned-bge-small-optimized

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes87downloads
Model Card

SentenceTransformer based on BAAI/bge-small-en

This is a sentence-transformers model finetuned from BAAI/bge-small-en. 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: BAAI/bge-small-en <!-- at revision 2275a7bdee235e9b4f01fa73aa60d3311983cfea -->
  • —Maximum Sequence Length: 512 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': 512, 'do_lower_case': True}) with Transformer model: BertModel 
  (1): Pooling({'word_embedding_dimension': 384, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
  (2): Normalize()
)

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("sentence_transformers_model_id")
# Run inference
sentences = [
    'Can the 3051s transmitter be ordered with a G½ conduit entry size?',
    'Info for 8700m\n|2 (50)|ASME 600 DERAT. So / RF|8705 020C6|223|223|221|224|223| |165|132|122|126|92| |\n|2 (50)|Din Pn40 So / RF|8705 OzocH|200|200|198|201|200|200|165|132|122|126|102| |\n|2 (50)|AS2129 TABLE D, So / RF| |8705|200| |198|201|200| |50|32|122|126|90|\n|2 (50)|AS2129 TABLE E, So / RF|8705 020CL|200| |198|201|200| |50|132|122|126|90| |\n|2 (50)|JIS B220 10K, So / RF|8705 02CP|200| |198|201|200| |155|132|122|126|96| |\n|2 (50)|JIS B220 20K, So / RF|8705 O2OCR|200| |198|201|200| |55|132|122|126|96| |\n|2 (50)|JIS B220 40K, So / RF|8705 O20CI|223| |22|224|223| |165|32|122|126|105| |\n|2 (50)|AS4087 Pni6_ Sq / RF|8705 020CU|200| |198|201|200| |150|132|122|126|90| |\n|2 (50)|AS4087 Pn2| , So / RF|8705 020CW|200| |198|201|200| |165|132|122|126|103| |\n|2 (50)|AS4087 Pn35 , So / RF|8705 O20cy|200| |198|201|200| |65|132|122|126|103| |\n|2.5 (65)|ASME 150 So / RF|8705 025C1|199| |197| |78|160|136|140|105|12| | |\n|2.5 (65)|ASME 300 So / RF|8705 025c3|199| |197| |19|60|136|140|105|15| | |',
    'Info for 8700m\n# Process connections\n\n|ASME B16.5|Class 150 and Class 300: ½ inch to 24 inch (15 mm to 600 mm)|\n|---|---|\n| |Class 600: ½ inch to 24 inch (15 mm to 600 mm)(1)|\n| |Class 900: 1 inch to 12 inch (25 mm to 300 mm)(2)|\n| |Class 1500: 1½ inch to 12 inch (40 mm to 300 mm)(2)|\n| |1½ inch to 6 inch (40 mm to 150 mm)(2)|\n|ASME B16.47|Class 150: 30 inch to 36 inch (750 mm to 900 mm)|\n| |Class 300: 30 inch to 36 inch (750 mm to 900 mm)|\n|AWWA C207|Class D: 30 inch and 36 inch (750 mm and 900 mm)|\n|MSS SP44|Class 150: 30 inch to 36 inch (750 mm to 900 mm)|\n|EN 1092-1|PN10: 200 mm to 900 mm (8 inch to 36 inch)|\n| |PN16: 100 mm to 900 mm (4 inch to 36 inch)|\n| |PN25: 200 mm to 900 mm (8 inch to 36 inch)|\n| |PN40: 15 mm to 900 mm (½ inch to 36 inch)|\n|AS2129|Table D and Table E: 15 mm to 900 mm (½ inch to 36 inch)|\n|AS4087|PN16, PN21, PN35: 50 mm to 600 mm (2 inch to 24 inch)|\n|JIS B2220|10K, 20K, 40K: 15 mm to 200 mm (½ inch to 8 inch)|',
]
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

Semantic Similarity
MetricValue
pearson_cosine0.8612
spearman_cosine0.7357

<!--

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: 41,760 training samples
  • —Columns: <code>sentence0</code>, <code>sentence1</code>, and <code>label</code>
  • —Approximate statistics based on the first 1000 samples: | | sentence0 | sentence1 | label | |:--------|:-----------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|:---------------------------------------------------------------| | type | string | string | float | | details | <ul><li>min: 12 tokens</li><li>mean: 20.93 tokens</li><li>max: 46 tokens</li></ul> | <ul><li>min: 16 tokens</li><li>mean: 304.51 tokens</li><li>max: 512 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.25</li><li>max: 1.0</li></ul> |
  • —Samples: | sentence0 | sentence1 | label | |:---------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------| | <code>How much does the 8705 240CE model weigh in the DIN PNI6 So / RF setup?</code> | <code>Info for 3051s<br># Process connection size<br><br>|Code|ASME B16.5|EN 1092-1/GOST 33259-15|JIS B2238|<br>|---|---|---|---|<br>|2|1-in.|N/A|25A|<br>|4|1½-in.|N/A|40A|<br><br># Flange/pressure rating<br><br># Materials of construction<br><br>|Code|Isolating diaphragm|Upper housing|Flange|<br>|---|---|---|---|<br>|CA(1)|316L SST|316L SST|CS|<br>|DA|316L SST|316L SST|316 SST|<br>|CB(1)|Alloy C-276|316L SST|CS|<br>|DB|Alloy C-276|316L SST|316 SST|<br>|D5|Duplex 2507 SST|316L SST|316 SST|<br><br>(1) Not available with stud bolt design.<br><br># Flushing connection ring material (lower housing)<br><br>If no intermediate gasket material is selected, a Klingersil C-4401 aramid fiber gasket will be supplied. Lower housings are shipped loose and are not included in option P1 for hydrostatic pressure testing.<br><br>|Code|Description|<br>|---|---|<br>|A|316L SST|<br>|B|Alloy C-276|<br>---<br># Flushing connection quantity and size</code> | <code>0.0</code> | | <code>What type of instrument flange is used for the Rosemount 3051ST with F11 code?</code> | <code>Info for 3051s<br># Electrical connections<br><br>½–14 NPT, G½, and M20 × 1½ conduit. HART® interface connections fixed to terminal block for Output code A and X.<br><br># Process connections<br><br>Coplanar sensor module (Rosemount 3051SC, 3051SMV, 3051SF, 3051SAM G or A)<br><br>|Standard|¼–18 NPT on 2⅛-in. centers|<br>|---|---|<br>|Flange Adapters|½–14 NPT and RC½ on 2-in. (50.8 mm), 2⅛-in. (54.0 mm), or 2¼-in. (57.2 mm) centers|<br>---<br># In-line sensor module (Rosemount 3051ST, 3051SAM _T or E)<br><br>|Standard|½–14 NPT female|<br>|---|---|<br>|F11 Code|Non-threaded instrument flange (available in SST for sensor ranges 1–4 only)|<br>|G11 Code|G½ A DIN 16288 male (available in SST for sensor ranges 1–4 only)|<br>|H11 Code|Autoclave type F-250C (Pressure relieved 9⁄16–18 gland thread; ¼ OD high pressure tube 60° cone; available in SST for sensor range 5 only)|<br><br># Level transmitter (Rosemount 3051SAL)</code> | <code>1.0</code> | | <code>I need info on the 8700m sensor with ASME -1500 WN / RTJ, can you help?</code> | <code>Info for 8700m<br>|(350) JIS B2200 20k, So / RF|8705 140CR|23.16| |22.96|23.05|23.08| |21.26|18.92|1.83|1.82|17.32|2.00|385|<br>|(350) JIS B2200 40k, So / RF|8705 140CT|25.74| |25.54|25.64| |23.03|18.92|1.83|11.82|17.91|2.00|702| |<br>|(350) AS4087 Pni6 So / RF|8705 140CU|20.91| |20.71|20.80|20.83| |20.67|18.92|1.83|1.82|17.24|2.00|219|<br>|(350) AS4087 Pn2 | So / RF|8705 140CW|20.91| |20.71|20.80|20.83| |21.65|18.92|1.83|1.82|18.07|2.00|294|<br>|(350) AS4087 Pn35, So / RF|8705 140CY|23.16| |22.96|23.05|23.08| |21.65|18.92|1.83|1.82|16.50|2.00|497|<br>|(400) ASME 150 So / RF|8705 160C|23.88|23.90|23.68|23.77|23.80| |23.50|20.94|12.84|12.83|18.50|3.13|388|<br>|(400) ASME 300 So / RF|8705 160C3|26.13| |25.93|26.02|26.05| |25.50|20.94|12.84|12.83|18.50|3.13|705|<br>|(400) ASME 600 DERAT, So / RF|8705 160C6|29.24| | |27.00|20.94|12.84|12.83|18.50|3.13| |102| | |<br>|(400) DN PNI O So /RF|8705 16OCD|23.88|23.90|23.68|23.77|23.80| |22.24|20.94|12.84|12.83|18.98|3.13|38|</code> | <code>0.0</code> |
  • —Loss: <code>MultipleNegativesRankingLoss</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: 64
  • —per_device_eval_batch_size: 64
  • —num_train_epochs: 6
  • —multi_dataset_batch_sampler: round_robin
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: 64
  • —per_device_eval_batch_size: 64
  • —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: 6
  • —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: {'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
  • —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
  • —dispatch_batches: None
  • —split_batches: 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
  • —eval_use_gather_object: False
  • —average_tokens_across_devices: False
  • —prompts: None
  • —batch_sampler: batch_sampler
  • —multi_dataset_batch_sampler: round_robin

</details>

Training Logs

EpochStepTraining Lossvalid_spearman_cosine
0.2496163-0.7010
0.4992326-0.7209
0.7489489-0.7259
0.76575003.9185-
0.9985652-0.7252
1.0653-0.7253
1.2481815-0.7285
1.4977978-0.7321
1.531410003.7874-
1.74731141-0.7300
1.99691304-0.7333
2.01306-0.7332
2.24661467-0.7304
2.297115003.7241-
2.49621630-0.7293
2.74581793-0.7357

Framework Versions

  • —Python: 3.11.11
  • —Sentence Transformers: 3.4.1
  • —Transformers: 4.48.3
  • —PyTorch: 2.5.1+cu124
  • —Accelerate: 1.3.0
  • —Datasets: 3.3.2
  • —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",
}
MultipleNegativesRankingLoss
bibtex
@misc{henderson2017efficient,
    title={Efficient Natural Language Response Suggestion for Smart Reply},
    author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
    year={2017},
    eprint={1705.00652},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}

<!--

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. -->