Views
No views yet
SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'BertModel'})
(1): Pooling({'embedding_dimension': 768, 'pooling_mode': 'cls', 'include_prompt': True})
(2): Normalize({})
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("7j/bge-base-en-v1.5-rag-query-adapter")
5# Run inference
6queries = [
7 'which act requires manufacturers to disclose the origins of their minerals?',
8]
9documents = [
10 'International efforts to reduce trade in conflict resources, tried to reduce incentives to extract and fight over them. For example, in the United States, the 2010 Doddâ\x80\x93Frank Wall Street Reform and Consumer Protection Act required manufacturers to audit their supply chains and report use of conflict minerals. In 2015 a US federal appeals court struck down some aspects of the reporting requirements as a violation of corporationsâ\x80\x99 freedom of speech, but left others in place.',
11 'In 2010, Congress passed the Dodd-Frank Act, which directs the Commission to issue rules requiring certain companies to disclose their use of conflict minerals if those minerals are â\x80\x9cnecessary to the functionality or production of a productâ\x80\x9d manufactured by those companies. Under the Act, those minerals include tantalum, tin, gold or tungsten.',
12 'Gastric balloon is a reversible, incision free weight loss procedure. There is one such device approved in the U.S. the ReShape Integrated Dual Balloon System but gastric balloons have been approved and used for years in some parts of Europe, as well as Canada, Australia, Mexico and South America.dvocates believe that it can still result in lasting and ongoing weight loss after removal because it helps exact behavioral changes; their theory holds that people get used to eating smaller portions of food and are therefore more inclined to continue to eat in this manner long after the balloon is removed.',
13]
14query_embeddings = model.encode_query(queries)
15document_embeddings = model.encode_document(documents)
16print(query_embeddings.shape, document_embeddings.shape)
17# [1, 768] [3, 768]
18
19# Get the similarity scores for the embeddings
20similarities = model.similarity(query_embeddings, document_embeddings)
21print(similarities)
22# tensor([[0.6827, 0.7777, 0.3553]])NanoMSMARCO and NanoNQInformationRetrievalEvaluator| Metric | NanoMSMARCO | NanoNQ |
|---|---|---|
| cosine_accuracy@1 | 0.46 | 0.54 |
| cosine_accuracy@3 | 0.66 | 0.68 |
| cosine_accuracy@5 | 0.72 | 0.7 |
| cosine_accuracy@10 | 0.82 | 0.78 |
| cosine_precision@1 | 0.46 | 0.54 |
| cosine_precision@3 | 0.22 | 0.2267 |
| cosine_precision@5 | 0.144 | 0.14 |
| cosine_precision@10 | 0.082 | 0.084 |
| cosine_recall@1 | 0.46 | 0.52 |
| cosine_recall@3 | 0.66 | 0.65 |
| cosine_recall@5 | 0.72 | 0.66 |
| cosine_recall@10 | 0.82 | 0.75 |
| cosine_ndcg@10 | 0.6316 | 0.6444 |
| cosine_mrr@10 | 0.5724 | 0.6237 |
| cosine_map@100 | 0.5825 | 0.6114 |
NanoBEIR_meanNanoBEIREvaluator with these parameters:
1{
2 "dataset_names": [
3 "MSMARCO",
4 "NQ"
5 ],
6 "dataset_id": "sentence-transformers/NanoBEIR-en"
7}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.5 |
| cosine_accuracy@3 | 0.67 |
| cosine_accuracy@5 | 0.71 |
| cosine_accuracy@10 | 0.8 |
| cosine_precision@1 | 0.5 |
| cosine_precision@3 | 0.2233 |
| cosine_precision@5 | 0.142 |
| cosine_precision@10 | 0.083 |
| cosine_recall@1 | 0.49 |
| cosine_recall@3 | 0.655 |
| cosine_recall@5 | 0.69 |
| cosine_recall@10 | 0.785 |
| cosine_ndcg@10 | 0.638 |
| cosine_mrr@10 | 0.5981 |
| cosine_map@100 | 0.597 |
query, positive, and negative| query | positive | negative | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| query | positive | negative |
|---|---|---|
what are the liberal arts? | liberal arts. 1. the academic course of instruction at a college intended to provide general knowledge and comprising the arts, humanities, natural sciences, and social sciences, as opposed to professional or technical subjects. | The New York State Education Department requires 60 Liberal Arts credits in a Bachelor of Science program and 90 Liberal Arts credits in a Bachelor of Arts program. In the list of course descriptions, courses which are liberal arts for all students are identified by (Liberal Arts) after the course number. |
what is the mechanism of action of fibrinolytic or thrombolytic drugs? | Baillière's Clinical Haematology. 6 Mechanism of action of the thrombolytic agents. 6 Mechanism of action of the thrombolytic agents JEFFREY I. WEITZ Fibrin formed during the haemostatic, inflammatory or tissue repair process serves a temporary role, and must be degraded to restore normal tissue function and structure. | Fibrinolytic drug. Fibrinolytic drug, also called thrombolytic drug, any agent that is capable of stimulating the dissolution of a blood clot (thrombus). Fibrinolytic drugs work by activating the so-called fibrinolytic pathway. |
what is normal plat count | 78 Followers. A. Platelets are the tiny blood cells that help stop bleeding by binding together to form a clump or plug at sites of injury inside blood vessels. A normal platelet count is between 150,000 and 450,000 platelets per microliter (one-millionth of a liter, abbreviated mcL).The average platelet count is 237,000 per mcL in men and 266,000 per mcL in women.8 Followers. A. Platelets are the tiny blood cells that help stop bleeding by binding together to form a clump or plug at sites of injury inside blood vessels. A normal platelet count is between 150,000 and 450,000 platelets per microliter (one-millionth of a liter, abbreviated mcL). | Your blood test results should be written in your maternity notes. Your platelet count will look something like Plat. 160x10.9/L, which means you have a platelet count of 160, which is in the normal range.If your platelet count is low, the blood test should be done again.This will keep track of whether or not your count is dropping.our platelet count will look something like Plat. 160x10.9/L, which means you have a platelet count of 160, which is in the normal range. If your platelet count is low, the blood test should be done again. This will keep track of whether or not your count is dropping. |
MatryoshkaLoss with these parameters:
1{
2 "loss": "MultipleNegativesRankingLoss",
3 "matryoshka_dims": [
4 768,
5 512,
6 256,
7 128,
8 64
9 ],
10 "matryoshka_weights": [
11 1,
12 1,
13 1,
14 1,
15 1
16 ],
17 "n_dims_per_step": -1
18}query and answer| query | answer | |
|---|---|---|
| type | string | string |
| details |
|
|
| query | answer |
|---|---|
when did richmond last play in a preliminary final | Richmond Football Club Richmond began 2017 with 5 straight wins, a feat it had not achieved since 1995. A series of close losses hampered the Tigers throughout the middle of the season, including a 5-point loss to the Western Bulldogs, 2-point loss to Fremantle, and a 3-point loss to the Giants. Richmond ended the season strongly with convincing victories over Fremantle and St Kilda in the final two rounds, elevating the club to 3rd on the ladder. Richmond's first final of the season against the Cats at the MCG attracted a record qualifying final crowd of 95,028; the Tigers won by 51 points. Having advanced to the first preliminary finals for the first time since 2001, Richmond defeated Greater Western Sydney by 36 points in front of a crowd of 94,258 to progress to the Grand Final against Adelaide, their first Grand Final appearance since 1982. The attendance was 100,021, the largest crowd to a grand final since 1986. The Crows led at quarter time and led by as many as 13, but the Tig... |
who sang what in the world's come over you | Jack Scott (singer) At the beginning of 1960, Scott again changed record labels, this time to Top Rank Records.[1] He then recorded four Billboard Hot 100 hits – "What in the World's Come Over You" (#5), "Burning Bridges" (#3) b/w "Oh Little One" (#34), and "It Only Happened Yesterday" (#38).[1] "What in the World's Come Over You" was Scott's second gold disc winner.[6] Scott continued to record and perform during the 1960s and 1970s.[1] His song "You're Just Gettin' Better" reached the country charts in 1974.[1] In May 1977, Scott recorded a Peel session for BBC Radio 1 disc jockey, John Peel. |
who produces the most wool in the world | Wool Global wool production is about 2 million tonnes per year, of which 60% goes into apparel. Wool comprises ca 3% of the global textile market, but its value is higher owing to dying and other modifications of the material.[1] Australia is a leading producer of wool which is mostly from Merino sheep but has been eclipsed by China in terms of total weight.[30] New Zealand (2016) is the third-largest producer of wool, and the largest producer of crossbred wool. Breeds such as Lincoln, Romney, Drysdale, and Elliotdale produce coarser fibers, and wool from these sheep is usually used for making carpets. |
MatryoshkaLoss with these parameters:
1{
2 "loss": "MultipleNegativesRankingLoss",
3 "matryoshka_dims": [
4 768,
5 512,
6 256,
7 128,
8 64
9 ],
10 "matryoshka_weights": [
11 1,
12 1,
13 1,
14 1,
15 1
16 ],
17 "n_dims_per_step": -1
18}per_device_train_batch_size: 16num_train_epochs: 1learning_rate: 2e-05warmup_steps: 0.1weight_decay: 0.01gradient_accumulation_steps: 4disable_tqdm: Trueper_device_eval_batch_size: 32push_to_hub: Truehub_model_id: 7j/bge-base-en-v1.5-rag-query-adapterdataloader_num_workers: 2batch_sampler: no_duplicatesper_device_train_batch_size: 16num_train_epochs: 1max_steps: -1learning_rate: 2e-05lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_steps: 0.1optim: adamw_torch_fusedoptim_args: Noneweight_decay: 0.01adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08optim_target_modules: Nonegradient_accumulation_steps: 4average_tokens_across_devices: Truemax_grad_norm: 1.0label_smoothing_factor: 0.0bf16: Falsefp16: Falsebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Nonetorch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneuse_liger_kernel: Falseliger_kernel_config: Noneuse_cache: Falseneftune_noise_alpha: Nonetorch_empty_cache_steps: Noneauto_find_batch_size: Falselog_on_each_node: Truelogging_nan_inf_filter: Trueinclude_num_input_tokens_seen: nolog_level: passivelog_level_replica: warningdisable_tqdm: Trueproject: huggingfacetrackio_space_id: trackioper_device_eval_batch_size: 32prediction_loss_only: Trueeval_on_start: Falseeval_do_concat_batches: Trueeval_use_gather_object: Falseeval_accumulation_steps: Noneinclude_for_metrics: []batch_eval_metrics: Falsesave_only_model: Falsesave_on_each_node: Falseenable_jit_checkpoint: Falsepush_to_hub: Truehub_private_repo: Nonehub_model_id: 7j/bge-base-en-v1.5-rag-query-adapterhub_strategy: every_savehub_always_push: Falsehub_revision: Noneload_best_model_at_end: Falseignore_data_skip: Falserestore_callback_states_from_checkpoint: Falsefull_determinism: Falseseed: 42data_seed: Noneuse_cpu: Falseaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedataloader_drop_last: Falsedataloader_num_workers: 2dataloader_pin_memory: Truedataloader_persistent_workers: Falsedataloader_prefetch_factor: Noneremove_unused_columns: Truelabel_names: Nonetrain_sampling_strategy: randomlength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falseddp_backend: Noneddp_timeout: 1800fsdp: []fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}deepspeed: Nonedebug: []skip_memory_metrics: Truedo_predict: Falseresume_from_checkpoint: Nonewarmup_ratio: Nonelocal_rank: -1prompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | NanoMSMARCO_cosine_ndcg@10 | NanoNQ_cosine_ndcg@10 | NanoBEIR_mean_cosine_ndcg@10 |
|---|---|---|---|---|---|
| 0.0032 | 1 | 3.7036 | - | - | - |
| 0.032 | 10 | 1.8804 | - | - | - |
| 0.064 | 20 | 2.3442 | - | - | - |
| 0.096 | 30 | 2.0224 | - | - | - |
| 0.128 | 40 | 2.1542 | - | - | - |
| 0.16 | 50 | 1.9589 | - | - | - |
| 0.192 | 60 | 2.0630 | - | - | - |
| 0.224 | 70 | 2.2774 | - | - | - |
| 0.256 | 80 | 1.7651 | - | - | - |
| 0.288 | 90 | 2.0196 | - | - | - |
| 0.32 | 100 | 1.8836 | - | - | - |
| 0.352 | 110 | 2.2037 | - | - | - |
| 0.384 | 120 | 2.3894 | - | - | - |
| 0.416 | 130 | 1.7873 | - | - | - |
| 0.448 | 140 | 1.9101 | - | - | - |
| 0.48 | 150 | 1.9055 | - | - | - |
| 0.512 | 160 | 1.7553 | - | - | - |
| 0.544 | 170 | 2.1702 | - | - | - |
| 0.576 | 180 | 1.9363 | - | - | - |
| 0.608 | 190 | 2.0139 | - | - | - |
| 0.64 | 200 | 1.6861 | - | - | - |
| 0.672 | 210 | 1.7386 | - | - | - |
| 0.704 | 220 | 2.0747 | - | - | - |
| 0.736 | 230 | 2.1088 | - | - | - |
| 0.768 | 240 | 1.7917 | - | - | - |
| 0.8 | 250 | 1.6875 | - | - | - |
| 0.832 | 260 | 2.2581 | - | - | - |
| 0.864 | 270 | 1.7539 | - | - | - |
| 0.896 | 280 | 1.6714 | - | - | - |
| 0.928 | 290 | 1.5976 | - | - | - |
| 0.96 | 300 | 1.7032 | - | - | - |
| 0.992 | 310 | 1.6623 | - | - | - |
| -1 | -1 | - | 0.6316 | 0.6444 | 0.6380 |
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{kusupati2024matryoshka,
2 title={Matryoshka Representation Learning},
3 author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
4 year={2024},
5 eprint={2205.13147},
6 archivePrefix={arXiv},
7 primaryClass={cs.LG}
8}1@misc{oord2019representationlearningcontrastivepredictive,
2 title={Representation Learning with Contrastive Predictive Coding},
3 author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
4 year={2019},
5 eprint={1807.03748},
6 archivePrefix={arXiv},
7 primaryClass={cs.LG},
8 url={https://arxiv.org/abs/1807.03748},
9}