LeiPricingManager/02262025_fine-tuned-bge-small-optimized
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
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
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:
pip install -U sentence-transformersThen 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 = [
'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
- Dataset:
valid - Evaluated with <code>EmbeddingSimilarityEvaluator</code>
<!--
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:
{
"scale": 20.0,
"similarity_fct": "cos_sim"
}Training Hyperparameters
Non-Default Hyperparameters
eval_strategy: stepsper_device_train_batch_size: 64per_device_eval_batch_size: 64num_train_epochs: 6multi_dataset_batch_sampler: round_robin
All Hyperparameters
<details><summary>Click to expand</summary>
overwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 64per_device_eval_batch_size: 64per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 5e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1num_train_epochs: 6max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.0warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseno_cuda: Falseuse_cpu: Falseuse_mps_device: Falseseed: 42data_seed: Nonejit_mode_eval: Falseuse_ipex: Falsebf16: Falsefp16: Falsefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Falseignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}deepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torchoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Trueuse_legacy_prediction_loop: Falsepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Nonehub_always_push: Falsegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseinclude_for_metrics: []eval_do_concat_batches: Truefp16_backend: autopush_to_hub_model_id: Nonepush_to_hub_organization: Nonemp_parameters:auto_find_batch_size: Falsefull_determinism: Falsetorchdynamo: Noneray_scope: lastddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Nonedispatch_batches: Nonesplit_batches: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseeval_use_gather_object: Falseaverage_tokens_across_devices: Falseprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: round_robin
</details>
Training Logs
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
@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
@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. -->
