CrossEncoder based on bansalaman18/bert-uncased_L-10_H-256_A-4
This is a Cross Encoder model finetuned from bansalaman18/bert-uncased_L-10_H-256_A-4 on the msmarco 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-256_A-4
- 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-bert-uncased_L-10_H-256_A-4-msmarco-bce")
# Get scores for pairs of texts
pairs = [
['are solar pool covers worth it', 'If you are using Onga pool pumps or Hurlcon pool pumps, then you need not worry about them getting overheated for they are one of the best pool pumps available on the market. If you want to know about What causes a pool pump to overheat so please visit here onga pool pumps.'],
['how much do Customer Service Agent: Ticketing/Gate make in general', '$41,000. Average Airport Customer Service Ticketing Gate Agent salaries for job postings in Houston, TX are 13% higher than average Airport Customer Service Ticketing Gate Agent salaries for job postings nationwide.verage Airport Customer Service Ticketing Gate Agent salaries for job postings in Houston, TX are 13% higher than average Airport Customer Service Ticketing Gate Agent salaries for job postings nationwide.'],
['what is adverse selection economics', 'The last first woman to win the Nobel in her category was Elinor Ostrom, who shared the 2009 economics prize for her groundbreaking analysis of common property. The wait was so long for a woman economics laureate in part because that prize wasnâ\x80\x99t established until 1969.'],
['where do newts live', 'Newts can be found living in North America, Europe and Asia. They are not found in Australia or Africa. In fact there are no species of salamander that live in Australia and only a few found in Northern Africa. Seven species of newt live in Europe.'],
['define: rolling hourly average', 'An example of two moving average curves. In statistics, a moving average (rolling average or running average) is a calculation to analyze data points by creating series of averages of different subsets of the full data set. It is also called a moving mean (MM) or rolling mean and is a type of finite impulse response filter.'],
]
scores = model.predict(pairs)
print(scores.shape)
# (5,)
# Or rank different texts based on similarity to a single text
ranks = model.rank(
'are solar pool covers worth it',
[
'If you are using Onga pool pumps or Hurlcon pool pumps, then you need not worry about them getting overheated for they are one of the best pool pumps available on the market. If you want to know about What causes a pool pump to overheat so please visit here onga pool pumps.',
'$41,000. Average Airport Customer Service Ticketing Gate Agent salaries for job postings in Houston, TX are 13% higher than average Airport Customer Service Ticketing Gate Agent salaries for job postings nationwide.verage Airport Customer Service Ticketing Gate Agent salaries for job postings in Houston, TX are 13% higher than average Airport Customer Service Ticketing Gate Agent salaries for job postings nationwide.',
'The last first woman to win the Nobel in her category was Elinor Ostrom, who shared the 2009 economics prize for her groundbreaking analysis of common property. The wait was so long for a woman economics laureate in part because that prize wasnâ\x80\x99t established until 1969.',
'Newts can be found living in North America, Europe and Asia. They are not found in Australia or Africa. In fact there are no species of salamander that live in Australia and only a few found in Northern Africa. Seven species of newt live in Europe.',
'An example of two moving average curves. In statistics, a moving average (rolling average or running average) is a calculation to analyze data points by creating series of averages of different subsets of the full data set. It is also called a moving mean (MM) or rolling mean and is a type of finite impulse response filter.',
]
)
# [{'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.0872 (-0.4024) | 0.2815 (+0.0205) | 0.0564 (-0.3632) |
mrr@10 | 0.0649 (-0.4126) | 0.4108 (-0.0890) | 0.0317 (-0.3949) |
ndcg@10 | 0.0903 (-0.4501) | 0.2897 (-0.0353) | 0.0532 (-0.4474) |
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.1417 (-0.2484) |
mrr@10 | 0.1692 (-0.2989) |
ndcg@10 | 0.1444 (-0.3110) |
Training Details
Training Dataset
msmarco
- Dataset: msmarco at 9e329ed
- Size: 90,000 training samples
- Columns:
query
,passage
, andscore
- Approximate statistics based on the first 1000 samples:
query passage score type string string float details - min: 7 characters
- mean: 33.59 characters
- max: 164 characters
- min: 49 characters
- mean: 340.88 characters
- max: 1018 characters
- min: 0.0
- mean: 0.53
- max: 1.0
- Samples:
query passage score fantomcoin current price
The current Average monthly rental price per square meter for a studio property in Pretoria / Tshwane on Gumtree is R 47.
0.0
ddp price definition
Delivered Duty Paid - DDP. Loading the player... What does 'Delivered Duty Paid - DDP' mean. Delivered duty paid (DDP) is a transaction where the seller pays for the total costs associated with transporting goods and is fully responsible for the goods until they are received and transferred to the buyer.
1.0
what is neil diamond's hometown
Oct 6, 2014 8:00 am ET. Brooklyn native Neil Diamond played his first-ever hometown show last week with a 10-song set at Erasmus Hall High School, where he sang in the choir during the two years he was a student there. Speakeasy today premieres a clip of Diamond performing the new song âSomething Blueâ at that concert.
1.0
- Loss:
BinaryCrossEntropyLoss
with these parameters:{ "activation_fn": "torch.nn.modules.linear.Identity", "pos_weight": null }
Evaluation Dataset
msmarco
- Dataset: msmarco at 9e329ed
- Size: 10,000 evaluation samples
- Columns:
query
,passage
, andscore
- Approximate statistics based on the first 1000 samples:
query passage score type string string float details - min: 9 characters
- mean: 34.17 characters
- max: 146 characters
- min: 83 characters
- mean: 349.58 characters
- max: 974 characters
- min: 0.0
- mean: 0.51
- max: 1.0
- Samples:
query passage score are solar pool covers worth it
If you are using Onga pool pumps or Hurlcon pool pumps, then you need not worry about them getting overheated for they are one of the best pool pumps available on the market. If you want to know about What causes a pool pump to overheat so please visit here onga pool pumps.
0.0
how much do Customer Service Agent: Ticketing/Gate make in general
$41,000. Average Airport Customer Service Ticketing Gate Agent salaries for job postings in Houston, TX are 13% higher than average Airport Customer Service Ticketing Gate Agent salaries for job postings nationwide.verage Airport Customer Service Ticketing Gate Agent salaries for job postings in Houston, TX are 13% higher than average Airport Customer Service Ticketing Gate Agent salaries for job postings nationwide.
1.0
what is adverse selection economics
The last first woman to win the Nobel in her category was Elinor Ostrom, who shared the 2009 economics prize for her groundbreaking analysis of common property. The wait was so long for a woman economics laureate in part because that prize wasnât established until 1969.
0.0
- Loss:
BinaryCrossEntropyLoss
with these parameters:{ "activation_fn": "torch.nn.modules.linear.Identity", "pos_weight": null }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy
: stepsper_device_train_batch_size
: 16per_device_eval_batch_size
: 16learning_rate
: 2e-05num_train_epochs
: 4warmup_ratio
: 0.1seed
: 12bf16
: Truedataloader_num_workers
: 4load_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
: 4max_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}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.0797 (-0.4607) | 0.2817 (-0.0434) | 0.0302 (-0.4704) | 0.1305 (-0.3248) |
0.0002 | 1 | 0.6362 | - | - | - | - | - |
0.1778 | 1000 | 0.6946 | 0.7033 | 0.0227 (-0.5178) | 0.2131 (-0.1119) | 0.0285 (-0.4722) | 0.0881 (-0.3673) |
0.3556 | 2000 | 0.6943 | 0.6900 | 0.0155 (-0.5250) | 0.2458 (-0.0792) | 0.0718 (-0.4289) | 0.1110 (-0.3443) |
0.5333 | 3000 | 0.6924 | 0.6786 | 0.0399 (-0.5005) | 0.2142 (-0.1109) | 0.0626 (-0.4380) | 0.1056 (-0.3498) |
0.7111 | 4000 | 0.6821 | 0.6755 | 0.0379 (-0.5025) | 0.2399 (-0.0851) | 0.0682 (-0.4325) | 0.1153 (-0.3400) |
0.8889 | 5000 | 0.6749 | 0.6678 | 0.0466 (-0.4938) | 0.2542 (-0.0709) | 0.0947 (-0.4060) | 0.1318 (-0.3235) |
1.0667 | 6000 | 0.6699 | 0.6661 | 0.0536 (-0.4868) | 0.2670 (-0.0581) | 0.0498 (-0.4508) | 0.1235 (-0.3319) |
1.2444 | 7000 | 0.6576 | 0.6651 | 0.0389 (-0.5016) | 0.2491 (-0.0760) | 0.0450 (-0.4557) | 0.1110 (-0.3444) |
1.4222 | 8000 | 0.6579 | 0.6891 | 0.0375 (-0.5029) | 0.2852 (-0.0398) | 0.0370 (-0.4637) | 0.1199 (-0.3355) |
1.6 | 9000 | 0.6459 | 0.6646 | 0.0553 (-0.4851) | 0.2706 (-0.0544) | 0.0461 (-0.4545) | 0.1240 (-0.3314) |
1.7778 | 10000 | 0.6576 | 0.6592 | 0.0493 (-0.4911) | 0.2633 (-0.0618) | 0.0352 (-0.4654) | 0.1159 (-0.3394) |
1.9556 | 11000 | 0.6499 | 0.6589 | 0.0631 (-0.4773) | 0.2778 (-0.0472) | 0.0581 (-0.4426) | 0.1330 (-0.3224) |
2.1333 | 12000 | 0.6289 | 0.6755 | 0.0744 (-0.4660) | 0.2747 (-0.0503) | 0.0386 (-0.4620) | 0.1292 (-0.3261) |
2.3111 | 13000 | 0.6233 | 0.6888 | 0.0617 (-0.4787) | 0.2963 (-0.0287) | 0.0494 (-0.4513) | 0.1358 (-0.3196) |
2.4889 | 14000 | 0.6257 | 0.6854 | 0.0788 (-0.4616) | 0.2920 (-0.0331) | 0.0532 (-0.4475) | 0.1413 (-0.3141) |
2.6667 | 15000 | 0.619 | 0.6705 | 0.0741 (-0.4663) | 0.2863 (-0.0388) | 0.0645 (-0.4361) | 0.1416 (-0.3137) |
2.8444 | 16000 | 0.6218 | 0.6868 | 0.0750 (-0.4654) | 0.2874 (-0.0377) | 0.0583 (-0.4424) | 0.1402 (-0.3151) |
3.0222 | 17000 | 0.6191 | 0.6846 | 0.0768 (-0.4637) | 0.2879 (-0.0372) | 0.0393 (-0.4613) | 0.1346 (-0.3207) |
3.2 | 18000 | 0.5977 | 0.6846 | 0.0883 (-0.4521) | 0.2874 (-0.0376) | 0.0457 (-0.4549) | 0.1405 (-0.3149) |
3.3778 | 19000 | 0.5947 | 0.6938 | 0.0877 (-0.4528) | 0.2798 (-0.0452) | 0.0615 (-0.4391) | 0.1430 (-0.3124) |
3.5556 | 20000 | 0.5944 | 0.6860 | 0.0815 (-0.4589) | 0.2856 (-0.0395) | 0.0561 (-0.4446) | 0.1411 (-0.3143) |
3.7333 | 21000 | 0.5939 | 0.6887 | 0.0903 (-0.4501) | 0.2897 (-0.0353) | 0.0532 (-0.4474) | 0.1444 (-0.3110) |
3.9111 | 22000 | 0.5947 | 0.6908 | 0.0876 (-0.4528) | 0.2897 (-0.0353) | 0.0545 (-0.4461) | 0.1440 (-0.3114) |
-1 | -1 | - | - | 0.0903 (-0.4501) | 0.2897 (-0.0353) | 0.0532 (-0.4474) | 0.1444 (-0.3110) |
- 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",
}
- Downloads last month
- 8
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support
Model tree for rahulseetharaman/reranker-bert-uncased_L-10_H-256_A-4-msmarco-bce
Base model
bansalaman18/bert-uncased_L-10_H-256_A-4Dataset used to train rahulseetharaman/reranker-bert-uncased_L-10_H-256_A-4-msmarco-bce
Evaluation results
- Map on NanoMSMARCO R100self-reported0.087
- Mrr@10 on NanoMSMARCO R100self-reported0.065
- Ndcg@10 on NanoMSMARCO R100self-reported0.090
- Map on NanoNFCorpus R100self-reported0.281
- Mrr@10 on NanoNFCorpus R100self-reported0.411
- Ndcg@10 on NanoNFCorpus R100self-reported0.290
- Map on NanoNQ R100self-reported0.056
- Mrr@10 on NanoNQ R100self-reported0.032
- Ndcg@10 on NanoNQ R100self-reported0.053
- Map on NanoBEIR R100 meanself-reported0.142