Downloads · 30 days
15
29% of all-time downloads
kwondw/reranker-MiniLM-L12-H384-uncased-msmarco-margin-mse
reranker-MiniLM-L12-H384-uncased-msmarco-margin-mse is a text ranking model from kwondw. Use it for the text ranking task on the model card, and read the license before you ship it in a product. It is set up for sentence-transformers.
This is a Cross Encoder model finetuned from microsoft/MiniLM-L12-H384-uncased on the msmarco dataset using the sentence-transformers library. It computes scores for pairs of texts, which can be used for text rerankin…
Downloads · 30 days
15
29% of all-time downloads
All-time downloads
52
Public
Parameters
33.4M
133 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors133 MB · 99%
From the Hugging Face model README
This is a Cross Encoder model finetuned from microsoft/MiniLM-L12-H384-uncased 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.
CrossEncoder(
(0): Transformer({'transformer_task': 'sequence-classification', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'logits'}}, 'module_output_name': 'scores', 'architecture': 'BertForSequenceClassification'})
)
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("kwondw/reranker-MiniLM-L12-H384-uncased-msmarco-margin-mse")
# Get scores for pairs of inputs
pairs = [
['cost for laminate flooring per square foot', 'Average Price Range. Cheap laminate flooring starts at less than $1 per square foot and can cost as much as $5 per square foot. The average laminate flooring costs from $2.40-$4 per square foot.The price is determined, as it is with most products, by the quality of the material.A major part of that quality is the thickness of the wear layer.: There will be some variation in prices regionally and the final amount will depend on the size and complexity of the project, that said the average cost to install laminate flooring is $1.40 to $2.20 per square foot.'],
['what county is south daytona, fl in?', 'South Daytona, Florida. South Daytona is a city in Volusia County, Florida, United States. The population was 12,252 at the 2010 census.'],
['when was donkey kong released', 'Donkey Kong (ã\x83\x89ã\x83³ã\x82\xadã\x83¼ã\x82³ã\x83³ã\x82°, DonkÄ« Kongu, [dõÅ\x8b.kiË\x90 kõÅ\x8b.É¡uÍ\x8d]) is a series of video games featuring the adventures of a gorilla character called Donkey Kong, conceived by Shigeru Miyamoto in 1981. The franchise mainly comprises two different game genres, plus spin-off titles of various genres.'],
['causes of compartment syndrome of tibia', 'Both acute exertional compartment syndrome and anterior tibial stress fractures are rare causes of leg pain in young athletes. As demonstrated by this case, their combined presentation can pose a diagnostic dilemma.'],
['how many years of college to be a dental hygienist', "Education and Qualifications. To become a dental hygienist, you'll need either a 2- or 4-year degree in dental hygiene. Most programs are two years long and lead to an associate's degree. They are offered through community colleges and technical colleges."],
]
scores = model.predict(pairs)
print(scores)
# [1. 1. 0.9998 0.991 1. ]
# Or rank different texts based on similarity to a single text
ranks = model.rank(
'cost for laminate flooring per square foot',
[
'Average Price Range. Cheap laminate flooring starts at less than $1 per square foot and can cost as much as $5 per square foot. The average laminate flooring costs from $2.40-$4 per square foot.The price is determined, as it is with most products, by the quality of the material.A major part of that quality is the thickness of the wear layer.: There will be some variation in prices regionally and the final amount will depend on the size and complexity of the project, that said the average cost to install laminate flooring is $1.40 to $2.20 per square foot.',
'South Daytona, Florida. South Daytona is a city in Volusia County, Florida, United States. The population was 12,252 at the 2010 census.',
'Donkey Kong (ã\x83\x89ã\x83³ã\x82\xadã\x83¼ã\x82³ã\x83³ã\x82°, DonkÄ« Kongu, [dõÅ\x8b.kiË\x90 kõÅ\x8b.É¡uÍ\x8d]) is a series of video games featuring the adventures of a gorilla character called Donkey Kong, conceived by Shigeru Miyamoto in 1981. The franchise mainly comprises two different game genres, plus spin-off titles of various genres.',
'Both acute exertional compartment syndrome and anterior tibial stress fractures are rare causes of leg pain in young athletes. As demonstrated by this case, their combined presentation can pose a diagnostic dilemma.',
"Education and Qualifications. To become a dental hygienist, you'll need either a 2- or 4-year degree in dental hygiene. Most programs are two years long and lead to an associate's degree. They are offered through community colleges and technical colleges.",
]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
<!--
### Direct Usage (Transformers)
<details><summary>Click to see the direct usage in Transformers</summary>
</details>
-->
<!--
### Downstream Usage (Sentence Transformers)
You can finetune this model on your own dataset.
<details><summary>Click to expand</summary>
</details>
-->
<!--
### Out-of-Scope Use
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
-->
NanoMSMARCO_R100, NanoNFCorpus_R100 and NanoNQ_R100{
"at_k": 10,
"always_rerank_positives": true
}
| Metric | NanoMSMARCO_R100 | NanoNFCorpus_R100 | NanoNQ_R100 |
|---|---|---|---|
| map | 0.6055 (+0.1160) | 0.3550 (+0.0940) | 0.6762 (+0.2566) |
| mrr@10 | 0.5978 (+0.1203) | 0.6030 (+0.1032) | 0.6895 (+0.2628) |
| ndcg@10 | 0.6684 (+0.1279) | 0.4159 (+0.0909) | 0.7250 (+0.2243) |
NanoBEIR_R100_mean{
"dataset_names": [
"msmarco",
"nfcorpus",
"nq"
],
"dataset_id": "sentence-transformers/NanoBEIR-en",
"rerank_k": 100,
"at_k": 10,
"always_rerank_positives": true
}
| Metric | Value |
|---|---|
| map | 0.5456 (+0.1555) |
| mrr@10 | 0.6301 (+0.1621) |
| ndcg@10 | 0.6031 (+0.1477) |
| score | query | positive | negative | |
|---|---|---|---|---|
| type | float | string | string | string |
| modality | text | text | text | |
| details | <ul><li>min: 1.61</li><li>mean: 13.55</li><li>max: 21.63</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 8.98 tokens</li><li>max: 13 tokens</li></ul> | <ul><li>min: 24 tokens</li><li>mean: 81.15 tokens</li><li>max: 237 tokens</li></ul> | <ul><li>min: 23 tokens</li><li>mean: 78.24 tokens</li><li>max: 171 tokens</li></ul> |
| score | query | positive | negative |
|---|---|---|---|
| <code>6.981858521699905</code> | <code>symptoms of shingles on back</code> | <code>The earliest symptoms of shingles, which include headache, fever, and malaise, are nonspecific, and may result in an incorrect diagnosis. These symptoms are commonly followed by sensations of burning pain, itching, hyperesthesia (oversensitivity), or paresthesia (pins and needles: tingling, pricking, or numbness).</code> | <code>Shingles is caused by the varicella-zoster virus, the virus that also causes chickenpox. In a person who has been exposed to chickenpox -- or its vaccine -- the virus never really goes away.It can lie dormant in the body's nerves.f you have shingles symptoms, get treatment now and you may avoid permanent nerve pain. Shingles, a viral infection of the nerve roots, affects 1 million people in the U.S each year. Most people recover from their bout, but for as many as 50% of those over age 60 who have not been treated, the pain doesn't go away.</code> |
| <code>18.709746996561687</code> | <code>uuww airport</code> | <code>Vnukovo International Airport. Vnukovo International Airport (Russian: междÑнаÑоднÑй аÑÑопоÑÑ Ð²Ð½Ñково; IPA: [ËvnukÉvÉ]) (IATA: VKO, ICAO: UUWW), is a dual-runway international airport located 28 kilometres (17 mi) southwest of the centre of Moscow, Russia.</code> | <code>Javascript is currently disabled in your browser. Arrivals& Departures Timetable Budgetflightsout ofBrussels Airport To & fromBrussels Airport Parking at the airport Worldwidebudget flights &city trips Informationon air trafficto & fromBrussels Airport Shops,bars &restaurants Baggage&TravelInfo.avascript is currently disabled in your browser. Arrivals& Departures Timetable Budgetflightsout ofBrussels Airport To & fromBrussels Airport Parking at the airport Worldwidebudget flights &city trips Informationon air trafficto & fromBrussels Airport Shops,bars &restaurants Baggage&TravelInfo.</code> |
| <code>9.210955460866293</code> | <code>what is a hepatitis b surface antibody test</code> | <code>This test looks for hepatitis B surface antigens in your blood. The test is used to find out whether you have a recent or long-standing infection from the hepatitis B virus (HBV). HBV has proteins called antigens on its surface that cause your immune system to make antibodies.</code> | <code>Blood tests for hepatitis C include the following: 1 Screening test for antibodies to the hepatitis C virus. A screening blood test will show whether you have developed antibodies to the hepatitis C virus. A positive antibody test means you were exposed to the hepatitis C virus at some point.</code> |
{
"activation_fn": "torch.nn.modules.linear.Identity"
}
| score | query | positive | negative | |
|---|---|---|---|---|
| type | float | string | string | string |
| modality | text | text | text | |
| details | <ul><li>min: -1.07</li><li>mean: 13.75</li><li>max: 21.54</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 9.12 tokens</li><li>max: 18 tokens</li></ul> | <ul><li>min: 26 tokens</li><li>mean: 78.65 tokens</li><li>max: 166 tokens</li></ul> | <ul><li>min: 25 tokens</li><li>mean: 73.67 tokens</li><li>max: 176 tokens</li></ul> |
| score | query | positive | negative |
|---|---|---|---|
| <code>17.243099629878998</code> | <code>cost for laminate flooring per square foot</code> | <code>Average Price Range. Cheap laminate flooring starts at less than $1 per square foot and can cost as much as $5 per square foot. The average laminate flooring costs from $2.40-$4 per square foot.The price is determined, as it is with most products, by the quality of the material.A major part of that quality is the thickness of the wear layer.: There will be some variation in prices regionally and the final amount will depend on the size and complexity of the project, that said the average cost to install laminate flooring is $1.40 to $2.20 per square foot.</code> | <code>We created the most comprehensive flooring installation calculator on the internet. Weâve broken it down to the following: Step 1 â Laminate Type. Step 2 â Location, Square Footage, Materials, and Labor. Step 3 â Old Flooring and New Flooring. Step 4 â Get your calculation. Put it all together and we give you the most accurate flooring calculation available.</code> |
| <code>15.025473694006603</code> | <code>what county is south daytona, fl in?</code> | <code>South Daytona, Florida. South Daytona is a city in Volusia County, Florida, United States. The population was 12,252 at the 2010 census.</code> | <code>Driving distance from Ocala, FL to Daytona Beach, FL. The total driving distance from Ocala, FL to Daytona Beach, FL is 78 miles or 126 kilometers. Your trip begins in Ocala, Florida. It ends in Daytona Beach, Florida.</code> |
| <code>19.3864418665568</code> | <code>when was donkey kong released</code> | <code>Donkey Kong (ãã³ãã¼ã³ã³ã°, DonkÄ« Kongu, [dõÅ.kiË kõÅ.É¡uÍ]) is a series of video games featuring the adventures of a gorilla character called Donkey Kong, conceived by Shigeru Miyamoto in 1981. The franchise mainly comprises two different game genres, plus spin-off titles of various genres.</code> | <code>⢠Overfeeding a donkey or feeding it the wrong diet can be fatal. ⢠Overfeeding can result a crippling disease called laminitis of the hooves. ⢠Obesity is also a consequence of overfeeding. ⢠Once obese it is difficult to get a donkey back to normal weight because they require so few calories to sustain themselves.</code> |
{
"activation_fn": "torch.nn.modules.linear.Identity"
}
per_device_train_batch_size: 16num_train_epochs: 1learning_rate: 8e-06warmup_steps: 0.1fp16: Trueper_device_eval_batch_size: 16load_best_model_at_end: Trueseed: 12dataloader_num_workers: 2dataloader_persistent_workers: Trueper_device_train_batch_size: 16num_train_epochs: 1max_steps: -1learning_rate: 8e-06lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_steps: 0.1optim: adamw_torch_fusedoptim_args: Noneweight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08optim_target_modules: Nonegradient_accumulation_steps: 1average_tokens_across_devices: Truemax_grad_norm: 1.0label_smoothing_factor: 0.0bf16: Falsefp16: Truebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Nonetorch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneuse_liger_kernel: Falseliger_kernel_config: Noneuse_cache: Falseneftune_noise_alpha: Nonetorch_empty_cache_steps: Noneauto_find_batch_size: Falselog_on_each_node: Truelogging_nan_inf_filter: Trueinclude_num_input_tokens_seen: nolog_level: passivelog_level_replica: warningdisable_tqdm: Falseproject: huggingfacetrackio_space_id: Nonetrackio_bucket_id: Nonetrackio_static_space_id: Noneper_device_eval_batch_size: 16prediction_loss_only: Trueeval_on_start: Falseeval_do_concat_batches: Trueeval_use_gather_object: Falseeval_accumulation_steps: Noneinclude_for_metrics: []batch_eval_metrics: Falsesave_only_model: Falsesave_on_each_node: Falseenable_jit_checkpoint: Falsepush_to_hub: Falsehub_private_repo: Nonehub_model_id: Nonehub_strategy: every_savehub_always_push: Falsehub_revision: Noneload_best_model_at_end: Trueignore_data_skip: Falserestore_callback_states_from_checkpoint: Falsefull_determinism: Falseseed: 12data_seed: Noneuse_cpu: Falseaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedataloader_drop_last: Falsedataloader_num_workers: 2dataloader_pin_memory: Truedataloader_persistent_workers: Truedataloader_prefetch_factor: Noneremove_unused_columns: Truelabel_names: Nonetrain_sampling_strategy: randomlength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falseddp_static_graph: Noneddp_backend: Noneddp_timeout: 1800fsdp: Nonefsdp_config: Nonedeepspeed: Nonedebug: []skip_memory_metrics: Truedo_predict: Falseresume_from_checkpoint: Nonewarmup_ratio: Nonelocal_rank: -1prompts: 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.0571 (-0.4833) | 0.2602 (-0.0648) | 0.0366 (-0.4641) | 0.1180 (-0.3374) |
| 0.0000 | 1 | 10.5990 | - | - | - | - | - |
| 0.032 | 1000 | 14.1334 | - | - | - | - | - |
| 0.064 | 2000 | 10.7750 | - | - | - | - | - |
| 0.096 | 3000 | 8.2282 | - | - | - | - | - |
| 0.128 | 4000 | 7.5857 | - | - | - | - | - |
| 0.16 | 5000 | 7.6998 | 7.2268 | 0.6103 (+0.0699) | 0.4113 (+0.0863) | 0.7143 (+0.2136) | 0.5786 (+0.1233) |
| 0.192 | 6000 | 7.5407 | - | - | - | - | - |
| 0.224 | 7000 | 6.6533 | - | - | - | - | - |
| 0.256 | 8000 | 6.3815 | - | - | - | - | - |
| 0.288 | 9000 | 6.0625 | - | - | - | - | - |
| 0.32 | 10000 | 5.7674 | 5.1869 | 0.6309 (+0.0905) | 0.4054 (+0.0804) | 0.7280 (+0.2274) | 0.5881 (+0.1327) |
| 0.352 | 11000 | 5.6975 | - | - | - | - | - |
| 0.384 | 12000 | 5.6018 | - | - | - | - | - |
| 0.416 | 13000 | 5.4275 | - | - | - | - | - |
| 0.448 | 14000 | 5.3066 | - | - | - | - | - |
| 0.48 | 15000 | 5.1923 | 4.7864 | 0.6604 (+0.1200) | 0.4208 (+0.0958) | 0.7186 (+0.2179) | 0.5999 (+0.1446) |
| 0.512 | 16000 | 5.0914 | - | - | - | - | - |
| 0.544 | 17000 | 5.0233 | - | - | - | - | - |
| 0.576 | 18000 | 4.8260 | - | - | - | - | - |
| 0.608 | 19000 | 4.7843 | - | - | - | - | - |
| 0.64 | 20000 | 4.6837 | 3.9526 | 0.6684 (+0.1279) | 0.4159 (+0.0909) | 0.7250 (+0.2243) | 0.6031 (+0.1477) |
| 0.672 | 21000 | 4.7339 | - | - | - | - | - |
| 0.704 | 22000 | 4.5955 | - | - | - | - | - |
| 0.736 | 23000 | 4.5098 | - | - | - | - | - |
| 0.768 | 24000 | 4.5284 | - | - | - | - | - |
| 0.8 | 25000 | 4.4547 | 3.8360 | 0.6501 (+0.1097) | 0.4178 (+0.0927) | 0.7125 (+0.2119) | 0.5935 (+0.1381) |
| 0.832 | 26000 | 4.4747 | - | - | - | - | - |
| 0.864 | 27000 | 4.4769 | - | - | - | - | - |
| 0.896 | 28000 | 4.3455 | - | - | - | - | - |
| 0.928 | 29000 | 4.5034 | - | - | - | - | - |
| 0.96 | 30000 | 4.2892 | 4.0615 | 0.6478 (+0.1073) | 0.4092 (+0.0842) | 0.7201 (+0.2195) | 0.5924 (+0.1370) |
| 0.992 | 31000 | 4.2995 | - | - | - | - | - |
| 1.0 | 31250 | - | 3.8921 | 0.6574 (+0.1170) | 0.4094 (+0.0843) | 0.7192 (+0.2185) | 0.5953 (+0.1400) |
| -1 | -1 | - | - | 0.6684 (+0.1279) | 0.4159 (+0.0909) | 0.7250 (+0.2243) | 0.6031 (+0.1477) |
@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",
}
@misc{hofstätter2021improving,
title={Improving Efficient Neural Ranking Models with Cross-Architecture Knowledge Distillation},
author={Sebastian Hofstätter and Sophia Althammer and Michael Schröder and Mete Sertkan and Allan Hanbury},
year={2021},
eprint={2010.02666},
archivePrefix={arXiv},
primaryClass={cs.IR}
}
<!--
## Glossary
*Clearly define terms in order to be accessible across audiences.*
-->
<!--
## Model Card Authors
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
-->
<!--
## Model Card Contact
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
-->