YAML Metadata
Warning:
The pipeline tag "text-ranking" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, text2text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, other
CrossEncoder based on microsoft/MiniLM-L12-H384-uncased
This is a Cross Encoder model finetuned from microsoft/MiniLM-L12-H384-uncased 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: microsoft/MiniLM-L12-H384-uncased
- 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("tomaarsen/reranker-msmarco-v1.1-MiniLM-L12-H384-uncased-bce")
# Get scores for pairs of texts
pairs = [
['is the calla lily poisonous', 'wholeblossoms.com. Even just a bite or two of the elegant calla lily can cause liver failure in pets and the mouths and tongues of humans to swell. The protein asparagine, found particularly concentrated in the roots of this plant, is poisonous, so be extra prudent with this popular cut flower. Bob Vila. Calla Lily. Even just a bite or two of the elegant calla lily can cause liver failure in pets and the mouths and tongues of humans to swell.'],
['how long do you have to go to school to be a nurse practitioner', "A: To become a nurse practitioner at the quickest, you can take up the certificate of nursing which is a one year program and the shortest to get nursing education. Certificate in nursing allows students to be able to practice and have introductory level knowledge and skills in the field of nursing. A: In order to become a nurse, you must complete a 2 year associate's or 4 years bachelor's degree program in nursing. Upon graduation, you should obtain an RN certification and pursue a specialization through an accredited MSN degree program."],
['what is true about atp molecule', 'Energy is usually liberated from the ATP molecule to do work in the cell by a reaction that removes one of the phosphate-oxygen groups, leaving adenosine diphosphate (ADP). When the ATP converts to ADP, the ATP is said to be spent. '],
['matter ejected from lungs is called', 'sputum. mucous secretion from the lungs, bronchi, and trachea that is ejected through the mouth, in contrast to saliva, which is the secretion of the salivary glands. Called also expectoration. sputum. mucous secretion from the lungs, bronchi and trachea which is ejected through the mouth by humans but not so in animals and it is assumed that it is swallowed. sputum cup. a small—1 inch diameter—cup on a long handle for the collection of sputum from the pharynx of a large animal. sputum specime'],
['average iron distances for senior golfers', 'Woods. Although is difficult to take all of these factors into consideration and determine an average distance for each club, there are charts that try. For the driver, a typical woman amateur can expect to get up to 180 yards. The 3-wood can provide 160 yards and the 5-wood 140. While there are charts that list the average distance for each golf club for women, the numbers are only averages and don’t reflect how far individuals actually hit the ball. There are many factors that influence distance, including your physical characteristics and conditions on the course.'],
]
scores = model.predict(pairs)
print(scores.shape)
# (5,)
# Or rank different texts based on similarity to a single text
ranks = model.rank(
'is the calla lily poisonous',
[
'wholeblossoms.com. Even just a bite or two of the elegant calla lily can cause liver failure in pets and the mouths and tongues of humans to swell. The protein asparagine, found particularly concentrated in the roots of this plant, is poisonous, so be extra prudent with this popular cut flower. Bob Vila. Calla Lily. Even just a bite or two of the elegant calla lily can cause liver failure in pets and the mouths and tongues of humans to swell.',
"A: To become a nurse practitioner at the quickest, you can take up the certificate of nursing which is a one year program and the shortest to get nursing education. Certificate in nursing allows students to be able to practice and have introductory level knowledge and skills in the field of nursing. A: In order to become a nurse, you must complete a 2 year associate's or 4 years bachelor's degree program in nursing. Upon graduation, you should obtain an RN certification and pursue a specialization through an accredited MSN degree program.",
'Energy is usually liberated from the ATP molecule to do work in the cell by a reaction that removes one of the phosphate-oxygen groups, leaving adenosine diphosphate (ADP). When the ATP converts to ADP, the ATP is said to be spent. ',
'sputum. mucous secretion from the lungs, bronchi, and trachea that is ejected through the mouth, in contrast to saliva, which is the secretion of the salivary glands. Called also expectoration. sputum. mucous secretion from the lungs, bronchi and trachea which is ejected through the mouth by humans but not so in animals and it is assumed that it is swallowed. sputum cup. a small—1 inch diameter—cup on a long handle for the collection of sputum from the pharynx of a large animal. sputum specime',
'Woods. Although is difficult to take all of these factors into consideration and determine an average distance for each club, there are charts that try. For the driver, a typical woman amateur can expect to get up to 180 yards. The 3-wood can provide 160 yards and the 5-wood 140. While there are charts that list the average distance for each golf club for women, the numbers are only averages and don’t reflect how far individuals actually hit the ball. There are many factors that influence distance, including your physical characteristics and conditions on the course.',
]
)
# [{'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.4241 (-0.0655) | 0.2867 (+0.0257) | 0.5166 (+0.0970) |
mrr@10 | 0.4173 (-0.0602) | 0.4599 (-0.0399) | 0.5251 (+0.0984) |
ndcg@10 | 0.5014 (-0.0390) | 0.2880 (-0.0370) | 0.5684 (+0.0678) |
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.4091 (+0.0191) |
mrr@10 | 0.4674 (-0.0006) |
ndcg@10 | 0.4526 (-0.0027) |
Training Details
Training Dataset
ms_marco
- Dataset: ms_marco at a47ee7a
- Size: 666,193 training samples
- Columns:
query
,passage
, andlabel
- Approximate statistics based on the first 1000 samples:
query passage label type string string int details - min: 11 characters
- mean: 34.43 characters
- max: 90 characters
- min: 62 characters
- mean: 423.32 characters
- max: 866 characters
- 0: ~85.50%
- 1: ~14.50%
- Samples:
query passage label is a meal allowance taxable
1 An exemption applies of up to three months for meal payments if the employee is required to work away from their normal work location because they're travelling on business. 2 This may be for a specific short-term, work-related journey or for a longer period such as a secondment to a distant work location. The rules also don't apply in the case where fringe benefit tax (FBT) is payable on meals directly provided by the employer such as a discount in the work canteen. The rules that limit employers' deductions of entertainment expenses also continue to apply.
0
average temperature may alaska
Precipitation [edit]. Juneau averages over 50 inches (1,270 mm) of precipitation a year, while some other areas in southeast Alaska receive as much as 275 inches (6,980 mm). Average monthly precipitation generally peaks in September or October, and is lowest in May and June.
0
asic registered fixed and floating charge
Fixed and Floating Charge. Definition: A fixed and floating charge is a form of security interest usually taken by a lender from a company to secure repayment of a loan. The company granting the charge is usually referred to as the Chargor and the person in whose favour the charge is granted is typically called the Chargee . This form of security is called fixed and floating because the chargee has: The true ingenuity of the fixed and floating charge is that it permits the chargor to deal with and sell their stock etc in the ordinary course of business without requiring consent from the chargor.
0
- Loss:
BinaryCrossEntropyLoss
with these parameters:{ "activation_fct": "torch.nn.modules.linear.Identity", "pos_weight": null }
Evaluation Dataset
ms_marco
- Dataset: ms_marco at a47ee7a
- Size: 10,000 evaluation samples
- Columns:
query
,passage
, andlabel
- Approximate statistics based on the first 1000 samples:
query passage label type string string int details - min: 11 characters
- mean: 34.23 characters
- max: 137 characters
- min: 88 characters
- mean: 427.89 characters
- max: 867 characters
- 0: ~86.70%
- 1: ~13.30%
- Samples:
query passage label is the calla lily poisonous
wholeblossoms.com. Even just a bite or two of the elegant calla lily can cause liver failure in pets and the mouths and tongues of humans to swell. The protein asparagine, found particularly concentrated in the roots of this plant, is poisonous, so be extra prudent with this popular cut flower. Bob Vila. Calla Lily. Even just a bite or two of the elegant calla lily can cause liver failure in pets and the mouths and tongues of humans to swell.
1
how long do you have to go to school to be a nurse practitioner
A: To become a nurse practitioner at the quickest, you can take up the certificate of nursing which is a one year program and the shortest to get nursing education. Certificate in nursing allows students to be able to practice and have introductory level knowledge and skills in the field of nursing. A: In order to become a nurse, you must complete a 2 year associate's or 4 years bachelor's degree program in nursing. Upon graduation, you should obtain an RN certification and pursue a specialization through an accredited MSN degree program.
0
what is true about atp molecule
Energy is usually liberated from the ATP molecule to do work in the cell by a reaction that removes one of the phosphate-oxygen groups, leaving adenosine diphosphate (ADP). When the ATP converts to ADP, the ATP is said to be spent.
0
- Loss:
BinaryCrossEntropyLoss
with these parameters:{ "activation_fct": "torch.nn.modules.linear.Identity", "pos_weight": null }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy
: stepsper_device_train_batch_size
: 32per_device_eval_batch_size
: 32learning_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
: 32per_device_eval_batch_size
: 32per_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
: 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
: batch_samplermulti_dataset_batch_sampler
: proportional
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.0357 (-0.5047) | 0.2806 (-0.0444) | 0.0527 (-0.4479) | 0.1230 (-0.3323) |
0.0000 | 1 | 0.6838 | - | - | - | - | - |
0.0480 | 1000 | 0.4514 | - | - | - | - | - |
0.0961 | 2000 | 0.385 | - | - | - | - | - |
0.1441 | 3000 | 0.3892 | - | - | - | - | - |
0.1921 | 4000 | 0.3819 | 0.3777 | 0.2751 (-0.2653) | 0.2555 (-0.0696) | 0.2689 (-0.2318) | 0.2665 (-0.1889) |
0.2402 | 5000 | 0.3694 | - | - | - | - | - |
0.2882 | 6000 | 0.3641 | - | - | - | - | - |
0.3362 | 7000 | 0.3679 | - | - | - | - | - |
0.3843 | 8000 | 0.3674 | 0.3566 | 0.4745 (-0.0660) | 0.2459 (-0.0792) | 0.4967 (-0.0040) | 0.4057 (-0.0497) |
0.4323 | 9000 | 0.3677 | - | - | - | - | - |
0.4803 | 10000 | 0.3606 | - | - | - | - | - |
0.5284 | 11000 | 0.3651 | - | - | - | - | - |
0.5764 | 12000 | 0.3586 | 0.3556 | 0.4666 (-0.0738) | 0.2720 (-0.0531) | 0.5513 (+0.0506) | 0.4300 (-0.0254) |
0.6244 | 13000 | 0.3535 | - | - | - | - | - |
0.6725 | 14000 | 0.3551 | - | - | - | - | - |
0.7205 | 15000 | 0.3552 | - | - | - | - | - |
0.7685 | 16000 | 0.3516 | 0.3439 | 0.5014 (-0.0390) | 0.2880 (-0.0370) | 0.5684 (+0.0678) | 0.4526 (-0.0027) |
0.8166 | 17000 | 0.3486 | - | - | - | - | - |
0.8646 | 18000 | 0.3528 | - | - | - | - | - |
0.9126 | 19000 | 0.3526 | - | - | - | - | - |
0.9607 | 20000 | 0.3415 | 0.3423 | 0.4898 (-0.0507) | 0.2794 (-0.0457) | 0.5792 (+0.0785) | 0.4494 (-0.0059) |
-1 | -1 | - | - | 0.5014 (-0.0390) | 0.2880 (-0.0370) | 0.5684 (+0.0678) | 0.4526 (-0.0027) |
- The bold row denotes the saved checkpoint.
Environmental Impact
Carbon emissions were measured using CodeCarbon.
- Energy Consumed: 0.178 kWh
- Carbon Emitted: 0.069 kg of CO2
- Hours Used: 0.525 hours
Training Hardware
- On Cloud: No
- GPU Model: 1 x NVIDIA GeForce RTX 3090
- CPU Model: 13th Gen Intel(R) Core(TM) i7-13700K
- RAM Size: 31.78 GB
Framework Versions
- Python: 3.11.6
- Sentence Transformers: 3.5.0.dev0
- Transformers: 4.49.0
- PyTorch: 2.6.0+cu124
- Accelerate: 1.4.0
- Datasets: 3.3.2
- Tokenizers: 0.21.0
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
- 7
Inference Providers
NEW
This model is not currently available via any of the supported Inference Providers.
The model cannot be deployed to the HF Inference API:
The model has no pipeline_tag.
Model tree for tomaarsen/reranker-msmarco-v1.1-MiniLM-L12-H384-uncased-bce
Base model
microsoft/MiniLM-L12-H384-uncasedDataset used to train tomaarsen/reranker-msmarco-v1.1-MiniLM-L12-H384-uncased-bce
Evaluation results
- Map on NanoMSMARCO R100self-reported0.424
- Mrr@10 on NanoMSMARCO R100self-reported0.417
- Ndcg@10 on NanoMSMARCO R100self-reported0.501
- Map on NanoNFCorpus R100self-reported0.287
- Mrr@10 on NanoNFCorpus R100self-reported0.460
- Ndcg@10 on NanoNFCorpus R100self-reported0.288
- Map on NanoNQ R100self-reported0.517
- Mrr@10 on NanoNQ R100self-reported0.525
- Ndcg@10 on NanoNQ R100self-reported0.568
- Map on NanoBEIR R100 meanself-reported0.409