CrossEncoder based on bansalaman18/bert-uncased_L-10_H-512_A-8
This is a Cross Encoder model finetuned from bansalaman18/bert-uncased_L-10_H-512_A-8 on the ms_marco dataset using the sentence-transformers library. It computes scores for pairs of texts, which can be used for text reranking and semantic search.
Model Details
Model Description
- Model Type: Cross Encoder
- Base model: bansalaman18/bert-uncased_L-10_H-512_A-8
- Maximum Sequence Length: 512 tokens
- Number of Output Labels: 1 label
- Training Dataset:
- Language: en
Model Sources
- Documentation: Sentence Transformers Documentation
- Documentation: Cross Encoder Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Cross Encoders on Hugging Face
Usage
Direct Usage (Sentence Transformers)
First install the Sentence Transformers library:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import CrossEncoder
# Download from the 🤗 Hub
model = CrossEncoder("rahulseetharaman/reranker-msmarco-v1.1-bert-uncased_L-10_H-512_A-8-listnet")
# Get scores for pairs of texts
pairs = [
['largest mammal on earth', "The Blue whale is the largest mammal on earth. average size of the whale is 87 feet long. that's about as big as a passenger jet. it is also the loudest animal on the planet. … And the whale shark is a fish. The blue whale of course being the largest. Blue whale is not only the largest mammal on earth … , but the largest animal of any kind on the earth. Better still, the blue whale, is the largest animal to ever exist"],
['largest mammal on earth', 'The Largest Animal Ever: The Blue Whale. The blue whale (Balaenoptera musculus) is a marine mammal belonging to the suborder of baleen whales. At 30 metres (98 ft) in length and 180 metric tons (200 short tons) or more in weight, it is the largest known animal to have ever existed. The African Bush Elephant is the largest living terrestrial (land) animal, with males reaching 6 to 7.5 metres (19.7 to 24.6 ft) in length, 3.3 metres (10.8 ft) in height at the shoulder, and weighing 6 t (13,000 lb).'],
['largest mammal on earth', "By considerable measure, the largest known animal on Earth is the blue whale. Mature blue whales can measure anywhere from 75 feet (23 m) to 100 feet (30.5 m) from head to tail, and can weigh as much as 150 tons (136 metric tons). Most people believe that the largest animals to ever exist on Earth were the dinosaurs. However, one of the largest land dinosaurs, the sauropod Argentinosaurus, weighed only about 180,000 pounds (81,647 kg). That's little more than half the size of an adult blue whale"],
['largest mammal on earth', 'When a blue whale exhales, the spray from its blowhole can reach nearly 30 ft (9m) into the air. Size relative to a bus: Blue whales are the largest animals ever known to have lived on Earth. These magnificent marine mammals rule the oceans at up to 100 feet (30 meters) long and upwards of 200 tons (181 metric tons). Their tongues alone can weigh as much as an elephant. Their hearts, as much as an automobile. '],
['largest mammal on earth', 'The largest mammal on Earth is also the largest animal to ever live on land or in the ocean, dwarfing even the largest Dinosaur, and is the Blue Whale. The blue whale of course being the largest. Blue whale is not only the largest mammal on earth … , but the largest animal of any kind on the earth. Better still, the blue whale, is the largest animal to ever exist'],
]
scores = model.predict(pairs)
print(scores.shape)
# (5,)
# Or rank different texts based on similarity to a single text
ranks = model.rank(
'largest mammal on earth',
[
"The Blue whale is the largest mammal on earth. average size of the whale is 87 feet long. that's about as big as a passenger jet. it is also the loudest animal on the planet. … And the whale shark is a fish. The blue whale of course being the largest. Blue whale is not only the largest mammal on earth … , but the largest animal of any kind on the earth. Better still, the blue whale, is the largest animal to ever exist",
'The Largest Animal Ever: The Blue Whale. The blue whale (Balaenoptera musculus) is a marine mammal belonging to the suborder of baleen whales. At 30 metres (98 ft) in length and 180 metric tons (200 short tons) or more in weight, it is the largest known animal to have ever existed. The African Bush Elephant is the largest living terrestrial (land) animal, with males reaching 6 to 7.5 metres (19.7 to 24.6 ft) in length, 3.3 metres (10.8 ft) in height at the shoulder, and weighing 6 t (13,000 lb).',
"By considerable measure, the largest known animal on Earth is the blue whale. Mature blue whales can measure anywhere from 75 feet (23 m) to 100 feet (30.5 m) from head to tail, and can weigh as much as 150 tons (136 metric tons). Most people believe that the largest animals to ever exist on Earth were the dinosaurs. However, one of the largest land dinosaurs, the sauropod Argentinosaurus, weighed only about 180,000 pounds (81,647 kg). That's little more than half the size of an adult blue whale",
'When a blue whale exhales, the spray from its blowhole can reach nearly 30 ft (9m) into the air. Size relative to a bus: Blue whales are the largest animals ever known to have lived on Earth. These magnificent marine mammals rule the oceans at up to 100 feet (30 meters) long and upwards of 200 tons (181 metric tons). Their tongues alone can weigh as much as an elephant. Their hearts, as much as an automobile. ',
'The largest mammal on Earth is also the largest animal to ever live on land or in the ocean, dwarfing even the largest Dinosaur, and is the Blue Whale. The blue whale of course being the largest. Blue whale is not only the largest mammal on earth … , but the largest animal of any kind on the earth. Better still, the blue whale, is the largest animal to ever exist',
]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
Evaluation
Metrics
Cross Encoder Reranking
- Datasets:
NanoMSMARCO_R100
,NanoNFCorpus_R100
andNanoNQ_R100
- Evaluated with
CrossEncoderRerankingEvaluator
with these parameters:{ "at_k": 10, "always_rerank_positives": true }
Metric | NanoMSMARCO_R100 | NanoNFCorpus_R100 | NanoNQ_R100 |
---|---|---|---|
map | 0.0770 (-0.4126) | 0.2696 (+0.0087) | 0.0734 (-0.3463) |
mrr@10 | 0.0500 (-0.4275) | 0.3686 (-0.1313) | 0.0560 (-0.3707) |
ndcg@10 | 0.0612 (-0.4792) | 0.2518 (-0.0732) | 0.0866 (-0.4141) |
Cross Encoder Nano BEIR
- Dataset:
NanoBEIR_R100_mean
- Evaluated with
CrossEncoderNanoBEIREvaluator
with these parameters:{ "dataset_names": [ "msmarco", "nfcorpus", "nq" ], "rerank_k": 100, "at_k": 10, "always_rerank_positives": true }
Metric | Value |
---|---|
map | 0.1400 (-0.2501) |
mrr@10 | 0.1582 (-0.3098) |
ndcg@10 | 0.1332 (-0.3222) |
Training Details
Training Dataset
ms_marco
- Dataset: ms_marco at a47ee7a
- Size: 78,704 training samples
- Columns:
query
,docs
, andlabels
- Approximate statistics based on the first 1000 samples:
query docs labels type string list list details - min: 9 characters
- mean: 33.93 characters
- max: 100 characters
- min: 2 elements
- mean: 6.38 elements
- max: 10 elements
- min: 2 elements
- mean: 6.38 elements
- max: 10 elements
- Samples:
query docs labels what animals does wool come from
['Wool comes from animals who grow it. The most common animal is sheep.There are others which include lama, alpaca ,and other mammals. Sheep wool is also very popular along with Cashmere wool which is collected from cashmere goats. Sheep are often farmed in places like Australia.', 'Goats. Mohair and cashmere come from goats. Mohair comes from the Angora goat, which produces a long shaggy coat that is generally clipped twice per year. According to the Department of Animal Science at Oklahoma State University, each shearing will yield approximately 5.3 pounds of wool.', 'Wool is the fibre derived from the fur of animals of the Caprinae family, principally sheep, but the hair of certain species of other mammals such as goats, alpacas and rabbits may also be called wool. This article deals explicitly with the wool produced from domestic sheep.', 'Fashionistas with a flair for fabrics know that wool can come from many animals, and that some wools are more desirable than others. Wools range from soft and silky ones used for clothing to coarse and strong wools used for rugs.', 'Confidence votes 259. Wool comes from animals who grow it. The most common animal is sheep.There are others which include lama, alpaca ,and other mammals. Sheep wool is also very popular along with Cashmere wool which is collected from cashmere goats.']
[1, 0, 0, 0, 0]
what is ecoflex
['ecoFLEX™: A blend of recycled polymers and wood byproducts, ecoFLEX exhibits the best characteristics of the polymers and wood that forms the basis for the material. ecoFLEX is the best of both. ecoFLEX is made by: The material is mixed with UV inhibitors and color blending compounds and granulated into a form that is used to mold the parts that are used to make an ecoFLEX based product.', 'Ecoflex is a pre-insulated pipe system at its best — versatile, flexible and durable. Ecoflex consists of Uponor crosslinked polyethylene (PEX) or high-density polyethylene (HDPE) pipe encased in closed-cell, PEX-foam insulation and covered by a watertight, corrugated HDPE jacket. Potable HDPE pipe is available in 1¼, 1½, 2, 3 and 4 sizes. 2 Ecoflex Potable Plus (one Uponor AquaPEX service pipe with heat trace) is available on a made-to-order basis. 3 Ecoflex Thermal and Potable PEX products up to 2 can use Uponor’s ProPEX® expansion fitting system.', 'JOIN THE QUIET REVOLUTION. Vauxhall’s ecoFL...
[1, 0, 0, 0, 0, ...]
common cold incubation period, period of illness and contagious period
['Most experts agree that adults with a cold or the flu start being contagious about a day before they start experiencing symptoms. For the flu, the contagious period then lasts five to seven days into the illness. For children, the contagious period for the flu can last up to two weeks after they start feeling sick, even if they start feeling better before that. The contagious period for a cold lasts about three to four days into the illness. As a general rule, people with a cold are most contagious about three days after their initial exposure to the virus. For more information on colds, influenza and related topics, check out the links on the next page. Print.', 'Confidence votes 40.4K. The incubation period of the common cold is typically 36 to 48 hours, but, in some cases, symptoms can arise within 12 hours, or slightly less, of catching the virus. There are over 200 viruses responsible for the common cold. According to the US Centers for Disease Control and Prevention (CDC), the ...
[1, 1, 0, 0, 0, ...]
- Loss:
ListNetLoss
with these parameters:{ "activation_fn": "torch.nn.modules.linear.Identity", "mini_batch_size": 16 }
Evaluation Dataset
ms_marco
- Dataset: ms_marco at a47ee7a
- Size: 1,000 evaluation samples
- Columns:
query
,docs
, andlabels
- Approximate statistics based on the first 1000 samples:
query docs labels type string list list details - min: 9 characters
- mean: 34.15 characters
- max: 99 characters
- min: 3 elements
- mean: 6.50 elements
- max: 10 elements
- min: 3 elements
- mean: 6.50 elements
- max: 10 elements
- Samples:
query docs labels largest mammal on earth
["The Blue whale is the largest mammal on earth. average size of the whale is 87 feet long. that's about as big as a passenger jet. it is also the loudest animal on the planet. … And the whale shark is a fish. The blue whale of course being the largest. Blue whale is not only the largest mammal on earth … , but the largest animal of any kind on the earth. Better still, the blue whale, is the largest animal to ever exist", 'The Largest Animal Ever: The Blue Whale. The blue whale (Balaenoptera musculus) is a marine mammal belonging to the suborder of baleen whales. At 30 metres (98 ft) in length and 180 metric tons (200 short tons) or more in weight, it is the largest known animal to have ever existed. The African Bush Elephant is the largest living terrestrial (land) animal, with males reaching 6 to 7.5 metres (19.7 to 24.6 ft) in length, 3.3 metres (10.8 ft) in height at the shoulder, and weighing 6 t (13,000 lb).', "By considerable measure, the largest known animal on Earth is the blu...
[1, 0, 0, 0, 0, ...]
what is the common name for metacarpals
['Ten percent of all fractures that occur are those to the metacarpals and phalanges, the most common injuries being from car accidents, sports injuries, and work-related injuries. The goal in repairing these injuries is to do so while maintaining strength of hand grip and no residual pain upon using the hand. Metacarpals. The metacarpals are long bones within the hand that are connected to the carpals, or wrist bones, and to the phalanges, or finger bones. The metacarpals together are referred to as the metacarpus .. The tops of the metacarpals form the knuckles where they join to the wrist', "Metacarpal neck fractures are the most common type of metacarpal fracture. Such a fracture seen in the 5th (or rarely, the 4 th) metacarpal neck is called a boxer’s fracture.. Figure: A boxer's fracture, i.e., a fracture of the neck of the 5th metacarpal. (http://radiopaedia.org/cases/boxers-fracture-1). Metacarpal head fractures are rare and usually require surgical intervention.", 'The metacar...
[1, 0, 0, 0, 0, ...]
how does a molle system work
["The system's modularity is derived from the use of PALS webbing as rows of heavy-duty nylon stitched onto the vest to allow for the attachment of various MOLLE-compatible pouches and accessories.", 'MOLLE SYSTEMS. MOLLE (pronounced MOLLY) is an acronym for MOdular Lightweight Load-carrying Equipment. Molle uses rows of heavy-duty nylon stitched onto the vest/pack to allow for attachment of various MOLLE-compatible pouches and accessories. These are called PALS (Pouch Attachment Ladder System).', 'This is the webbing you are seeing. The military standard for this webbing is horizontal rows of 1″ webbing, spaced 1″ apart, sewn to the item at 1.5″ intervals. Modular MOLLE Utility Pouch-Coyote Tan. The second term is again a military acronym-MOLLE; Modular Lightweight Load carrying Equipment.', 'The MOLLE system is a fully combined which is made up of a load bearing vest along with butt pack, main ruck that has sustainable pouches and also a partition to carry a sleeping bag. The load be...
[1, 0, 0, 0, 0, ...]
- Loss:
ListNetLoss
with these parameters:{ "activation_fn": "torch.nn.modules.linear.Identity", "mini_batch_size": 16 }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy
: stepsper_device_train_batch_size
: 16per_device_eval_batch_size
: 16learning_rate
: 2e-05num_train_epochs
: 1warmup_ratio
: 0.1seed
: 12bf16
: Trueload_best_model_at_end
: True
All Hyperparameters
Click to expand
overwrite_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
: 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
: 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
: 0dataloader_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}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
: 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
: {}
Training Logs
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.0329 (-0.5075) | 0.3072 (-0.0179) | 0.0411 (-0.4596) | 0.1270 (-0.3283) |
0.0002 | 1 | 2.1125 | - | - | - | - | - |
0.0508 | 250 | 2.0939 | - | - | - | - | - |
0.1016 | 500 | 2.0907 | 2.0901 | 0.0470 (-0.4934) | 0.2425 (-0.0825) | 0.0401 (-0.4605) | 0.1099 (-0.3455) |
0.1525 | 750 | 2.0878 | - | - | - | - | - |
0.2033 | 1000 | 2.0852 | 2.0895 | 0.0449 (-0.4955) | 0.2333 (-0.0917) | 0.0691 (-0.4315) | 0.1158 (-0.3396) |
0.2541 | 1250 | 2.0922 | - | - | - | - | - |
0.3049 | 1500 | 2.0852 | 2.0887 | 0.0477 (-0.4927) | 0.2630 (-0.0621) | 0.0605 (-0.4401) | 0.1237 (-0.3316) |
0.3558 | 1750 | 2.0927 | - | - | - | - | - |
0.4066 | 2000 | 2.0834 | 2.0883 | 0.0616 (-0.4788) | 0.2742 (-0.0508) | 0.0562 (-0.4445) | 0.1307 (-0.3247) |
0.4574 | 2250 | 2.0838 | - | - | - | - | - |
0.5082 | 2500 | 2.0844 | 2.0879 | 0.0557 (-0.4847) | 0.2558 (-0.0692) | 0.0811 (-0.4195) | 0.1309 (-0.3245) |
0.5591 | 2750 | 2.0852 | - | - | - | - | - |
0.6099 | 3000 | 2.087 | 2.0878 | 0.0612 (-0.4792) | 0.2518 (-0.0732) | 0.0866 (-0.4141) | 0.1332 (-0.3222) |
0.6607 | 3250 | 2.0878 | - | - | - | - | - |
0.7115 | 3500 | 2.0854 | 2.0878 | 0.0595 (-0.4809) | 0.2569 (-0.0681) | 0.0750 (-0.4257) | 0.1305 (-0.3249) |
0.7624 | 3750 | 2.0866 | - | - | - | - | - |
0.8132 | 4000 | 2.0868 | 2.0874 | 0.0553 (-0.4851) | 0.2519 (-0.0731) | 0.0729 (-0.4278) | 0.1267 (-0.3287) |
0.8640 | 4250 | 2.0915 | - | - | - | - | - |
0.9148 | 4500 | 2.0851 | 2.0873 | 0.0553 (-0.4851) | 0.2528 (-0.0722) | 0.0722 (-0.4285) | 0.1268 (-0.3286) |
0.9656 | 4750 | 2.084 | - | - | - | - | - |
-1 | -1 | - | - | 0.0612 (-0.4792) | 0.2518 (-0.0732) | 0.0866 (-0.4141) | 0.1332 (-0.3222) |
- The bold row denotes the saved checkpoint.
Framework Versions
- Python: 3.10.18
- Sentence Transformers: 5.0.0
- Transformers: 4.56.0.dev0
- PyTorch: 2.7.1+cu126
- Accelerate: 1.9.0
- Datasets: 4.0.0
- Tokenizers: 0.21.4
Citation
BibTeX
Sentence Transformers
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
ListNetLoss
@inproceedings{cao2007learning,
title={Learning to Rank: From Pairwise Approach to Listwise Approach},
author={Cao, Zhe and Qin, Tao and Liu, Tie-Yan and Tsai, Ming-Feng and Li, Hang},
booktitle={Proceedings of the 24th international conference on Machine learning},
pages={129--136},
year={2007}
}
- Downloads last month
- 6
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support
Model tree for rahulseetharaman/reranker-msmarco-v1.1-bert-uncased_L-10_H-512_A-8-listnet
Base model
bansalaman18/bert-uncased_L-10_H-512_A-8Dataset used to train rahulseetharaman/reranker-msmarco-v1.1-bert-uncased_L-10_H-512_A-8-listnet
Evaluation results
- Map on NanoMSMARCO R100self-reported0.077
- Mrr@10 on NanoMSMARCO R100self-reported0.050
- Ndcg@10 on NanoMSMARCO R100self-reported0.061
- Map on NanoNFCorpus R100self-reported0.270
- Mrr@10 on NanoNFCorpus R100self-reported0.369
- Ndcg@10 on NanoNFCorpus R100self-reported0.252
- Map on NanoNQ R100self-reported0.073
- Mrr@10 on NanoNQ R100self-reported0.056
- Ndcg@10 on NanoNQ R100self-reported0.087
- Map on NanoBEIR R100 meanself-reported0.140