root fff0edcf32 fix model преди 4 дни
..
1_Pooling fff0edcf32 fix model преди 4 дни
README.md fff0edcf32 fix model преди 4 дни
config.json fff0edcf32 fix model преди 4 дни
config_sentence_transformers.json fff0edcf32 fix model преди 4 дни
model.safetensors fff0edcf32 fix model преди 4 дни
modules.json fff0edcf32 fix model преди 4 дни
sentence_bert_config.json fff0edcf32 fix model преди 4 дни
special_tokens_map.json fff0edcf32 fix model преди 4 дни
tokenizer.json fff0edcf32 fix model преди 4 дни
tokenizer_config.json fff0edcf32 fix model преди 4 дни
vocab.txt fff0edcf32 fix model преди 4 дни

README.md


datasets: [] language: [] library_name: sentence-transformers pipeline_tag: sentence-similarity tags:

  • sentence-transformers
  • sentence-similarity
  • feature-extraction
  • generated_from_trainer
  • dataset_size:616789
  • loss:CosineSimilarityLoss widget:
  • source_sentence: 我们到现在没有水啊 sentences:
    • 水表怎么安装和更换?
    • 阀门问题
    • 维修人员什么时候能到
  • source_sentence: 我家水欠费给我停了,我都缴费好几天了不给供水啊 sentences:
    • 我家漏水了
    • 再见
    • 怎么停水了?
  • source_sentence: 谢谢再见 sentences:
    • 水表坏了
    • 维修人员什么时候能到
    • 怎么停水了?
  • source_sentence: 之前停水报修了也没查出来,再来人看看呗 sentences:
    • 水表坏了
    • 我家漏水了
    • 线上报装登录佳木斯供水公众号, 点击“报装申请”,提交后,工作人员会在24小时内联系您。线下报装需本人到供水公司申请,居民用户携带本人身份证复印件和房照复印件,非居民用户携带营业执照复印件、法人复印件及公章。
  • source_sentence: 报停水,怎么处理? sentences:
    • 怎么停水了?
    • 阀门问题
    • 怎么停水了? ---

SentenceTransformer

This is a sentence-transformers model trained. It maps sentences & paragraphs to a 768-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
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 768 tokens
  • Similarity Function: Cosine Similarity

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel 
  (1): Pooling({'word_embedding_dimension': 768, '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})
)

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 = [
    '报停水,怎么处理?',
    '怎么停水了?',
    '阀门问题',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

Training Details

Training Dataset

Unnamed Dataset

  • Size: 616,789 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 | float | | details |
    • min: 4 tokens
    • mean: 14.84 tokens
    • max: 47 tokens
    |
    • min: 4 tokens
    • mean: 20.31 tokens
    • max: 107 tokens
    |
    • min: 0.3
    • mean: 0.3
    • max: 0.7
    |
  • Samples: | sentence_0 | sentence_1 | label | |:-------------------------------|:----------------------------------------------------------------------------------------------|:-----------------| | 自来水报装的窗口办理流程是怎样的? | 怎么停水了? | 0.3 | | 那个人工客服呢 | 您可以登录微信公众号佳木斯供水,进入主页面绑定用户信息后缴费,或者微信小程序中缴费页面输入用户编号进行缴费。或者也可以在支付宝生活缴费页面输入用户编号进行缴费。 | 0.3 | | 你们上班时间是什么时候 | 怎么停水了? | 0.3 |
  • Loss: CosineSimilarityLoss with these parameters:

    {
      "loss_fct": "torch.nn.modules.loss.MSELoss"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • multi_dataset_batch_sampler: round_robin

All Hyperparameters

Click to expand - `overwrite_output_dir`: False - `do_predict`: False - `eval_strategy`: no - `prediction_loss_only`: True - `per_device_train_batch_size`: 16 - `per_device_eval_batch_size`: 16 - `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`: 3 - `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`: {'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} - `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`: False - `hub_always_push`: False - `gradient_checkpointing`: False - `gradient_checkpointing_kwargs`: None - `include_inputs_for_metrics`: False - `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 - `batch_sampler`: batch_sampler - `multi_dataset_batch_sampler`: round_robin

Training Logs

Click to expand | Epoch | Step | Training Loss | |:------:|:------:|:-------------:| | 0.0130 | 500 | 0.2128 | | 0.0259 | 1000 | 0.1824 | | 0.0389 | 1500 | 0.1326 | | 0.0519 | 2000 | 0.0781 | | 0.0649 | 2500 | 0.0334 | | 0.0778 | 3000 | 0.0146 | | 0.0908 | 3500 | 0.0085 | | 0.1038 | 4000 | 0.0058 | | 0.1167 | 4500 | 0.0045 | | 0.1297 | 5000 | 0.0038 | | 0.1427 | 5500 | 0.0034 | | 0.1556 | 6000 | 0.0029 | | 0.1686 | 6500 | 0.0027 | | 0.1816 | 7000 | 0.0026 | | 0.1946 | 7500 | 0.0025 | | 0.2075 | 8000 | 0.0023 | | 0.2205 | 8500 | 0.0023 | | 0.2335 | 9000 | 0.0021 | | 0.2464 | 9500 | 0.0021 | | 0.2594 | 10000 | 0.0019 | | 0.2724 | 10500 | 0.0018 | | 0.2853 | 11000 | 0.0018 | | 0.2983 | 11500 | 0.0017 | | 0.3113 | 12000 | 0.0016 | | 0.3243 | 12500 | 0.0015 | | 0.3372 | 13000 | 0.0014 | | 0.3502 | 13500 | 0.0015 | | 0.3632 | 14000 | 0.0016 | | 0.3761 | 14500 | 0.0016 | | 0.3891 | 15000 | 0.0013 | | 0.4021 | 15500 | 0.0014 | | 0.4150 | 16000 | 0.0013 | | 0.4280 | 16500 | 0.0013 | | 0.4410 | 17000 | 0.0012 | | 0.4540 | 17500 | 0.0013 | | 0.4669 | 18000 | 0.0013 | | 0.4799 | 18500 | 0.001 | | 0.4929 | 19000 | 0.0011 | | 0.5058 | 19500 | 0.001 | | 0.5188 | 20000 | 0.0009 | | 0.5318 | 20500 | 0.0009 | | 0.5447 | 21000 | 0.001 | | 0.5577 | 21500 | 0.0008 | | 0.5707 | 22000 | 0.0012 | | 0.5837 | 22500 | 0.0009 | | 0.5966 | 23000 | 0.0008 | | 0.6096 | 23500 | 0.0009 | | 0.6226 | 24000 | 0.0009 | | 0.6355 | 24500 | 0.0009 | | 0.6485 | 25000 | 0.0009 | | 0.6615 | 25500 | 0.0007 | | 0.6744 | 26000 | 0.0008 | | 0.6874 | 26500 | 0.0007 | | 0.7004 | 27000 | 0.0007 | | 0.7134 | 27500 | 0.0008 | | 0.7263 | 28000 | 0.0007 | | 0.7393 | 28500 | 0.0008 | | 0.7523 | 29000 | 0.0007 | | 0.7652 | 29500 | 0.0007 | | 0.7782 | 30000 | 0.0006 | | 0.7912 | 30500 | 0.0007 | | 0.8042 | 31000 | 0.0008 | | 0.8171 | 31500 | 0.0007 | | 0.8301 | 32000 | 0.0006 | | 0.8431 | 32500 | 0.0006 | | 0.8560 | 33000 | 0.0007 | | 0.8690 | 33500 | 0.0006 | | 0.8820 | 34000 | 0.0007 | | 0.8949 | 34500 | 0.0005 | | 0.9079 | 35000 | 0.0005 | | 0.9209 | 35500 | 0.0007 | | 0.9339 | 36000 | 0.0006 | | 0.9468 | 36500 | 0.0006 | | 0.9598 | 37000 | 0.0006 | | 0.9728 | 37500 | 0.0005 | | 0.9857 | 38000 | 0.0005 | | 0.9987 | 38500 | 0.0005 | | 1.0117 | 39000 | 0.0006 | | 1.0246 | 39500 | 0.0005 | | 1.0376 | 40000 | 0.0004 | | 1.0506 | 40500 | 0.0004 | | 1.0636 | 41000 | 0.0005 | | 1.0765 | 41500 | 0.0006 | | 1.0895 | 42000 | 0.0005 | | 1.1025 | 42500 | 0.0005 | | 1.1154 | 43000 | 0.0004 | | 1.1284 | 43500 | 0.0004 | | 1.1414 | 44000 | 0.0004 | | 1.1543 | 44500 | 0.0004 | | 1.1673 | 45000 | 0.0005 | | 1.1803 | 45500 | 0.0005 | | 1.1933 | 46000 | 0.0005 | | 1.2062 | 46500 | 0.0005 | | 1.2192 | 47000 | 0.0005 | | 1.2322 | 47500 | 0.0003 | | 1.2451 | 48000 | 0.0004 | | 1.2581 | 48500 | 0.0004 | | 1.2711 | 49000 | 0.0004 | | 1.2840 | 49500 | 0.0004 | | 1.2970 | 50000 | 0.0004 | | 1.3100 | 50500 | 0.0004 | | 1.3230 | 51000 | 0.0004 | | 1.3359 | 51500 | 0.0004 | | 1.3489 | 52000 | 0.0003 | | 1.3619 | 52500 | 0.0004 | | 1.3748 | 53000 | 0.0004 | | 1.3878 | 53500 | 0.0003 | | 1.4008 | 54000 | 0.0004 | | 1.4137 | 54500 | 0.0003 | | 1.4267 | 55000 | 0.0004 | | 1.4397 | 55500 | 0.0003 | | 1.4527 | 56000 | 0.0003 | | 1.4656 | 56500 | 0.0004 | | 1.4786 | 57000 | 0.0003 | | 1.4916 | 57500 | 0.0003 | | 1.5045 | 58000 | 0.0003 | | 1.5175 | 58500 | 0.0003 | | 1.5305 | 59000 | 0.0003 | | 1.5435 | 59500 | 0.0004 | | 1.5564 | 60000 | 0.0002 | | 1.5694 | 60500 | 0.0005 | | 1.5824 | 61000 | 0.0003 | | 1.5953 | 61500 | 0.0003 | | 1.6083 | 62000 | 0.0003 | | 1.6213 | 62500 | 0.0003 | | 1.6342 | 63000 | 0.0003 | | 1.6472 | 63500 | 0.0003 | | 1.6602 | 64000 | 0.0003 | | 1.6732 | 64500 | 0.0003 | | 1.6861 | 65000 | 0.0002 | | 1.6991 | 65500 | 0.0003 | | 1.7121 | 66000 | 0.0003 | | 1.7250 | 66500 | 0.0003 | | 1.7380 | 67000 | 0.0004 | | 1.7510 | 67500 | 0.0003 | | 1.7639 | 68000 | 0.0002 | | 1.7769 | 68500 | 0.0003 | | 1.7899 | 69000 | 0.0003 | | 1.8029 | 69500 | 0.0003 | | 1.8158 | 70000 | 0.0003 | | 1.8288 | 70500 | 0.0003 | | 1.8418 | 71000 | 0.0002 | | 1.8547 | 71500 | 0.0003 | | 1.8677 | 72000 | 0.0004 | | 1.8807 | 72500 | 0.0002 | | 1.8936 | 73000 | 0.0003 | | 1.9066 | 73500 | 0.0002 | | 1.9196 | 74000 | 0.0004 | | 1.9326 | 74500 | 0.0002 | | 1.9455 | 75000 | 0.0002 | | 1.9585 | 75500 | 0.0002 | | 1.9715 | 76000 | 0.0002 | | 1.9844 | 76500 | 0.0003 | | 1.9974 | 77000 | 0.0002 | | 2.0104 | 77500 | 0.0003 | | 2.0233 | 78000 | 0.0003 | | 2.0363 | 78500 | 0.0001 | | 2.0493 | 79000 | 0.0002 | | 2.0623 | 79500 | 0.0003 | | 2.0752 | 80000 | 0.0003 | | 2.0882 | 80500 | 0.0003 | | 2.1012 | 81000 | 0.0002 | | 2.1141 | 81500 | 0.0002 | | 2.1271 | 82000 | 0.0001 | | 2.1401 | 82500 | 0.0002 | | 2.1530 | 83000 | 0.0002 | | 2.1660 | 83500 | 0.0002 | | 2.1790 | 84000 | 0.0002 | | 2.1920 | 84500 | 0.0002 | | 2.2049 | 85000 | 0.0003 | | 2.2179 | 85500 | 0.0003 | | 2.2309 | 86000 | 0.0002 | | 2.2438 | 86500 | 0.0003 | | 2.2568 | 87000 | 0.0002 | | 2.2698 | 87500 | 0.0002 | | 2.2827 | 88000 | 0.0002 | | 2.2957 | 88500 | 0.0003 | | 2.3087 | 89000 | 0.0002 | | 2.3217 | 89500 | 0.0002 | | 2.3346 | 90000 | 0.0002 | | 2.3476 | 90500 | 0.0001 | | 2.3606 | 91000 | 0.0002 | | 2.3735 | 91500 | 0.0003 | | 2.3865 | 92000 | 0.0002 | | 2.3995 | 92500 | 0.0003 | | 2.4125 | 93000 | 0.0002 | | 2.4254 | 93500 | 0.0003 | | 2.4384 | 94000 | 0.0002 | | 2.4514 | 94500 | 0.0002 | | 2.4643 | 95000 | 0.0002 | | 2.4773 | 95500 | 0.0002 | | 2.4903 | 96000 | 0.0002 | | 2.5032 | 96500 | 0.0002 | | 2.5162 | 97000 | 0.0002 | | 2.5292 | 97500 | 0.0002 | | 2.5422 | 98000 | 0.0002 | | 2.5551 | 98500 | 0.0001 | | 2.5681 | 99000 | 0.0004 | | 2.5811 | 99500 | 0.0001 | | 2.5940 | 100000 | 0.0002 | | 2.6070 | 100500 | 0.0001 | | 2.6200 | 101000 | 0.0002 | | 2.6329 | 101500 | 0.0002 | | 2.6459 | 102000 | 0.0001 | | 2.6589 | 102500 | 0.0002 | | 2.6719 | 103000 | 0.0002 | | 2.6848 | 103500 | 0.0002 | | 2.6978 | 104000 | 0.0002 | | 2.7108 | 104500 | 0.0002 | | 2.7237 | 105000 | 0.0003 | | 2.7367 | 105500 | 0.0002 | | 2.7497 | 106000 | 0.0002 | | 2.7626 | 106500 | 0.0001 | | 2.7756 | 107000 | 0.0002 | | 2.7886 | 107500 | 0.0003 | | 2.8016 | 108000 | 0.0002 | | 2.8145 | 108500 | 0.0002 | | 2.8275 | 109000 | 0.0001 | | 2.8405 | 109500 | 0.0002 | | 2.8534 | 110000 | 0.0002 | | 2.8664 | 110500 | 0.0003 | | 2.8794 | 111000 | 0.0002 | | 2.8923 | 111500 | 0.0002 | | 2.9053 | 112000 | 0.0002 | | 2.9183 | 112500 | 0.0002 | | 2.9313 | 113000 | 0.0002 | | 2.9442 | 113500 | 0.0002 | | 2.9572 | 114000 | 0.0002 | | 2.9702 | 114500 | 0.0001 | | 2.9831 | 115000 | 0.0002 | | 2.9961 | 115500 | 0.0002 |

Framework Versions

  • Python: 3.10.13
  • Sentence Transformers: 3.0.1
  • Transformers: 4.45.0.dev0
  • PyTorch: 2.2.1
  • Accelerate: 0.31.0
  • Datasets: 2.17.1
  • Tokenizers: 0.19.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",
}