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-plistmle-sum-to-1-weight-plus-1")
# Get scores for pairs of texts
pairs = [
['How many calories in an egg', 'There are on average between 55 and 80 calories in an egg depending on its size.'],
['How many calories in an egg', 'Egg whites are very low in calories, have no fat, no cholesterol, and are loaded with protein.'],
['How many calories in an egg', 'Most of the calories in an egg come from the yellow yolk in the center.'],
]
scores = model.predict(pairs)
print(scores.shape)
# (3,)
# Or rank different texts based on similarity to a single text
ranks = model.rank(
'How many calories in an egg',
[
'There are on average between 55 and 80 calories in an egg depending on its size.',
'Egg whites are very low in calories, have no fat, no cholesterol, and are loaded with protein.',
'Most of the calories in an egg come from the yellow yolk in the center.',
]
)
# [{'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.4782 (-0.0114) | 0.3347 (+0.0737) | 0.6353 (+0.2157) |
mrr@10 | 0.4685 (-0.0090) | 0.5293 (+0.0294) | 0.6425 (+0.2158) |
ndcg@10 | 0.5464 (+0.0060) | 0.3580 (+0.0330) | 0.6876 (+0.1870) |
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.4827 (+0.0927) |
mrr@10 | 0.5468 (+0.0788) |
ndcg@10 | 0.5307 (+0.0753) |
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.83 characters
- max: 100 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 cost for taking care of elderly parents at home
['Google+. Learn about dealing with and caring for your elderly parents as they age. When it comes to caring for elderly parents, there are a number of options out there. Your first decision is where your parent will live – in his or her own home, with you, or in an elder care facility. The cost of elder care can be daunting, and for some families out-of-home care is simply an impossibility. According to the 2011 MetLife Market Survey of Long-Term Care Costs, the cost of caring for aging parents is the following: 1 Nursing home (Semi-private room): $214/day or $78,110 per year', "The cost to care for a parent in your home can vary depending on their needs. You can expect to pay between $15 and $25 per hour for home care personnel and $300+ per day for round the clock care (live-in) Some people utilize housekeepers and/or family members to bring the cost down. Some caregivers have to decrease work hours or even quit their job in order to provide care for an aging parent, and when you a...
[1, 1, 0, 0, 0, ...]
what is a pharmacist
['pharmacist, n a person prepared to formulate and dispense drugs or medications through completion of an accredited university program in pharmacy. Licensure is required upon completion of the program and prior to serving the public as a pharma-cist.', 'Pharmacists, also known as chemists (Commonwealth English) or druggists (North American and, archaically, Commonwealth English), are healthcare professionals who practice in pharmacy, the field of health sciences focusing on safe and effective medication use.', 'The most common pharmacist positions are that of a community pharmacist (also referred to as a retail pharmacist, first-line pharmacist or dispensing chemist), or a hospital pharmacist, where they instruct and counsel on the proper use and adverse effects of medically prescribed drugs and medicines.', 'A pharmacist is a member of the health care team directly involved with patient care. Pharmacists undergo university-level education to understand the biochemical mechanisms and ...
[1, 0, 0, 0, 0, ...]
carissa name meaning
['Greek Meaning: The name Carissa is a Greek baby name. In Greek the meaning of the name Carissa is: Very dear. American Meaning: The name Carissa is an American baby name. In American the meaning of the name Carissa is: Very dear. Latin Meaning: The name Carissa is a Latin baby name. In Latin the meaning of the name Carissa is: Artistic or giving; Very dear.', 'The meaning of Carissa has more than one different etymologies. It has same or different meanings in other countries and languages. The different meanings of the name Carissa are: 1 French Meaning: Caress. Form of: Caressa. Keep in mind that many names may have different meanings in other countries and languages, so be careful that the name that you choose doesn’t mean something bad or unpleasant. Search comprehensively and find the name meaning of Carissa and its name origin or of any other name in our database. Also note the spelling and the pronunciation of the name Carissa and check the initials of the name with your last ...
[1, 0, 0, 0, 0, ...]
- Loss:
PListMLELoss
with these parameters:{ "lambda_weight": "sentence_transformers.cross_encoder.losses.PListMLELoss.PListMLELambdaWeight", "activation_fct": "torch.nn.modules.linear.Identity", "mini_batch_size": 16, "respect_input_order": true }
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: 11 characters
- mean: 33.1 characters
- max: 88 characters
- min: 2 elements
- mean: 6.00 elements
- max: 10 elements
- min: 2 elements
- mean: 6.00 elements
- max: 10 elements
- Samples:
query docs labels what county is nagold in
["detailed map of Nagold and near places. Welcome to the Nagold google satellite map! This place is situated in Calw, Karlsruhe, Baden-Wurttemberg, Germany, its geographical coordinates are 48° 33' 0 North, 8° 43' 0 East and its original name (with diacritics) is Nagold. See Nagold photos and images from satellite below, explore the aerial photographs of Nagold in Germany. 3D map of Nagold in Germany. You can also dive right into Nagold on unique 3D satellite map provided by Google Earth. With new GoogLe Earth plugin you can enjoy the interactive Nagold 3D map within your web browser.", 'The location of each Nagold hotel listed is shown on the detailed zoomable map. Moreover, Nagold hotel map is available where all hotels in Nagold are marked. You can easily choose your hotel by location. 3D map of Nagold in Germany. You can also dive right into Nagold on unique 3D satellite map provided by Google Earth. With new GoogLe Earth plugin you can enjoy the interactive Nagold 3D map within your web browser.', "Jonagold is high quality American apple, developed in the 1940s. As its name suggests, this is a cross between a Jonathan and a Golden Delicious. It is quite widely grown, and unusually for a Golden Delicious cross, is not limited to the warm apple regions, although it is not often found in the UK. The colouring is yellow of Golden Delicious, with large flushes of red. This is a crisp apple to bite into, with gleaming white flesh. The flavour is sweet but with a lot of balancing acidity-a very pleasant apple. Jonagold's other parent, Jonathan, is an old American variety which was discovered in the 1820s.", "Jonagold is widely-grown by commercial growers, and there are a number of more highly-coloured sports. Jonagored is probably the most widely known of these. Others include: Decosta, Primo, Rubinstar, Red Jonaprince. The colouring is yellow of Golden Delicious, with large flushes of red. This is a crisp apple to bite into, with gleaming white flesh. The flavour is sweet but with a lot of balancing acidity-a very pleasant apple. Jonagold's other parent, Jonathan, is an old American variety which was discovered in the 1820s.", "As a result it is a poor pollinator of other apple varieties, and needs two different nearby compatible pollinating apple varieties. Golden Delicious is well-known as a good pollinator of other apple varieties, but cannot pollinate Jonagold. The colouring is yellow of Golden Delicious, with large flushes of red. This is a crisp apple to bite into, with gleaming white flesh. The flavour is sweet but with a lot of balancing acidity-a very pleasant apple. Jonagold's other parent, Jonathan, is an old American variety which was discovered in the 1820s. In the UK Jonagold sometimes appears in supermarkets in the spring packaged as value apples, often from Holland, and at a very low price"]
[1, 0, 0, 0, 0]
what is the pay scale for ups drivers
["According to American job and career site Glassdoor, the average salary of a UPS truck driver is about $56,000 a year. What is the average salary for a ups driver? currently in southern California its 29.71/hr plus full medical, dental and vision. also paid are a legal plan, pension, major holiday's off paid, and up to 6 weeks paid vacat … ion and 4 floating holidays. also yearly guaranteed prenegotiated raises.", 'Average UPS Driver salaries for job postings nationwide are 57% lower than average salaries for all job postings nationwide. ', "I was told that the starting salary for a full time package delivery driver is $72,000/year and are in the midst of negotiations for a salary increase to $75,000/ year. Is this true? I appologize I am new but am curious as I would like to, some day, obtain a full time driver position. 70K is gross pay for a senior Package Driver in my area that averages working 9.5 hours a day. That is $28.19 an hour straight pay and about $42.38 an hour for over...
[1, 0, 0, 0, 0, ...]
what is coliform
['Coliform is a rod-shaped bacteria which are always present in the digestive tract of warm-blooded animals, including humans. Coliforms are found in human and animal waste, and are also found in water, plants and soil. Fecal coliforms are the coliform that is found in the digestive tract of animals and humans, and is an indicator of fecal contamination. A high count of fecal coliforms is considered an accurate indicator of animal or human waste. Escherichia coli (E. coli) is a major species of the fecal coliforms', 'Coliforms are a broad class of bacteria found in our environment, including the feces of man and other warm-blooded animals. The presence of coliform bacteria in drinking water may indicate a possible presence of harmful, disease-causing organisms. Why use coliforms to indicate water quality? ', 'Coliform bacteria include a large group of many types of bacteria that occur throughout the environment. They are common in soil and surface water and may even occur on your skin....
[1, 0, 0, 0, 0, ...]
- Loss:
PListMLELoss
with these parameters:{ "lambda_weight": "sentence_transformers.cross_encoder.losses.PListMLELoss.PListMLELambdaWeight", "activation_fct": "torch.nn.modules.linear.Identity", "mini_batch_size": 16, "respect_input_order": true }
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
: 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.0293 (-0.5112) | 0.2960 (-0.0290) | 0.0263 (-0.4743) | 0.1172 (-0.3382) |
0.0002 | 1 | 2.2004 | - | - | - | - | - |
0.0508 | 250 | 2.1006 | - | - | - | - | - |
0.1016 | 500 | 1.9618 | 1.9431 | 0.0989 (-0.4415) | 0.3091 (-0.0159) | 0.1591 (-0.3416) | 0.1890 (-0.2663) |
0.1525 | 750 | 1.9038 | - | - | - | - | - |
0.2033 | 1000 | 1.8656 | 1.8699 | 0.4825 (-0.0579) | 0.3387 (+0.0136) | 0.5589 (+0.0582) | 0.4600 (+0.0046) |
0.2541 | 1250 | 1.8568 | - | - | - | - | - |
0.3049 | 1500 | 1.8491 | 1.8546 | 0.5522 (+0.0118) | 0.3395 (+0.0144) | 0.6046 (+0.1040) | 0.4988 (+0.0434) |
0.3558 | 1750 | 1.8455 | - | - | - | - | - |
0.4066 | 2000 | 1.8337 | 1.8389 | 0.5163 (-0.0242) | 0.3749 (+0.0499) | 0.6346 (+0.1340) | 0.5086 (+0.0532) |
0.4574 | 2250 | 1.8433 | - | - | - | - | - |
0.5082 | 2500 | 1.8311 | 1.8265 | 0.5464 (+0.0060) | 0.3580 (+0.0330) | 0.6876 (+0.1870) | 0.5307 (+0.0753) |
0.5591 | 2750 | 1.8157 | - | - | - | - | - |
0.6099 | 3000 | 1.8111 | 1.8187 | 0.5313 (-0.0091) | 0.3582 (+0.0332) | 0.6415 (+0.1409) | 0.5103 (+0.0550) |
0.6607 | 3250 | 1.8183 | - | - | - | - | - |
0.7115 | 3500 | 1.8155 | 1.8160 | 0.5417 (+0.0013) | 0.3751 (+0.0501) | 0.6412 (+0.1405) | 0.5193 (+0.0640) |
0.7624 | 3750 | 1.8101 | - | - | - | - | - |
0.8132 | 4000 | 1.8124 | 1.8105 | 0.5468 (+0.0063) | 0.3616 (+0.0366) | 0.6357 (+0.1351) | 0.5147 (+0.0593) |
0.8640 | 4250 | 1.8158 | - | - | - | - | - |
0.9148 | 4500 | 1.8082 | 1.8129 | 0.5380 (-0.0024) | 0.3564 (+0.0313) | 0.6629 (+0.1623) | 0.5191 (+0.0637) |
0.9656 | 4750 | 1.8042 | - | - | - | - | - |
-1 | -1 | - | - | 0.5464 (+0.0060) | 0.3580 (+0.0330) | 0.6876 (+0.1870) | 0.5307 (+0.0753) |
- The bold row denotes the saved checkpoint.
Environmental Impact
Carbon emissions were measured using CodeCarbon.
- Energy Consumed: 0.237 kWh
- Carbon Emitted: 0.092 kg of CO2
- Hours Used: 0.766 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.5.1
- 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",
}
PListMLELoss
@inproceedings{lan2014position,
title={Position-Aware ListMLE: A Sequential Learning Process for Ranking.},
author={Lan, Yanyan and Zhu, Yadong and Guo, Jiafeng and Niu, Shuzi and Cheng, Xueqi},
booktitle={UAI},
volume={14},
pages={449--458},
year={2014}
}
- Downloads last month
- 6
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support
HF Inference deployability: The HF Inference API does not support text-ranking models for sentence-transformers
library.
Model tree for tomaarsen/reranker-msmarco-v1.1-MiniLM-L12-H384-uncased-plistmle-sum-to-1-weight-plus-1
Base model
microsoft/MiniLM-L12-H384-uncasedDataset used to train tomaarsen/reranker-msmarco-v1.1-MiniLM-L12-H384-uncased-plistmle-sum-to-1-weight-plus-1
Evaluation results
- Map on NanoMSMARCO R100self-reported0.478
- Mrr@10 on NanoMSMARCO R100self-reported0.469
- Ndcg@10 on NanoMSMARCO R100self-reported0.546
- Map on NanoNFCorpus R100self-reported0.335
- Mrr@10 on NanoNFCorpus R100self-reported0.529
- Ndcg@10 on NanoNFCorpus R100self-reported0.358
- Map on NanoNQ R100self-reported0.635
- Mrr@10 on NanoNQ R100self-reported0.642
- Ndcg@10 on NanoNQ R100self-reported0.688
- Map on NanoBEIR R100 meanself-reported0.483