Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: 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})
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("tomaarsen/MiniLM-L6-H384-uncased-gooaq-no-asym")
5# Run inference
6sentences = [
7 'is jordyn a boy or girl?',
8 'Gender Popularity of the Name "Jordyn" Jordyn: It\'s a girl! Since 1880, a total of 2,696 boys have been given the name Jordyn while 39,618 girls were named Jordyn.',
9 'Currently there is no research showing that juice cleanses are beneficial to weight loss or that they should be recommended at all. Even though it is possible to cut a significant amount of calories by only drinking juice, you could also be missing out on some essential nutrition - like protein, fiber and healthy fats.',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 384]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities.shape)
18# [3, 3]gooaq-devInformationRetrievalEvaluator| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.5589 |
| cosine_accuracy@3 | 0.7234 |
| cosine_accuracy@5 | 0.7801 |
| cosine_accuracy@10 | 0.8456 |
| cosine_precision@1 | 0.5589 |
| cosine_precision@3 | 0.2411 |
| cosine_precision@5 | 0.156 |
| cosine_precision@10 | 0.0846 |
| cosine_recall@1 | 0.5589 |
| cosine_recall@3 | 0.7234 |
| cosine_recall@5 | 0.7801 |
| cosine_recall@10 | 0.8456 |
| cosine_ndcg@10 | 0.7 |
| cosine_mrr@10 | 0.6536 |
| cosine_map@100 | 0.6594 |
question and answer| question | answer | |
|---|---|---|
| type | string | string |
| details |
|
|
| question | answer |
|---|---|
what is the difference between broilers and layers? | An egg laying poultry is called egger or layer whereas broilers are reared for obtaining meat. So a layer should be able to produce more number of large sized eggs, without growing too much. On the other hand, a broiler should yield more meat and hence should be able to grow well. |
what is the difference between chronological order and spatial order? | As a writer, you should always remember that unlike chronological order and the other organizational methods for data, spatial order does not take into account the time. Spatial order is primarily focused on the location. All it does is take into account the location of objects and not the time. |
is kamagra same as viagra? | Kamagra is thought to contain the same active ingredient as Viagra, sildenafil citrate. In theory, it should work in much the same way as Viagra, taking about 45 minutes to take effect, and lasting for around 4-6 hours. However, this will vary from person to person. |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim"
4}question and answer| question | answer | |
|---|---|---|
| type | string | string |
| details |
|
|
| question | answer |
|---|---|
how do i program my directv remote with my tv? | ['Press MENU on your remote.', 'Select Settings & Help > Settings > Remote Control > Program Remote.', 'Choose the device (TV, audio, DVD) you wish to program. ... ', 'Follow the on-screen prompts to complete programming.'] |
are rodrigues fruit bats nocturnal? | Before its numbers were threatened by habitat destruction, storms, and hunting, some of those groups could number 500 or more members. Sunrise, sunset. Rodrigues fruit bats are most active at dawn, at dusk, and at night. |
why does your heart rate increase during exercise bbc bitesize? | During exercise there is an increase in physical activity and muscle cells respire more than they do when the body is at rest. The heart rate increases during exercise. The rate and depth of breathing increases - this makes sure that more oxygen is absorbed into the blood, and more carbon dioxide is removed from it. |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim"
4}eval_strategy: stepsper_device_train_batch_size: 128per_device_eval_batch_size: 128learning_rate: 2e-05num_train_epochs: 1warmup_ratio: 0.1seed: 24bf16: Truebatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 128per_device_eval_batch_size: 128per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 2e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 1max_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: 24data_seed: Nonejit_mode_eval: Falseuse_ipex: Falsebf16: Truefp16: Falsefp16_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}deepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torchoptim_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: Falsegradient_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: Nonedispatch_batches: Nonesplit_batches: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseeval_use_gather_object: Falseaverage_tokens_across_devices: Falseprompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportional| Epoch | Step | Training Loss | Validation Loss | gooaq-dev_cosine_ndcg@10 |
|---|---|---|---|---|
| -1 | -1 | - | - | 0.0303 |
| 0.0003 | 1 | 4.2106 | - | - |
| 0.0128 | 50 | 4.1241 | - | - |
| 0.0256 | 100 | 3.3791 | - | - |
| 0.0384 | 150 | 1.8925 | - | - |
| 0.0512 | 200 | 1.1582 | - | - |
| 0.0640 | 250 | 0.8751 | - | - |
| 0.0768 | 300 | 0.6851 | - | - |
| 0.0896 | 350 | 0.5779 | - | - |
| 0.1024 | 400 | 0.5251 | - | - |
| 0.1152 | 450 | 0.4873 | - | - |
| 0.1280 | 500 | 0.4467 | 0.3056 | 0.6054 |
| 0.1408 | 550 | 0.3989 | - | - |
| 0.1536 | 600 | 0.398 | - | - |
| 0.1664 | 650 | 0.3708 | - | - |
| 0.1792 | 700 | 0.3656 | - | - |
| 0.1920 | 750 | 0.3382 | - | - |
| 0.2048 | 800 | 0.3333 | - | - |
| 0.2176 | 850 | 0.3006 | - | - |
| 0.2304 | 900 | 0.3065 | - | - |
| 0.2432 | 950 | 0.3277 | - | - |
| 0.2560 | 1000 | 0.2941 | 0.2089 | 0.6556 |
| 0.2687 | 1050 | 0.2918 | - | - |
| 0.2815 | 1100 | 0.2935 | - | - |
| 0.2943 | 1150 | 0.2834 | - | - |
| 0.3071 | 1200 | 0.2795 | - | - |
| 0.3199 | 1250 | 0.2783 | - | - |
| 0.3327 | 1300 | 0.2828 | - | - |
| 0.3455 | 1350 | 0.2727 | - | - |
| 0.3583 | 1400 | 0.2626 | - | - |
| 0.3711 | 1450 | 0.2519 | - | - |
| 0.3839 | 1500 | 0.2461 | 0.1769 | 0.6743 |
| 0.3967 | 1550 | 0.2602 | - | - |
| 0.4095 | 1600 | 0.2398 | - | - |
| 0.4223 | 1650 | 0.2421 | - | - |
| 0.4351 | 1700 | 0.2365 | - | - |
| 0.4479 | 1750 | 0.2351 | - | - |
| 0.4607 | 1800 | 0.2412 | - | - |
| 0.4735 | 1850 | 0.2308 | - | - |
| 0.4863 | 1900 | 0.2217 | - | - |
| 0.4991 | 1950 | 0.2315 | - | - |
| 0.5119 | 2000 | 0.2295 | 0.1598 | 0.6856 |
| 0.5247 | 2050 | 0.2157 | - | - |
| 0.5375 | 2100 | 0.2123 | - | - |
| 0.5503 | 2150 | 0.2236 | - | - |
| 0.5631 | 2200 | 0.2098 | - | - |
| 0.5759 | 2250 | 0.2208 | - | - |
| 0.5887 | 2300 | 0.2159 | - | - |
| 0.6015 | 2350 | 0.2087 | - | - |
| 0.6143 | 2400 | 0.22 | - | - |
| 0.6271 | 2450 | 0.2002 | - | - |
| 0.6399 | 2500 | 0.1999 | 0.1466 | 0.6915 |
| 0.6527 | 2550 | 0.1986 | - | - |
| 0.6655 | 2600 | 0.2238 | - | - |
| 0.6783 | 2650 | 0.2141 | - | - |
| 0.6911 | 2700 | 0.2154 | - | - |
| 0.7039 | 2750 | 0.1993 | - | - |
| 0.7167 | 2800 | 0.1946 | - | - |
| 0.7295 | 2850 | 0.2064 | - | - |
| 0.7423 | 2900 | 0.2179 | - | - |
| 0.7551 | 2950 | 0.1976 | - | - |
| 0.7679 | 3000 | 0.2081 | 0.1384 | 0.6964 |
| 0.7807 | 3050 | 0.1863 | - | - |
| 0.7934 | 3100 | 0.2022 | - | - |
| 0.8062 | 3150 | 0.2132 | - | - |
| 0.8190 | 3200 | 0.1991 | - | - |
| 0.8318 | 3250 | 0.1904 | - | - |
| 0.8446 | 3300 | 0.1804 | - | - |
| 0.8574 | 3350 | 0.1944 | - | - |
| 0.8702 | 3400 | 0.1981 | - | - |
| 0.8830 | 3450 | 0.195 | - | - |
| 0.8958 | 3500 | 0.1984 | 0.1357 | 0.6994 |
| 0.9086 | 3550 | 0.1947 | - | - |
| 0.9214 | 3600 | 0.1912 | - | - |
| 0.9342 | 3650 | 0.1898 | - | - |
| 0.9470 | 3700 | 0.1945 | - | - |
| 0.9598 | 3750 | 0.1893 | - | - |
| 0.9726 | 3800 | 0.1919 | - | - |
| 0.9854 | 3850 | 0.1994 | - | - |
| 0.9982 | 3900 | 0.1864 | - | - |
| -1 | -1 | - | - | 0.7000 |
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}