Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 8192, 'do_lower_case': False, 'architecture': 'LlamaModel'})
(1): Pooling({'word_embedding_dimension': 1792, 'pooling_mode_cls_token': False, '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': True, 'include_prompt': False})
)
pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("kushalc1/sarashina-embedding-v2-1b-jsts-matryoshka")
5# Run inference
6sentences = [
7 '樹木に囲まれた芝生の上に三頭のキリンが立っています。',
8 '芝生の上に数頭のキリンが歩いています。',
9 '茶色のテーブルの上にピザと飲み物が置かれています。',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 1792]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities)
18# tensor([[1.0000, 0.8499, 0.3438],
19# [0.8499, 1.0000, 0.3127],
20# [0.3438, 0.3127, 1.0000]])sts-dev-1792 and sts-test-1792EmbeddingSimilarityEvaluator with these parameters:
1{
2 "truncate_dim": 1792
3}| Metric | sts-dev-1792 | sts-test-1792 |
|---|---|---|
| pearson_cosine | 0.8125 | 0.8124 |
| spearman_cosine | 0.7521 | 0.7521 |
sts-dev-1280 and sts-test-1280EmbeddingSimilarityEvaluator with these parameters:
1{
2 "truncate_dim": 1280
3}| Metric | sts-dev-1280 | sts-test-1280 |
|---|---|---|
| pearson_cosine | 0.8099 | 0.8099 |
| spearman_cosine | 0.7492 | 0.7491 |
sts-dev-768 and sts-test-768EmbeddingSimilarityEvaluator with these parameters:
1{
2 "truncate_dim": 768
3}| Metric | sts-dev-768 | sts-test-768 |
|---|---|---|
| pearson_cosine | 0.8058 | 0.8057 |
| spearman_cosine | 0.7462 | 0.7461 |
sts-dev-256 and sts-test-256EmbeddingSimilarityEvaluator with these parameters:
1{
2 "truncate_dim": 256
3}| Metric | sts-dev-256 | sts-test-256 |
|---|---|---|
| pearson_cosine | 0.7946 | 0.7945 |
| spearman_cosine | 0.7381 | 0.738 |
sts-dev-64 and sts-test-64EmbeddingSimilarityEvaluator with these parameters:
1{
2 "truncate_dim": 64
3}| Metric | sts-dev-64 | sts-test-64 |
|---|---|---|
| pearson_cosine | 0.753 | 0.7531 |
| spearman_cosine | 0.708 | 0.708 |
sentence1, sentence2, and score| sentence1 | sentence2 | score | |
|---|---|---|---|
| type | string | string | float |
| details |
|
|
|
| sentence1 | sentence2 | score |
|---|---|---|
川べりでサーフボードを持った人たちがいます。 | トイレの壁に黒いタオルがかけられています。 | 0.0 |
二人の男性がジャンボジェット機を見ています。 | 2人の男性が、白い飛行機を眺めています。 | 3.799999952316284 |
男性が子供を抱き上げて立っています。 | 坊主頭の男性が子供を抱いて立っています。 | 4.0 |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim",
4 "gather_across_devices": false
5}sentence1, sentence2, and score| sentence1 | sentence2 | score | |
|---|---|---|---|
| type | string | string | float |
| details |
|
|
|
| sentence1 | sentence2 | score |
|---|---|---|
レンガの建物の前を、乳母車を押した女性が歩いています。 | 厩舎で馬と女性とが寄り添っています。 | 0.0 |
山の上に顔の白い牛が2頭います。 | 曇り空の山肌で、牛が2匹草を食んでいます。 | 2.4000000953674316 |
バナナを持った人が道路を通行しています。 | 道の上をバナナを背負った男性が歩いています。 | 3.5999999046325684 |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim",
4 "gather_across_devices": false
5}eval_strategy: stepsper_device_train_batch_size: 16per_device_eval_batch_size: 16num_train_epochs: 4warmup_ratio: 0.1fp16: Trueoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 16per_device_eval_batch_size: 16per_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: 1.0num_train_epochs: 4max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.1warmup_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: Truefp16_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: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_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: Falsehub_revision: Nonegradient_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: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Falseprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | Validation Loss | sts-dev-1792_spearman_cosine | sts-dev-1280_spearman_cosine | sts-dev-768_spearman_cosine | sts-dev-256_spearman_cosine | sts-dev-64_spearman_cosine | sts-test-1792_spearman_cosine | sts-test-1280_spearman_cosine | sts-test-768_spearman_cosine | sts-test-256_spearman_cosine | sts-test-64_spearman_cosine |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0.1284 | 100 | 0.9104 | 1.0803 | 0.7732 | 0.7742 | 0.7700 | 0.7659 | 0.7287 | - | - | - | - | - |
| 0.2567 | 200 | 1.0621 | 1.1598 | 0.7208 | 0.7204 | 0.7198 | 0.7096 | 0.6787 | - | - | - | - | - |
| 0.3851 | 300 | 1.2289 | 1.4808 | 0.6225 | 0.6305 | 0.6234 | 0.6154 | 0.5922 | - | - | - | - | - |
| 0.5135 | 400 | 1.215 | 1.3408 | 0.6559 | 0.6527 | 0.6497 | 0.6473 | 0.6329 | - | - | - | - | - |
| 0.6418 | 500 | 1.2991 | 1.4541 | 0.6300 | 0.6324 | 0.6314 | 0.6276 | 0.5959 | - | - | - | - | - |
| 0.7702 | 600 | 1.2537 | 1.3891 | 0.6418 | 0.6416 | 0.6422 | 0.6389 | 0.6019 | - | - | - | - | - |
| 0.8986 | 700 | 1.2248 | 1.2778 | 0.6817 | 0.6855 | 0.6832 | 0.6800 | 0.6562 | - | - | - | - | - |
| 1.0270 | 800 | 1.1772 | 1.3947 | 0.6674 | 0.6666 | 0.6652 | 0.6618 | 0.6392 | - | - | - | - | - |
| 1.1553 | 900 | 1.119 | 1.2291 | 0.7086 | 0.7066 | 0.7018 | 0.7032 | 0.6758 | - | - | - | - | - |
| 1.2837 | 1000 | 1.0503 | 1.1655 | 0.7183 | 0.7163 | 0.7135 | 0.7130 | 0.6961 | - | - | - | - | - |
| 1.4121 | 1100 | 1.0729 | 1.1550 | 0.7333 | 0.7340 | 0.7299 | 0.7260 | 0.6955 | - | - | - | - | - |
| 1.5404 | 1200 | 1.0952 | 1.3186 | 0.6753 | 0.6790 | 0.6728 | 0.6738 | 0.6417 | - | - | - | - | - |
| 1.6688 | 1300 | 1.0284 | 1.1816 | 0.7146 | 0.7131 | 0.7071 | 0.7096 | 0.6786 | - | - | - | - | - |
| 1.7972 | 1400 | 1.0248 | 1.1495 | 0.7282 | 0.7270 | 0.7206 | 0.7196 | 0.6913 | - | - | - | - | - |
| 1.9255 | 1500 | 1.0138 | 1.1371 | 0.7264 | 0.7240 | 0.7175 | 0.7130 | 0.6738 | - | - | - | - | - |
| 2.0539 | 1600 | 0.9739 | 1.1577 | 0.7173 | 0.7143 | 0.7088 | 0.7142 | 0.6881 | - | - | - | - | - |
| 2.1823 | 1700 | 0.7908 | 1.1627 | 0.7358 | 0.7341 | 0.7300 | 0.7278 | 0.7045 | - | - | - | - | - |
| 2.3107 | 1800 | 0.8877 | 1.1396 | 0.7312 | 0.7303 | 0.7263 | 0.7219 | 0.6942 | - | - | - | - | - |
| 2.4390 | 1900 | 0.8403 | 1.1868 | 0.7395 | 0.7379 | 0.7346 | 0.7324 | 0.7167 | - | - | - | - | - |
| 2.5674 | 2000 | 0.8558 | 1.1481 | 0.7424 | 0.7411 | 0.7379 | 0.7373 | 0.7143 | - | - | - | - | - |
| 2.6958 | 2100 | 0.8304 | 1.1377 | 0.7391 | 0.7366 | 0.7314 | 0.7287 | 0.7075 | - | - | - | - | - |
| 2.8241 | 2200 | 0.8053 | 1.0874 | 0.7384 | 0.7367 | 0.7313 | 0.7284 | 0.7153 | - | - | - | - | - |
| 2.9525 | 2300 | 0.8071 | 1.0720 | 0.7504 | 0.7487 | 0.7436 | 0.7372 | 0.7205 | - | - | - | - | - |
| 3.0809 | 2400 | 0.6082 | 1.1407 | 0.7533 | 0.7521 | 0.7480 | 0.7403 | 0.7195 | - | - | - | - | - |
| 3.2092 | 2500 | 0.5183 | 1.1555 | 0.7562 | 0.7546 | 0.7505 | 0.7437 | 0.7124 | - | - | - | - | - |
| 3.3376 | 2600 | 0.5311 | 1.1923 | 0.7494 | 0.7476 | 0.7434 | 0.7382 | 0.7084 | - | - | - | - | - |
| 3.4660 | 2700 | 0.4914 | 1.1752 | 0.7446 | 0.7416 | 0.7376 | 0.7326 | 0.7034 | - | - | - | - | - |
| 3.5944 | 2800 | 0.5486 | 1.1924 | 0.7472 | 0.7439 | 0.7400 | 0.7313 | 0.6989 | - | - | - | - | - |
| 3.7227 | 2900 | 0.4702 | 1.1903 | 0.7526 | 0.7497 | 0.7466 | 0.7380 | 0.7075 | - | - | - | - | - |
| 3.8511 | 3000 | 0.4674 | 1.1749 | 0.7519 | 0.7487 | 0.7459 | 0.7378 | 0.7071 | - | - | - | - | - |
| 3.9795 | 3100 | 0.4696 | 1.1795 | 0.7521 | 0.7492 | 0.7462 | 0.7381 | 0.7080 | - | - | - | - | - |
| -1 | -1 | - | - | - | - | - | - | - | 0.7521 | 0.7491 | 0.7461 | 0.7380 | 0.7080 |
1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}1@misc{henderson2017efficient,
2 title={Efficient Natural Language Response Suggestion for Smart Reply},
3 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},
4 year={2017},
5 eprint={1705.00652},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL}
8}