eric920609's picture
Upload trained model
1538fd3 verified
metadata
tags:
  - sentence-transformers
  - sentence-similarity
  - feature-extraction
  - dense
  - generated_from_trainer
  - dataset_size:69363
  - loss:EpochLossWrapper
base_model: intfloat/multilingual-e5-large
widget:
  - source_sentence: >-
      query: MSI 微星 MSI PRO MP165 E6 可攜式螢幕 (16型/FHD/Type C/喇叭/IPS)+SPACE
      LED觸控護眼三色螢幕掛燈 33cm款
    sentences:
      - 'passage: 六合一清潔組【Apple】AirPods 4'
      - >-
        passage: 【MSI 微星】PRO MP251 E2 25型
        平面商用螢幕(FHD/IPS/120Hz/DP+HDMI+D-Sub/眼部護理技術)
      - 'passage: 【Apple】Apple Watch Series 11 GPS+行動網路 42mm(鋁金屬錶殼搭配運動型錶帶)'
  - source_sentence: 'query: DAIKIN 大金 7坪閃流放電空氣清淨機 MC30YSCT'
    sentences:
      - 'passage: 三合一充電座組【Apple】Apple Watch Ultra 3 GPS+行動網路 49mm(鈦金屬錶殼搭配越野錶環)'
      - 'passage: 【LG 樂金】58H快配17公斤◆AI DD™智慧直驅變頻洗衣機 ◆曜石黑(WT-VDN17M)'
      - 'passage: 【LG 樂金】PuriCare Hit 一級能效 超淨化 大白 抗敏 空氣 清淨機 適用18坪 / 台 AS601HWG0'
  - source_sentence: 'query: Logitech 羅技 G304 LIGHTSPEED 無線電競遊戲滑鼠 黑色'
    sentences:
      - 'passage: 【grantclassic】6入濾心套餐組 喝不停 AquaLux 寵物智能陶瓷飲水機 + 6入專用濾心(2L/官方品牌館)'
      - 'passage: 【Logitech 羅技】M190無線滑鼠(黑色)'
      - >-
        passage: 【beyerdynamic】DT 71 IE 鼓組&貝斯 入耳式監聽耳機 #劇院視聽 #HIFI #高解析音質
        #有線耳機(公司貨保證)
  - source_sentence: 'query: KINTO / TRAVEL TUMBLER 隨行保溫瓶500ml-灰'
    sentences:
      - 'passage: 【小不記】1080P旗艦款-多媒體投影儀 4K畫質智慧投影機 LED鏡像同屏(家用投影機 露營投影機 投影機)'
      - 'passage: 手提陶瓷咖啡保溫杯500ml(內附吸管/五色任選/保冰杯/保溫杯/減塑/保溫瓶)'
      - >-
        passage: 【技嘉】顯卡+電源組合★ RTX 5080 GAMING OC 16G 顯示卡+海韻 ATX3 Core GX-850
        金牌電源供應器
  - source_sentence: 'query: PHILIPS 飛利浦 Sonicare 智慧感應型電動牙刷 新月白 (HX6877/27)'
    sentences:
      - >-
        passage: 【MSI 微星】MSI 微星 MAG 274UPDF E16M 電競螢幕 27吋 160Hz 4k IPS 0.5ms HDR
        可旋轉
      - 'passage: 【SHARP 夏普】12公升 自動除菌離子除濕機(DW-LT12ST-W)'
      - 'passage: 【Philips 飛利浦】官方直Sonicare抗敏Pro 鑽石智能音波電動牙刷/護敏刷HX3892/02(雙入組)'
pipeline_tag: sentence-similarity
library_name: sentence-transformers

SentenceTransformer based on intfloat/multilingual-e5-large

This is a sentence-transformers model finetuned from intfloat/multilingual-e5-large. It maps sentences & paragraphs to a 1024-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: intfloat/multilingual-e5-large
  • Maximum Sequence Length: 128 tokens
  • Output Dimensionality: 1024 dimensions
  • Similarity Function: Cosine Similarity

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 128, 'do_lower_case': False, 'architecture': 'XLMRobertaModel'})
  (1): Pooling({'word_embedding_dimension': 1024, '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("sentence_transformers_model_id")
# Run inference
sentences = [
    'query: PHILIPS 飛利浦 Sonicare 智慧感應型電動牙刷 新月白 (HX6877/27)',
    'passage: 【Philips 飛利浦】官方直Sonicare抗敏Pro 鑽石智能音波電動牙刷/護敏刷HX3892/02(雙入組)',
    'passage: 【SHARP 夏普】12公升 自動除菌離子除濕機(DW-LT12ST-W)',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]

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

Training Details

Training Dataset

Unnamed Dataset

  • Size: 69,363 training samples
  • Columns: sentence_0, sentence_1, and label
  • Approximate statistics based on the first 1000 samples:
    sentence_0 sentence_1 label
    type string string int
    details
    • min: 9 tokens
    • mean: 30.67 tokens
    • max: 86 tokens
    • min: 15 tokens
    • mean: 35.13 tokens
    • max: 61 tokens
    • 0: ~95.50%
    • 1: ~4.50%
  • Samples:
    sentence_0 sentence_1 label
    query: Logitech 羅技 M221 靜音無線滑鼠-黑 passage: 【Logitech 羅技】Pebble M350s 無線藍牙滑鼠 - 珍珠白(不附接收器) 0
    query: Kleenex 舒潔 萬用輕巧包抽取衛生紙(110+20抽x20包/串) passage: 【Kleenex 舒潔】棉柔舒適抽取衛生紙110抽*60包 0
    query: Apple 蘋果 Apple Watch Series 11 GPS + LTE 46mm 玫瑰金色鋁金屬錶殼搭配淡胭粉色運動錶帶 passage: 【Apple】Apple Watch S11 GPS + 行動網路 46mm(鋁金屬錶殼搭配運動型錶帶) 0
  • Loss: main.EpochLossWrapper

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 32
  • per_device_eval_batch_size: 32
  • num_train_epochs: 15
  • fp16: True
  • multi_dataset_batch_sampler: round_robin

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: steps
  • prediction_loss_only: True
  • per_device_train_batch_size: 32
  • per_device_eval_batch_size: 32
  • 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: 15
  • 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
  • bf16: False
  • fp16: True
  • 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
  • project: huggingface
  • trackio_space_id: trackio
  • 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: no
  • 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: True
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: round_robin
  • router_mapping: {}
  • learning_rate_mapping: {}

Training Logs

Epoch Step Training Loss
0.2306 500 0.0168
0.4613 1000 0.0042
0.6919 1500 0.0033
0.9225 2000 0.0033
1.0 2168 -

Framework Versions

  • Python: 3.11.14
  • Sentence Transformers: 5.1.1
  • Transformers: 4.57.1
  • PyTorch: 2.9.0+cu128
  • Accelerate: 1.10.1
  • Datasets: 4.2.0
  • Tokenizers: 0.22.1

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