CoolFace
Modelpublic

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

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

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:

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("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]])

<!--

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.3941
spearman_cosine0.3677

<!--

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

homedepot-search-anchor-positive-title-only
  • —Dataset: homedepot-search-anchor-positive-title-only at 72eb0c2
  • —Size: 66,660 training samples
  • —Columns: <code>sentence1</code> and <code>sentence2</code>
  • —Approximate statistics based on the first 1000 samples: | | sentence1 | sentence2 | |:--------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 3 tokens</li><li>mean: 6.62 tokens</li><li>max: 24 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 20.24 tokens</li><li>max: 47 tokens</li></ul> |
  • —Samples: | sentence1 | sentence2 | |:-------------------------------|:---------------------------------------------------------------------------------------------------------------| | <code>ridiing lawnmower</code> | <code>Cub Cadet XT1 Enduro Series LT 42 in. 18 HP Kohler Hydrostatic Gas Front-Engine Riding Mower</code> | | <code>weather vanes</code> | <code>Olympia 24 in. x 24 in. x 62 in. Composite Vinyl Cupola with Copper Roof and Weathervane</code> | | <code>ryobi 24v</code> | <code>Ryobi 24-Volt Lithium-Ion Cordless String Trimmer/Edger with 24 in. Hedge Trimmer and 2 Batteries</code> |
  • —Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "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: <code>sentence1</code> and <code>sentence2</code>
  • —Approximate statistics based on the first 1000 samples: | | sentence1 | sentence2 | |:--------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 3 tokens</li><li>mean: 6.34 tokens</li><li>max: 17 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 20.04 tokens</li><li>max: 51 tokens</li></ul> |
  • —Samples: | sentence1 | sentence2 | |:------------------------------------|:---------------------------------------------------------------------------------------------------------------| | <code>bathroom sinks, double</code> | <code>KOHLER Ceramic/Impression 61 in. Vitreous China Double Vanity Top with Basin in White Impressions</code> | | <code>desoldering vacum pump</code> | <code>Aven Desoldering Pump with High Impact Plastic</code> | | <code>steel shelving</code> | <code>Edsal 36 in. W x 18 in. D x 72 in. H Steel Commercial Shelving Unit</code> |
  • —Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "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

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

  • —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: {'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}
  • —parallelism_config: None
  • —deepspeed: None
  • —label_smoothing_factor: 0.0
  • —optim: adamwtorchfused
  • —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: {}

</details>

Training Logs

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

EpochStepTraining LossValidation Losshomedepot_eval_spearman_cosine
0.01201000.2465--
0.02402000.2688--
0.03603000.2444--
0.04804000.1832--
0.06005000.2517--
0.07206000.2352--
0.08407000.1968--
0.09608000.227--
0.10809000.2342--
0.120010000.2433--
0.132011000.1859--
0.144012000.2542--
0.156013000.2137--
0.168014000.1866--
0.180015000.1791--
0.192016000.1776--
0.204017000.1806--
0.216018000.2258--
0.228019000.1834--
0.240020000.1499--
0.252021000.1587--
0.264022000.1828--
0.276023000.1855--
0.288024000.1919--
0.300025000.1573--
0.312026000.1777--
0.324027000.1958--
0.336028000.1663--
0.348029000.1883--
0.360030000.2215--
0.372031000.1518--
0.384032000.1392--
0.396033000.1261--
0.408034000.1867--
0.420035000.163--
0.432036000.1924--
0.444037000.173--
0.456038000.1699--
0.468039000.1479--
0.480040000.1457--
0.492041000.2051--
0.504042000.1768--
0.516043000.1328--
0.528044000.182--
0.540045000.1587--
0.552046000.2071--
0.564047000.1627--
0.576048000.1497--
0.588049000.1473--
0.600050000.164--
0.612051000.1353--
0.624052000.1554--
0.636053000.1448--
0.648054000.1313--
0.660055000.1469--
0.672056000.1168--
0.684057000.136--
0.696058000.1255--
0.708059000.1428--
0.720060000.1263--
0.732061000.1477--
0.744062000.1774--
0.756063000.1409--
0.768064000.1352--
0.780065000.1508--
0.792066000.1127--
0.804067000.1422--
0.816068000.1393--
0.828069000.1276--
0.840070000.1457--
0.852071000.1195--
0.864072000.1459--
0.876073000.1041--
0.888074000.1657--
0.900075000.1331--
0.912076000.1116--
0.924077000.1166--
0.936078000.1252--
0.948079000.106--
0.960080000.1201--
0.972081000.0966--
0.984082000.119--
0.996083000.1433--
1.08333-0.11880.3844
1.008084000.0692--
1.020085000.0918--
1.032086000.0851--
1.044087000.0792--
1.056088000.0843--
1.068089000.0832--
1.080090000.0682--
1.092091000.0854--
1.104092000.0819--
1.116093000.0711--
1.128094000.0886--
1.140095000.1026--
1.152096000.0764--
1.164097000.076--
1.176098000.0933--
1.188099000.0828--
1.2000100000.1089--
1.2120101000.063--
1.2240102000.1106--
1.2360103000.075--
1.2480104000.0856--
1.2601105000.097--
1.2721106000.0653--
1.2841107000.0702--
1.2961108000.078--
1.3081109000.0901--
1.3201110000.0742--
1.3321111000.0863--
1.3441112000.0701--
1.3561113000.0946--
1.3681114000.0901--
1.3801115000.0774--
1.3921116000.0531--
1.4041117000.0747--
1.4161118000.0873--
1.4281119000.0755--
1.4401120000.0947--
1.4521121000.1054--
1.4641122000.0753--
1.4761123000.1014--
1.4881124000.0724--
1.5001125000.0722--
1.5121126000.071--
1.5241127000.0765--
1.5361128000.0731--
1.5481129000.0799--
1.5601130000.1066--
1.5721131000.0537--
1.5841132000.0978--
1.5961133000.0891--
1.6081134000.0587--
1.6201135000.0736--
1.6321136000.0926--
1.6441137000.0586--
1.6561138000.0603--
1.6681139000.0898--
1.6801140000.1111--
1.6921141000.0889--
1.7041142000.1008--
1.7161143000.1004--
1.7281144000.0845--
1.7401145000.0993--
1.7521146000.081--
1.7641147000.0906--
1.7761148000.1068--
1.7881149000.0715--
1.8001150000.0805--
1.8121151000.0807--
1.8241152000.093--
1.8361153000.0921--
1.8481154000.083--
1.8601155000.088--
1.8721156000.0932--
1.8841157000.0786--
1.8961158000.0653--
1.9081159000.0833--
1.9201160000.0989--
1.9321161000.0853--
1.9441162000.0656--
1.9561163000.0775--
1.9681164000.0605--
1.9801165000.0802--
1.9921166000.075--
2.016666-0.08850.3778
2.0041167000.0621--
2.0161168000.0554--
2.0281169000.0493--
2.0401170000.0805--
2.0521171000.0516--
2.0641172000.0503--
2.0761173000.0624--
2.0881174000.0599--
2.1001175000.0532--
2.1121176000.052--
2.1241177000.0469--
2.1361178000.0458--
2.1481179000.0399--
2.1601180000.0629--
2.1721181000.0716--
2.1841182000.06--
2.1961183000.0309--
2.2081184000.0365--
2.2201185000.0542--
2.2321186000.0584--
2.2441187000.0686--
2.2561188000.0473--
2.2681189000.0564--
2.2801190000.0431--
2.2921191000.0557--
2.3041192000.0414--
2.3161193000.0528--
2.3281194000.0578--
2.3401195000.0552--
2.3521196000.0546--
2.3641197000.0448--
2.3761198000.0656--
2.3881199000.0466--
2.4001200000.0498--
2.4121201000.0563--
2.4241202000.0384--
2.4361203000.0254--
2.4481204000.0461--
2.4601205000.0492--
2.4721206000.0514--
2.4841207000.0503--
2.4961208000.0649--
2.5081209000.0617--
2.5201210000.0446--
2.5321211000.055--
2.5441212000.0606--
2.5561213000.05--
2.5681214000.043--
2.5801215000.0585--
2.5921216000.0519--
2.6041217000.0717--
2.6161218000.0516--
2.6281219000.0631--
2.6401220000.0397--
2.6521221000.045--
2.6641222000.0412--
2.6761223000.0455--
2.6881224000.0556--
2.7001225000.0475--
2.7121226000.0428--
2.7241227000.053--
2.7361228000.0552--
2.7481229000.0542--
2.7601230000.039--
2.7721231000.0535--
2.7841232000.0558--
2.7961233000.0503--
2.8081234000.0371--
2.8201235000.0497--
2.8321236000.037--
2.8441237000.0598--
2.8561238000.0504--
2.8681239000.0501--
2.8801240000.0375--
2.8921241000.0425--
2.9041242000.0447--
2.9161243000.0408--
2.9281244000.0618--
2.9401245000.0504--
2.9521246000.0585--
2.9641247000.0432--
2.9761248000.0403--
2.9881249000.0483--
3.024999-0.08450.3677
  • —The bold row denotes the saved checkpoint. </details>

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