SentenceTransformer based on sentence-transformers/all-MiniLM-L6-v2

This is a sentence-transformers model finetuned from sentence-transformers/all-MiniLM-L6-v2 on the homedepot-search-anchor-positive-title-only dataset. 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 Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 256, 'do_lower_case': False, 'architecture': '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})
  (2): Normalize()
)

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("zhenqingli/all-MiniLM-L6-v2-ft-home-depot-positive-only")
# Run inference
sentences = [
    'canopy',
    'Sunjoy Mojave 8 ft. x 5 ft. Steel Fabric Grill Gazebo',
    'Creek Pecan Tree',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]

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

Evaluation

Metrics

Semantic Similarity

Metric Value
pearson_cosine 0.3941
spearman_cosine 0.3677

Training Details

Training Dataset

homedepot-search-anchor-positive-title-only

  • Dataset: homedepot-search-anchor-positive-title-only at 72eb0c2
  • Size: 66,660 training samples
  • Columns: sentence1 and sentence2
  • Approximate statistics based on the first 1000 samples:
    sentence1 sentence2
    type string string
    details
    • min: 3 tokens
    • mean: 6.62 tokens
    • max: 24 tokens
    • min: 5 tokens
    • mean: 20.24 tokens
    • max: 47 tokens
  • Samples:
    sentence1 sentence2
    ridiing lawnmower Cub Cadet XT1 Enduro Series LT 42 in. 18 HP Kohler Hydrostatic Gas Front-Engine Riding Mower
    weather vanes Olympia 24 in. x 24 in. x 62 in. Composite Vinyl Cupola with Copper Roof and Weathervane
    ryobi 24v Ryobi 24-Volt Lithium-Ion Cordless String Trimmer/Edger with 24 in. Hedge Trimmer and 2 Batteries
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim",
        "gather_across_devices": false
    }
    

Evaluation Dataset

homedepot-search-anchor-positive-title-only

  • Dataset: homedepot-search-anchor-positive-title-only at 72eb0c2
  • Size: 7,407 evaluation samples
  • Columns: sentence1 and sentence2
  • Approximate statistics based on the first 1000 samples:
    sentence1 sentence2
    type string string
    details
    • min: 3 tokens
    • mean: 6.34 tokens
    • max: 17 tokens
    • min: 5 tokens
    • mean: 20.04 tokens
    • max: 51 tokens
  • Samples:
    sentence1 sentence2
    bathroom sinks, double KOHLER Ceramic/Impression 61 in. Vitreous China Double Vanity Top with Basin in White Impressions
    desoldering vacum pump Aven Desoldering Pump with High Impact Plastic
    steel shelving Edsal 36 in. W x 18 in. D x 72 in. H Steel Commercial Shelving Unit
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim",
        "gather_across_devices": false
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: epoch
  • num_train_epochs: 10
  • load_best_model_at_end: True
  • batch_sampler: no_duplicates

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: epoch
  • prediction_loss_only: True
  • per_device_train_batch_size: 8
  • 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: 5e-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: 10
  • 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: True
  • 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: no_duplicates
  • multi_dataset_batch_sampler: proportional
  • router_mapping: {}
  • learning_rate_mapping: {}

Training Logs

Click to expand
Epoch Step Training Loss Validation Loss homedepot_eval_spearman_cosine
0.0120 100 0.2465 - -
0.0240 200 0.2688 - -
0.0360 300 0.2444 - -
0.0480 400 0.1832 - -
0.0600 500 0.2517 - -
0.0720 600 0.2352 - -
0.0840 700 0.1968 - -
0.0960 800 0.227 - -
0.1080 900 0.2342 - -
0.1200 1000 0.2433 - -
0.1320 1100 0.1859 - -
0.1440 1200 0.2542 - -
0.1560 1300 0.2137 - -
0.1680 1400 0.1866 - -
0.1800 1500 0.1791 - -
0.1920 1600 0.1776 - -
0.2040 1700 0.1806 - -
0.2160 1800 0.2258 - -
0.2280 1900 0.1834 - -
0.2400 2000 0.1499 - -
0.2520 2100 0.1587 - -
0.2640 2200 0.1828 - -
0.2760 2300 0.1855 - -
0.2880 2400 0.1919 - -
0.3000 2500 0.1573 - -
0.3120 2600 0.1777 - -
0.3240 2700 0.1958 - -
0.3360 2800 0.1663 - -
0.3480 2900 0.1883 - -
0.3600 3000 0.2215 - -
0.3720 3100 0.1518 - -
0.3840 3200 0.1392 - -
0.3960 3300 0.1261 - -
0.4080 3400 0.1867 - -
0.4200 3500 0.163 - -
0.4320 3600 0.1924 - -
0.4440 3700 0.173 - -
0.4560 3800 0.1699 - -
0.4680 3900 0.1479 - -
0.4800 4000 0.1457 - -
0.4920 4100 0.2051 - -
0.5040 4200 0.1768 - -
0.5160 4300 0.1328 - -
0.5280 4400 0.182 - -
0.5400 4500 0.1587 - -
0.5520 4600 0.2071 - -
0.5640 4700 0.1627 - -
0.5760 4800 0.1497 - -
0.5880 4900 0.1473 - -
0.6000 5000 0.164 - -
0.6120 5100 0.1353 - -
0.6240 5200 0.1554 - -
0.6360 5300 0.1448 - -
0.6480 5400 0.1313 - -
0.6600 5500 0.1469 - -
0.6720 5600 0.1168 - -
0.6840 5700 0.136 - -
0.6960 5800 0.1255 - -
0.7080 5900 0.1428 - -
0.7200 6000 0.1263 - -
0.7320 6100 0.1477 - -
0.7440 6200 0.1774 - -
0.7560 6300 0.1409 - -
0.7680 6400 0.1352 - -
0.7800 6500 0.1508 - -
0.7920 6600 0.1127 - -
0.8040 6700 0.1422 - -
0.8160 6800 0.1393 - -
0.8280 6900 0.1276 - -
0.8400 7000 0.1457 - -
0.8520 7100 0.1195 - -
0.8640 7200 0.1459 - -
0.8760 7300 0.1041 - -
0.8880 7400 0.1657 - -
0.9000 7500 0.1331 - -
0.9120 7600 0.1116 - -
0.9240 7700 0.1166 - -
0.9360 7800 0.1252 - -
0.9480 7900 0.106 - -
0.9600 8000 0.1201 - -
0.9720 8100 0.0966 - -
0.9840 8200 0.119 - -
0.9960 8300 0.1433 - -
1.0 8333 - 0.1188 0.3844
1.0080 8400 0.0692 - -
1.0200 8500 0.0918 - -
1.0320 8600 0.0851 - -
1.0440 8700 0.0792 - -
1.0560 8800 0.0843 - -
1.0680 8900 0.0832 - -
1.0800 9000 0.0682 - -
1.0920 9100 0.0854 - -
1.1040 9200 0.0819 - -
1.1160 9300 0.0711 - -
1.1280 9400 0.0886 - -
1.1400 9500 0.1026 - -
1.1520 9600 0.0764 - -
1.1640 9700 0.076 - -
1.1760 9800 0.0933 - -
1.1880 9900 0.0828 - -
1.2000 10000 0.1089 - -
1.2120 10100 0.063 - -
1.2240 10200 0.1106 - -
1.2360 10300 0.075 - -
1.2480 10400 0.0856 - -
1.2601 10500 0.097 - -
1.2721 10600 0.0653 - -
1.2841 10700 0.0702 - -
1.2961 10800 0.078 - -
1.3081 10900 0.0901 - -
1.3201 11000 0.0742 - -
1.3321 11100 0.0863 - -
1.3441 11200 0.0701 - -
1.3561 11300 0.0946 - -
1.3681 11400 0.0901 - -
1.3801 11500 0.0774 - -
1.3921 11600 0.0531 - -
1.4041 11700 0.0747 - -
1.4161 11800 0.0873 - -
1.4281 11900 0.0755 - -
1.4401 12000 0.0947 - -
1.4521 12100 0.1054 - -
1.4641 12200 0.0753 - -
1.4761 12300 0.1014 - -
1.4881 12400 0.0724 - -
1.5001 12500 0.0722 - -
1.5121 12600 0.071 - -
1.5241 12700 0.0765 - -
1.5361 12800 0.0731 - -
1.5481 12900 0.0799 - -
1.5601 13000 0.1066 - -
1.5721 13100 0.0537 - -
1.5841 13200 0.0978 - -
1.5961 13300 0.0891 - -
1.6081 13400 0.0587 - -
1.6201 13500 0.0736 - -
1.6321 13600 0.0926 - -
1.6441 13700 0.0586 - -
1.6561 13800 0.0603 - -
1.6681 13900 0.0898 - -
1.6801 14000 0.1111 - -
1.6921 14100 0.0889 - -
1.7041 14200 0.1008 - -
1.7161 14300 0.1004 - -
1.7281 14400 0.0845 - -
1.7401 14500 0.0993 - -
1.7521 14600 0.081 - -
1.7641 14700 0.0906 - -
1.7761 14800 0.1068 - -
1.7881 14900 0.0715 - -
1.8001 15000 0.0805 - -
1.8121 15100 0.0807 - -
1.8241 15200 0.093 - -
1.8361 15300 0.0921 - -
1.8481 15400 0.083 - -
1.8601 15500 0.088 - -
1.8721 15600 0.0932 - -
1.8841 15700 0.0786 - -
1.8961 15800 0.0653 - -
1.9081 15900 0.0833 - -
1.9201 16000 0.0989 - -
1.9321 16100 0.0853 - -
1.9441 16200 0.0656 - -
1.9561 16300 0.0775 - -
1.9681 16400 0.0605 - -
1.9801 16500 0.0802 - -
1.9921 16600 0.075 - -
2.0 16666 - 0.0885 0.3778
2.0041 16700 0.0621 - -
2.0161 16800 0.0554 - -
2.0281 16900 0.0493 - -
2.0401 17000 0.0805 - -
2.0521 17100 0.0516 - -
2.0641 17200 0.0503 - -
2.0761 17300 0.0624 - -
2.0881 17400 0.0599 - -
2.1001 17500 0.0532 - -
2.1121 17600 0.052 - -
2.1241 17700 0.0469 - -
2.1361 17800 0.0458 - -
2.1481 17900 0.0399 - -
2.1601 18000 0.0629 - -
2.1721 18100 0.0716 - -
2.1841 18200 0.06 - -
2.1961 18300 0.0309 - -
2.2081 18400 0.0365 - -
2.2201 18500 0.0542 - -
2.2321 18600 0.0584 - -
2.2441 18700 0.0686 - -
2.2561 18800 0.0473 - -
2.2681 18900 0.0564 - -
2.2801 19000 0.0431 - -
2.2921 19100 0.0557 - -
2.3041 19200 0.0414 - -
2.3161 19300 0.0528 - -
2.3281 19400 0.0578 - -
2.3401 19500 0.0552 - -
2.3521 19600 0.0546 - -
2.3641 19700 0.0448 - -
2.3761 19800 0.0656 - -
2.3881 19900 0.0466 - -
2.4001 20000 0.0498 - -
2.4121 20100 0.0563 - -
2.4241 20200 0.0384 - -
2.4361 20300 0.0254 - -
2.4481 20400 0.0461 - -
2.4601 20500 0.0492 - -
2.4721 20600 0.0514 - -
2.4841 20700 0.0503 - -
2.4961 20800 0.0649 - -
2.5081 20900 0.0617 - -
2.5201 21000 0.0446 - -
2.5321 21100 0.055 - -
2.5441 21200 0.0606 - -
2.5561 21300 0.05 - -
2.5681 21400 0.043 - -
2.5801 21500 0.0585 - -
2.5921 21600 0.0519 - -
2.6041 21700 0.0717 - -
2.6161 21800 0.0516 - -
2.6281 21900 0.0631 - -
2.6401 22000 0.0397 - -
2.6521 22100 0.045 - -
2.6641 22200 0.0412 - -
2.6761 22300 0.0455 - -
2.6881 22400 0.0556 - -
2.7001 22500 0.0475 - -
2.7121 22600 0.0428 - -
2.7241 22700 0.053 - -
2.7361 22800 0.0552 - -
2.7481 22900 0.0542 - -
2.7601 23000 0.039 - -
2.7721 23100 0.0535 - -
2.7841 23200 0.0558 - -
2.7961 23300 0.0503 - -
2.8081 23400 0.0371 - -
2.8201 23500 0.0497 - -
2.8321 23600 0.037 - -
2.8441 23700 0.0598 - -
2.8561 23800 0.0504 - -
2.8681 23900 0.0501 - -
2.8801 24000 0.0375 - -
2.8921 24100 0.0425 - -
2.9041 24200 0.0447 - -
2.9161 24300 0.0408 - -
2.9281 24400 0.0618 - -
2.9401 24500 0.0504 - -
2.9521 24600 0.0585 - -
2.9641 24700 0.0432 - -
2.9761 24800 0.0403 - -
2.9881 24900 0.0483 - -
3.0 24999 - 0.0845 0.3677
  • The bold row denotes the saved checkpoint.

Framework Versions

  • Python: 3.11.5
  • Sentence Transformers: 5.1.0
  • Transformers: 4.56.1
  • PyTorch: 2.8.0+cu128
  • Accelerate: 1.10.1
  • Datasets: 4.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",
}

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}
}
Downloads last month
1
Safetensors
Model size
22.7M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for zhenqingli/all-MiniLM-L6-v2-ft-home-depot-positive-only

Finetuned
(822)
this model

Dataset used to train zhenqingli/all-MiniLM-L6-v2-ft-home-depot-positive-only

Papers for zhenqingli/all-MiniLM-L6-v2-ft-home-depot-positive-only

Evaluation results