Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 256, '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})
(2): Normalize()
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("ayushexel/emb-all-MiniLM-L6-v2-squad-8-epochs")
5# Run inference
6sentences = [
7 'Who raised Victoria?',
8 "Victoria was the daughter of Prince Edward, Duke of Kent and Strathearn, the fourth son of King George III. Both the Duke of Kent and King George III died in 1820, and Victoria was raised under close supervision by her German-born mother Princess Victoria of Saxe-Coburg-Saalfeld. She inherited the throne aged 18, after her father's three elder brothers had all died, leaving no surviving legitimate children. The United Kingdom was already an established constitutional monarchy, in which the sovereign held relatively little direct political power. Privately, Victoria attempted to influence government policy and ministerial appointments; publicly, she became a national icon who was identified with strict standards of personal morality.",
9 'Though queen, as an unmarried young woman Victoria was required by social convention to live with her mother, despite their differences over the Kensington System and her mother\'s continued reliance on Conroy. Her mother was consigned to a remote apartment in Buckingham Palace, and Victoria often refused to see her. When Victoria complained to Melbourne that her mother\'s close proximity promised "torment for many years", Melbourne sympathised but said it could be avoided by marriage, which Victoria called a "schocking [sic] alternative". She showed interest in Albert\'s education for the future role he would have to play as her husband, but she resisted attempts to rush her into wedlock.',
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]gooqa-devTripletEvaluator| Metric | Value |
|---|---|
| cosine_accuracy | 0.4038 |
question, context, and negative| question | context | negative | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| question | context | negative |
|---|---|---|
In what years did Ado Grenzstein do journalism work in Estonia? | Estonian language planners such as Ado Grenzstein (a journalist active in Estonia in the 1870s–90s) tried to use formation ex nihilo, Urschöpfung; i.e. they created new words out of nothing. | During the Perestroika era, The Law on the Status of the Estonian Language was adopted in January 1989. The collapse of the Soviet Union led to the restoration of Republic of Estonia's independence. Estonian went back to being the only state language in Estonia which in practice meant that use of Estonian was promoted while the use of Russian was discouraged. |
These civic ideas allowed what to come into being? | The architecture and urbanism of the Classical civilizations such as the Greek and the Roman evolved from civic ideals rather than religious or empirical ones and new building types emerged. Architectural "style" developed in the form of the Classical orders. | These theorists were driven by two basic questions: one, by what right or need do people form states; and two, what the best form for a state could be. These fundamental questions involved a conceptual distinction between the concepts of "state" and "government." It was decided that "state" would refer to a set of enduring institutions through which power would be distributed and its use justified. The term "government" would refer to a specific group of people who occupied the institutions of the state, and create the laws and ordinances by which the people, themselves included, would be bound. This conceptual distinction continues to operate in political science, although some political scientists, philosophers, historians and cultural anthropologists have argued that most political action in any given society occurs outside of its state, and that there are societies that are not organized into states that nevertheless must be considered in political terms. As long as the concept of ... |
What is the the Information Management Group responsible for? | Among other things, the Information Management Group is responsible for the conduct of electronic warfare and the protection of the Armed Forces' communications and computer networks. Within the group, this operational role is fulfilled by the Canadian Forces Information Operations Group, headquartered at CFS Leitrim in Ottawa, which operates the following units: the Canadian Forces Information Operations Group Headquarters (CFIOGHQ), the Canadian Forces Electronic Warfare Centre (CFEWC), the Canadian Forces Network Operation Centre (CFNOC), the Canadian Forces Signals Intelligence Operations Centre (CFSOC), the Canadian Forces Station (CFS) Leitrim, and the 764 Communications Squadron. In June 2011 the Canadian Armed Forces Chief of Force Development announced the establishment of a new organization, the Directorate of Cybernetics, headed by a Brigadier General, the Director General Cyber (DG Cyber). Within that directorate the newly established CAF Cyber Task Force, has been tasked t... | The Criminal Justice Information Services (CJIS) Division, is located in Clarksburg, West Virginia. Organized beginning in 1991, the office opened in 1995 as the youngest agency division. The complex is the length of three football fields. It provides a main repository for information in various data systems. Under the roof of the CJIS are the programs for the National Crime Information Center (NCIC), Uniform Crime Reporting (UCR), Fingerprint Identification, Integrated Automated Fingerprint Identification System (IAFIS), NCIC 2000, and the National Incident-Based Reporting System (NIBRS). Many state and local agencies use these data systems as a source for their own investigations and contribute to the database using secure communications. FBI provides these tools of sophisticated identification and information services to local, state, federal, and international law enforcement agencies. |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim"
4}question, context, and negative_1| question | context | negative_1 | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| question | context | negative_1 |
|---|---|---|
Where were the soldiers under commander Yang Wenyao trying to go? | Many rescue teams, including that of the Taipei Fire Department from Taiwan, were reported ready to join the rescue effort in Sichuan as early as Wednesday. However, the Red Cross Society of China said that (on May 13) "it was inconvenient currently due to the traffic problem to the hardest hit areas closest to the epicenter." The Red Cross Society of China also stated that the disaster areas need tents, medical supplies, drinking water and food; however it recommended donating cash instead of other items, as it had not been possible to reach roads that were completely damaged or places that were blocked off by landslides. Landslides continuously threatened the progress of a search and rescue group of 80 men, each carrying about 40 kg of relief supplies, from a motorized infantry brigade under commander Yang Wenyao, as they tried to reach the ethnically Tibetan village of Sier at a height of 4000 m above sea level in Pingwu county. The extreme terrain conditions precluded the use of he... | Armed conflict between ethnic Chinese rebels and the Myanmar Armed Forces have resulted in the Kokang offensive in February 2015. The conflict had forced 40,000 to 50,000 civilians to flee their homes and seek shelter on the Chinese side of the border. During the incident the government of China was accused of giving military assistance to the ethnic Chinese rebels. Burmese officials have been historically 'manipulated' and pressured by the communist Chinese government throughout Burmese modern history to create closer and binding ties with China, creating a Chinese satellite state in Southeast Asia. |
If the brewery tap is not located in the brewery, where is it usually located? | A brewery tap is the nearest outlet for a brewery's beers. This is usually a room or bar in the brewery itself, though the name may be applied to the nearest pub. The term is not applied to a brewpub which brews and sells its beer on the same premises. | A brewery tap is the nearest outlet for a brewery's beers. This is usually a room or bar in the brewery itself, though the name may be applied to the nearest pub. The term is not applied to a brewpub which brews and sells its beer on the same premises. |
Who teaches Yale's residential college's undergraduate classes? | Yale's residential college system was established in 1933 by Edward S. Harkness, who admired the social intimacy of Oxford and Cambridge and donated significant funds to found similar colleges at Yale and Harvard. Though Yale's colleges resemble their English precursors organizationally and architecturally, they are dependent entities of Yale College and have limited autonomy. The colleges are led by a master and an academic dean, who reside in the college, and university faculty and affiliates comprise each college's fellowship. Colleges offer their own seminars, social events, and speaking engagements known as "Master's Teas," but do not contain programs of study or academic departments. Instead, all undergraduate courses are taught by the Faculty of Arts and Sciences and are open to members of any college. | Yale's residential college system was established in 1933 by Edward S. Harkness, who admired the social intimacy of Oxford and Cambridge and donated significant funds to found similar colleges at Yale and Harvard. Though Yale's colleges resemble their English precursors organizationally and architecturally, they are dependent entities of Yale College and have limited autonomy. The colleges are led by a master and an academic dean, who reside in the college, and university faculty and affiliates comprise each college's fellowship. Colleges offer their own seminars, social events, and speaking engagements known as "Master's Teas," but do not contain programs of study or academic departments. Instead, all undergraduate courses are taught by the Faculty of Arts and Sciences and are open to members of any college. |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim"
4}eval_strategy: stepsper_device_train_batch_size: 256per_device_eval_batch_size: 256num_train_epochs: 8warmup_ratio: 0.1fp16: Truebatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 256per_device_eval_batch_size: 256per_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: 8max_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}tp_size: 0fsdp_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 | gooqa-dev_cosine_accuracy |
|---|---|---|---|---|
| -1 | -1 | - | - | 0.3256 |
| 0.5780 | 100 | 0.5627 | 0.8811 | 0.3898 |
| 1.1561 | 200 | 0.478 | 0.8482 | 0.4000 |
| 1.7341 | 300 | 0.4128 | 0.8452 | 0.4014 |
| 2.3121 | 400 | 0.3662 | 0.8450 | 0.4010 |
| 2.8902 | 500 | 0.3289 | 0.8300 | 0.4032 |
| 3.4682 | 600 | 0.2797 | 0.8228 | 0.4058 |
| 4.0462 | 700 | 0.2694 | 0.8253 | 0.4030 |
| 4.6243 | 800 | 0.2329 | 0.8301 | 0.4006 |
| 5.2023 | 900 | 0.2242 | 0.8281 | 0.4062 |
| 5.7803 | 1000 | 0.2089 | 0.8290 | 0.4012 |
| 6.3584 | 1100 | 0.1982 | 0.8310 | 0.4022 |
| 6.9364 | 1200 | 0.1928 | 0.8292 | 0.4058 |
| 7.5145 | 1300 | 0.1784 | 0.8293 | 0.4058 |
| -1 | -1 | - | - | 0.4038 |
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}