Views
No views yet
pip install -U sentence-transformers1from sentence_transformers import CrossEncoder
2
3# Download from the 🤗 Hub
4model = CrossEncoder("alantang2025/reranker-MiniLM-L12-H384-uncased-msmarco-margin-mse")
5# Get scores for pairs of texts
6pairs = [
7 ['what is mcafee sidewinder control center', 'McAfee Firewall Enterprise Control Center. McAfee Firewall Enterprise Control Center (CommandCenterâ\x84¢) provides a central interface for simplifying the management of multiple McAfee Firewall Enterprise (Sidewinder®) appliances.'],
8 ['where is cork ie', 'Cork, Irish Corcaigh (â\x80\x9cMarshâ\x80\x9d), seaport and seat of County Cork, in the province of Munster, Ireland. It is located at the head of Cork Harbour on the River Lee. Cork is, after Dublin, the Irish republicâ\x80\x99s second largest conurbation. The city is administratively independent of the county.'],
9 ['what is a embedded computer system', 'Embedded Computer Systems. An embedded system is a special-purpose system in which the computer is completely encapsulated by the device it controls. Unlike a general-purpose computer, such as a personal computer, an embedded system performs pre-defined tasks, usually with very specific requirements.'],
10 ['who is kennedy space center named after', "Cecil replies: Sure, but let's get our facts straight: they didn't change the name of the space center, they changed the name of the cape â\x80\x94 i.e., the land under the space center (or under part of it, anyway). The NASA launch facility continues to be known as the John F. Kennedy Space Center. The whole confusing business got started back on November 27, 1963, shortly after JFK's assassination, when Lyndon Johnson was casting about for a suitable memorial for the slain president."],
11 ['how to calculate protein requirement for a horse', 'Although protein is listed as a percentage on feed tags, the National Research Councilâ\x80\x99s (NRC) latest recommendation for horses lists the protein requirement unit in grams. To understand how much protein to feed a horse, we need to do some math and further reading.Many people think that a 30 percent protein feed is way too much for a horse to handle. If one looks a little closer, the tag of Hubbard Lifeâ\x80\x99s 30% Supplement indicates that a 1,100-pound horse should consume one pound per day.Thirty percent of one pound is 136 grams of protein.verage mixed hay is about 17 percent protein. Feeding 15 pounds of hay alone can deliver 1,157 grams of protein to a horse. Understanding the protein content and feeding rates of all the feed sources a horse has access to is key to achieving the proper protein ratio.'],
12]
13scores = model.predict(pairs)
14print(scores.shape)
15# (5,)
16
17# Or rank different texts based on similarity to a single text
18ranks = model.rank(
19 'what is mcafee sidewinder control center',
20 [
21 'McAfee Firewall Enterprise Control Center. McAfee Firewall Enterprise Control Center (CommandCenterâ\x84¢) provides a central interface for simplifying the management of multiple McAfee Firewall Enterprise (Sidewinder®) appliances.',
22 'Cork, Irish Corcaigh (â\x80\x9cMarshâ\x80\x9d), seaport and seat of County Cork, in the province of Munster, Ireland. It is located at the head of Cork Harbour on the River Lee. Cork is, after Dublin, the Irish republicâ\x80\x99s second largest conurbation. The city is administratively independent of the county.',
23 'Embedded Computer Systems. An embedded system is a special-purpose system in which the computer is completely encapsulated by the device it controls. Unlike a general-purpose computer, such as a personal computer, an embedded system performs pre-defined tasks, usually with very specific requirements.',
24 "Cecil replies: Sure, but let's get our facts straight: they didn't change the name of the space center, they changed the name of the cape â\x80\x94 i.e., the land under the space center (or under part of it, anyway). The NASA launch facility continues to be known as the John F. Kennedy Space Center. The whole confusing business got started back on November 27, 1963, shortly after JFK's assassination, when Lyndon Johnson was casting about for a suitable memorial for the slain president.",
25 'Although protein is listed as a percentage on feed tags, the National Research Councilâ\x80\x99s (NRC) latest recommendation for horses lists the protein requirement unit in grams. To understand how much protein to feed a horse, we need to do some math and further reading.Many people think that a 30 percent protein feed is way too much for a horse to handle. If one looks a little closer, the tag of Hubbard Lifeâ\x80\x99s 30% Supplement indicates that a 1,100-pound horse should consume one pound per day.Thirty percent of one pound is 136 grams of protein.verage mixed hay is about 17 percent protein. Feeding 15 pounds of hay alone can deliver 1,157 grams of protein to a horse. Understanding the protein content and feeding rates of all the feed sources a horse has access to is key to achieving the proper protein ratio.',
26 ]
27)
28# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]NanoMSMARCO_R100, NanoNFCorpus_R100 and NanoNQ_R100CrossEncoderRerankingEvaluator with these parameters:
1{
2 "at_k": 10,
3 "always_rerank_positives": true
4}| Metric | NanoMSMARCO_R100 | NanoNFCorpus_R100 | NanoNQ_R100 |
|---|---|---|---|
| map | 0.5676 (+0.0780) | 0.3529 (+0.0919) | 0.7124 (+0.2928) |
| mrr@10 | 0.5587 (+0.0812) | 0.6198 (+0.1200) | 0.7270 (+0.3003) |
| ndcg@10 | 0.6364 (+0.0960) | 0.4158 (+0.0907) | 0.7557 (+0.2551) |
NanoBEIR_R100_meanCrossEncoderNanoBEIREvaluator with these parameters:
1{
2 "dataset_names": [
3 "msmarco",
4 "nfcorpus",
5 "nq"
6 ],
7 "rerank_k": 100,
8 "at_k": 10,
9 "always_rerank_positives": true
10}| Metric | Value |
|---|---|
| map | 0.5443 (+0.1542) |
| mrr@10 | 0.6352 (+0.1672) |
| ndcg@10 | 0.6026 (+0.1473) |
score, query, positive, and negative| score | query | positive | negative | |
|---|---|---|---|---|
| type | float | string | string | string |
| details |
|
|
|
|
| score | query | positive | negative |
|---|---|---|---|
20.983789285024006 | what is a french bulldog | The French Bulldog is a small breed of domestic dog. Frenchies were the result in the 1800s of a cross between bulldog ancestors imported from England and local ratters in Paris, France.In the UK, they moved up to become the fourth most popular registered dog by 2014.he modern French Bulldog breed descends directly from the dogs of the Molossians, an ancient Greek tribe. | The many faces of Duke Dog: Bulldog, human mascot, statue and cartoon. In all likelihood, James Madison University is the only college or university in the country whose athletic teams draw their nickname from the name of the school's president. |
20.930927753448486 | difference between hostname and domain name | hostname is the name given to the end-point (the machine in question) and will be used to identify it over DNS if that is configured. domain is the name given to the 'network' it will be required to reach the network from an external point (like the Internet) | Determining the domain of a function. Determine the domains of functions according to various considerations. 1 How to determine the domain of a radical function (example) (Video). 2 How to determine the domain of algebraic functions (examples) (Video). 3 Domain of algebraic functions (Exercise). |
12.55810809135437 | will sod come back if overwatered | Root Death. Pull up pieces of the sod in different areas after the sod has established for a few weeks. Healthy sod that gets the right amount of water will resist the pull because the roots are healthy and growing. Overwatered sod will come right up because its roots are dying or dead.f the soil is wet and mushy, you're watering too much. Let the sod dry out until the top 2 inches of soil are dry and crumbly. Washington State University recommends early morning watering, which allows soil and grass blades to dry out thoroughly during the day. | THE ADVANTAGES OF HYDRO SEEDING! Hydroseeding is a fast, cost effective way to have a new lawn that will turn your neighbors green with envy. Hydroseeding costs only a little more than old fashioned methods using dry seeding techniques combined with a messy straw mulch.ydro Seeding mulch adds to the humus content of a lawn as it decomposes. The bacterial action of straw will leach nitrogen from the soil as it decomposes. ADVANTAGES OF HYDROSEEDING OVER SOD Sod is a good solution to the need for a new lawn. It is expensive. Sod generally costs 3 to 5 times more than hydroseeding. |
MarginMSELoss with these parameters:
1{
2 "activation_fn": "torch.nn.modules.linear.Identity"
3}score, query, positive, and negative| score | query | positive | negative | |
|---|---|---|---|---|
| type | float | string | string | string |
| details |
|
|
|
|
| score | query | positive | negative |
|---|---|---|---|
18.650261163711548 | what is mcafee sidewinder control center | McAfee Firewall Enterprise Control Center. McAfee Firewall Enterprise Control Center (CommandCenterâ¢) provides a central interface for simplifying the management of multiple McAfee Firewall Enterprise (Sidewinder®) appliances. | JSC's Mission Control â now formally known as the Christopher C. Kraft, Jr. Mission Control Center â has helped plan, support and operate every NASA human spaceflight mission since 1965. |
14.571923971176147 | where is cork ie | Cork, Irish Corcaigh (âMarshâ), seaport and seat of County Cork, in the province of Munster, Ireland. It is located at the head of Cork Harbour on the River Lee. Cork is, after Dublin, the Irish republicâs second largest conurbation. The city is administratively independent of the county. | suberin. (biochemistry). A fatty substance found in many plant cell walls, especially cork. |
18.947856426239014 | what is a embedded computer system | Embedded Computer Systems. An embedded system is a special-purpose system in which the computer is completely encapsulated by the device it controls. Unlike a general-purpose computer, such as a personal computer, an embedded system performs pre-defined tasks, usually with very specific requirements. | Confidence votes 13.4K. It means that an application (a software, a computer program) is not compatible (it doesn't work well or doesn't work at all)with the operating system running on a computer. Applications are software programs that you can download onto your computer and some mobile phones. A computer game, for example, is an application. An MP3 player system ⦠on your computer or phone is also an application.. + 12 others found this useful. Ashley Reeves. Answered. |
MarginMSELoss with these parameters:
1{
2 "activation_fn": "torch.nn.modules.linear.Identity"
3}eval_strategy: stepsper_device_train_batch_size: 16per_device_eval_batch_size: 16learning_rate: 8e-06num_train_epochs: 1warmup_ratio: 0.1seed: 12bf16: Truedataloader_num_workers: 4load_best_model_at_end: 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: 8e-06weight_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: 12data_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: 4dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Trueignore_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: 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: batch_samplermulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | Validation Loss | NanoMSMARCO_R100_ndcg@10 | NanoNFCorpus_R100_ndcg@10 | NanoNQ_R100_ndcg@10 | NanoBEIR_R100_mean_ndcg@10 |
|---|---|---|---|---|---|---|---|
| -1 | -1 | - | - | 0.0185 (-0.5220) | 0.1835 (-0.1415) | 0.0374 (-0.4632) | 0.0798 (-0.3756) |
| 0.0000 | 1 | 183.8208 | - | - | - | - | - |
| 0.0322 | 4000 | 148.9381 | - | - | - | - | - |
| 0.0643 | 8000 | 27.4436 | - | - | - | - | - |
| 0.0965 | 12000 | 8.3597 | - | - | - | - | - |
| 0.1286 | 16000 | 6.374 | - | - | - | - | - |
| 0.1608 | 20000 | 5.4584 | 4.7464 | 0.6619 (+0.1215) | 0.3947 (+0.0696) | 0.7165 (+0.2158) | 0.5910 (+0.1356) |
| 0.1930 | 24000 | 4.9963 | - | - | - | - | - |
| 0.2251 | 28000 | 4.6626 | - | - | - | - | - |
| 0.2573 | 32000 | 4.3576 | - | - | - | - | - |
| 0.2894 | 36000 | 4.1884 | - | - | - | - | - |
| 0.3216 | 40000 | 4.0283 | 4.4428 | 0.6594 (+0.1190) | 0.3927 (+0.0676) | 0.7435 (+0.2428) | 0.5985 (+0.1432) |
| 0.3538 | 44000 | 3.8617 | - | - | - | - | - |
| 0.3859 | 48000 | 3.734 | - | - | - | - | - |
| 0.4181 | 52000 | 3.5985 | - | - | - | - | - |
| 0.4503 | 56000 | 3.6228 | - | - | - | - | - |
| 0.4824 | 60000 | 3.4607 | 3.4983 | 0.6285 (+0.0881) | 0.4059 (+0.0809) | 0.7429 (+0.2423) | 0.5924 (+0.1371) |
| 0.5146 | 64000 | 3.4429 | - | - | - | - | - |
| 0.5467 | 68000 | 3.3256 | - | - | - | - | - |
| 0.5789 | 72000 | 3.2512 | - | - | - | - | - |
| 0.6111 | 76000 | 3.2302 | - | - | - | - | - |
| 0.6432 | 80000 | 3.1449 | 3.0647 | 0.6427 (+0.1023) | 0.4070 (+0.0820) | 0.7428 (+0.2421) | 0.5975 (+0.1421) |
| 0.6754 | 84000 | 3.1304 | - | - | - | - | - |
| 0.7075 | 88000 | 3.0615 | - | - | - | - | - |
| 0.7397 | 92000 | 3.0513 | - | - | - | - | - |
| 0.7719 | 96000 | 3.0657 | - | - | - | - | - |
| 0.804 | 100000 | 2.9726 | 3.0527 | 0.6364 (+0.0960) | 0.4158 (+0.0907) | 0.7557 (+0.2551) | 0.6026 (+0.1473) |
| 0.8362 | 104000 | 2.9537 | - | - | - | - | - |
| 0.8683 | 108000 | 2.9453 | - | - | - | - | - |
| 0.9005 | 112000 | 2.8856 | - | - | - | - | - |
| 0.9327 | 116000 | 2.9301 | - | - | - | - | - |
| 0.9648 | 120000 | 2.8464 | 2.9493 | 0.6475 (+0.1070) | 0.4105 (+0.0855) | 0.7406 (+0.2399) | 0.5995 (+0.1442) |
| 0.9970 | 124000 | 2.8968 | - | - | - | - | - |
| -1 | -1 | - | - | 0.6364 (+0.0960) | 0.4158 (+0.0907) | 0.7557 (+0.2551) | 0.6026 (+0.1473) |
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{hofstätter2021improving,
2 title={Improving Efficient Neural Ranking Models with Cross-Architecture Knowledge Distillation},
3 author={Sebastian Hofstätter and Sophia Althammer and Michael Schröder and Mete Sertkan and Allan Hanbury},
4 year={2021},
5 eprint={2010.02666},
6 archivePrefix={arXiv},
7 primaryClass={cs.IR}
8}