Downloads · 30 days
11
32% of all-time downloads
kwondw/reranker-ModernBERT-base-gooaq-bce-50k
reranker-ModernBERT-base-gooaq-bce-50k 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. The card lists the license as apache-2.0.
This is a Cross Encoder model finetuned from answerdotai/ModernBERT-base using the sentence-transformers library. It computes scores for pairs of texts, which can be used for text reranking and semantic search.
Downloads · 30 days
11
32% of all-time downloads
All-time downloads
34
Public
Parameters
150M
598 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors598 MB · 99%
From the Hugging Face model README
This is a Cross Encoder model finetuned from answerdotai/ModernBERT-base 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': 'ModernBertForSequenceClassification'})
)
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-ModernBERT-base-gooaq-bce-50k")
# Get scores for pairs of inputs
pairs = [
['is corpse bride on hulu?', ". Watch Corpse Bride on Hulu either streaming online or on your favorite device. It's easy to watch Corpse Bride streaming online if you have either the Hulu basic or the Hulu Premium. ... HBO Max now has Corpse Bride streaming with a subscription."],
['is corpse bride on hulu?', 'When you put your day-of timeline together, try to keep these guidelines in mind: Makeup: 30–45 minutes per bridesmaid and mother of the bride, 60–90 minutes for the bride. Hair: 30–45 minutes per bridesmaid and mother of the bride, 60–90 minutes for the bride.'],
['is corpse bride on hulu?', "A dowry is a transfer of parental property, gifts, or money at the marriage of a daughter (bride). ... While bride price or bride service is a payment by the groom or his family to the bride's parents, dowry is the wealth transferred from the bride's family to the groom or his family, ostensibly for the bride."],
['is corpse bride on hulu?', 'The traditional wedding speech order goes father of the bride, groom, best man and other toasts. However, lots of brides now choose to give a speech, as do the bridesmaids or maid of honour. If you are including these, the order should go: father of the bride, groom, bride, bridesmaids/maid of honour, best man.'],
['is corpse bride on hulu?', "If the bride can afford to, it's a very thoughtful gesture for her to pay for the dress or a portion of the cost for each of her bridesmaids. ... Generally speaking, bridesmaids are expected to pay for their own dresses and accessories, as well as potentially hair and makeup appointments and transportation to the wedding."],
]
scores = model.predict(pairs)
print(scores)
# [9.9504e-01 4.7737e-03 1.2148e-04 1.8603e-03 2.1824e-04]
# Or rank different texts based on similarity to a single text
ranks = model.rank(
'is corpse bride on hulu?',
[
". Watch Corpse Bride on Hulu either streaming online or on your favorite device. It's easy to watch Corpse Bride streaming online if you have either the Hulu basic or the Hulu Premium. ... HBO Max now has Corpse Bride streaming with a subscription.",
'When you put your day-of timeline together, try to keep these guidelines in mind: Makeup: 30–45 minutes per bridesmaid and mother of the bride, 60–90 minutes for the bride. Hair: 30–45 minutes per bridesmaid and mother of the bride, 60–90 minutes for the bride.',
"A dowry is a transfer of parental property, gifts, or money at the marriage of a daughter (bride). ... While bride price or bride service is a payment by the groom or his family to the bride's parents, dowry is the wealth transferred from the bride's family to the groom or his family, ostensibly for the bride.",
'The traditional wedding speech order goes father of the bride, groom, best man and other toasts. However, lots of brides now choose to give a speech, as do the bridesmaids or maid of honour. If you are including these, the order should go: father of the bride, groom, bride, bridesmaids/maid of honour, best man.',
"If the bride can afford to, it's a very thoughtful gesture for her to pay for the dress or a portion of the cost for each of her bridesmaids. ... Generally speaking, bridesmaids are expected to pay for their own dresses and accessories, as well as potentially hair and makeup appointments and transportation to the wedding.",
]
)
# [{'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.*
-->
gooaq-dev{
"at_k": 10,
"always_rerank_positives": false
}
| Metric | Value |
|---|---|
| map | 0.5969 (+0.2482) |
| mrr@10 | 0.5964 (+0.2582) |
| ndcg@10 | 0.6408 (+0.2404) |
NanoMSMARCO_R100, NanoNFCorpus_R100 and NanoNQ_R100{
"at_k": 10,
"always_rerank_positives": true
}
| Metric | NanoMSMARCO_R100 | NanoNFCorpus_R100 | NanoNQ_R100 |
|---|---|---|---|
| map | 0.4076 (-0.0820) | 0.3461 (+0.0851) | 0.4223 (+0.0027) |
| mrr@10 | 0.3912 (-0.0863) | 0.4815 (-0.0183) | 0.4446 (+0.0179) |
| ndcg@10 | 0.4703 (-0.0702) | 0.3600 (+0.0349) | 0.4739 (-0.0267) |
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.3920 (+0.0019) |
| mrr@10 | 0.4391 (-0.0289) |
| ndcg@10 | 0.4347 (-0.0207) |
| question | answer | label | |
|---|---|---|---|
| type | string | string | int |
| modality | text | text | |
| details | <ul><li>min: 9 tokens</li><li>mean: 12.59 tokens</li><li>max: 18 tokens</li></ul> | <ul><li>min: 18 tokens</li><li>mean: 58.07 tokens</li><li>max: 135 tokens</li></ul> | <ul><li>0: ~81.73%</li><li>1: ~18.27%</li></ul> |
| question | answer | label |
|---|---|---|
| <code>is corpse bride on hulu?</code> | <code>. Watch Corpse Bride on Hulu either streaming online or on your favorite device. It's easy to watch Corpse Bride streaming online if you have either the Hulu basic or the Hulu Premium. ... HBO Max now has Corpse Bride streaming with a subscription.</code> | <code>1</code> |
| <code>is corpse bride on hulu?</code> | <code>When you put your day-of timeline together, try to keep these guidelines in mind: Makeup: 30–45 minutes per bridesmaid and mother of the bride, 60–90 minutes for the bride. Hair: 30–45 minutes per bridesmaid and mother of the bride, 60–90 minutes for the bride.</code> | <code>0</code> |
| <code>is corpse bride on hulu?</code> | <code>A dowry is a transfer of parental property, gifts, or money at the marriage of a daughter (bride). ... While bride price or bride service is a payment by the groom or his family to the bride's parents, dowry is the wealth transferred from the bride's family to the groom or his family, ostensibly for the bride.</code> | <code>0</code> |
{
"activation_fn": "torch.nn.modules.linear.Identity",
"pos_weight": 5
}
per_device_train_batch_size: 64per_device_eval_batch_size: 64learning_rate: 2e-05num_train_epochs: 1warmup_steps: 0.1seed: 12fp16: Truedataloader_num_workers: 2load_best_model_at_end: Trueddp_find_unused_parameters: Falsedataloader_persistent_workers: Truedo_predict: Falseprediction_loss_only: Trueper_device_train_batch_size: 64per_device_eval_batch_size: 64gradient_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: Nonewarmup_ratio: Nonewarmup_steps: 0.1log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Trueenable_jit_checkpoint: Falsesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseuse_cpu: Falseseed: 12data_seed: Nonebf16: Falsefp16: Truebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: -1ddp_backend: Nonedebug: []dataloader_drop_last: Truedataloader_num_workers: 2dataloader_prefetch_factor: Nonedisable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Trueignore_data_skip: Falsefsdp: []fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Nonegroup_by_length: Falselength_column_name: lengthproject: huggingfacetrackio_space_id: trackioddp_find_unused_parameters: Falseddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Trueskip_memory_metrics: Truepush_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_for_metrics: []eval_do_concat_batches: Trueauto_find_batch_size: Falsefull_determinism: Falseddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneinclude_num_input_tokens_seen: noneftune_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: Trueuse_cache: Falseprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | gooaq-dev_ndcg@10 | NanoMSMARCO_R100_ndcg@10 | NanoNFCorpus_R100_ndcg@10 | NanoNQ_R100_ndcg@10 | NanoBEIR_R100_mean_ndcg@10 |
|---|---|---|---|---|---|---|---|
| 0.0000 | 1 | 1.1154 | - | - | - | - | - |
| 0.0093 | 200 | 1.2221 | - | - | - | - | - |
| 0.0186 | 400 | 1.2006 | - | - | - | - | - |
| 0.0278 | 600 | 1.1757 | - | - | - | - | - |
| 0.0371 | 800 | 1.0125 | - | - | - | - | - |
| 0.0464 | 1000 | 0.8074 | - | - | - | - | - |
| 0.0557 | 1200 | 0.7453 | - | - | - | - | - |
| 0.0650 | 1400 | 0.7043 | - | - | - | - | - |
| 0.0742 | 1600 | 0.6840 | - | - | - | - | - |
| 0.0835 | 1800 | 0.6631 | - | - | - | - | - |
| 0.0928 | 2000 | 0.6615 | - | - | - | - | - |
| 0.1000 | 2156 | - | 0.5889 (+0.1884) | 0.4139 (-0.1265) | 0.3892 (+0.0642) | 0.5487 (+0.0481) | 0.4506 (-0.0048) |
| 0.1021 | 2200 | 0.6360 | - | - | - | - | - |
| 0.1114 | 2400 | 0.6156 | - | - | - | - | - |
| 0.1206 | 2600 | 0.6007 | - | - | - | - | - |
| 0.1299 | 2800 | 0.5962 | - | - | - | - | - |
| 0.1392 | 3000 | 0.6028 | - | - | - | - | - |
| 0.1485 | 3200 | 0.5925 | - | - | - | - | - |
| 0.1578 | 3400 | 0.5591 | - | - | - | - | - |
| 0.1670 | 3600 | 0.5705 | - | - | - | - | - |
| 0.1763 | 3800 | 0.5607 | - | - | - | - | - |
| 0.1856 | 4000 | 0.5744 | - | - | - | - | - |
| 0.1949 | 4200 | 0.5625 | - | - | - | - | - |
| 0.2001 | 4312 | - | 0.6086 (+0.2081) | 0.4460 (-0.0944) | 0.4204 (+0.0953) | 0.4800 (-0.0207) | 0.4488 (-0.0066) |
| 0.2042 | 4400 | 0.5490 | - | - | - | - | - |
| 0.2134 | 4600 | 0.5529 | - | - | - | - | - |
| 0.2227 | 4800 | 0.5494 | - | - | - | - | - |
| 0.2320 | 5000 | 0.5420 | - | - | - | - | - |
| 0.2413 | 5200 | 0.5184 | - | - | - | - | - |
| 0.2506 | 5400 | 0.5416 | - | - | - | - | - |
| 0.2598 | 5600 | 0.5144 | - | - | - | - | - |
| 0.2691 | 5800 | 0.5260 | - | - | - | - | - |
| 0.2784 | 6000 | 0.5048 | - | - | - | - | - |
| 0.2877 | 6200 | 0.5353 | - | - | - | - | - |
| 0.2970 | 6400 | 0.5199 | - | - | - | - | - |
| 0.3001 | 6468 | - | 0.6113 (+0.2109) | 0.4895 (-0.0509) | 0.3925 (+0.0675) | 0.4662 (-0.0345) | 0.4494 (-0.0060) |
| 0.3063 | 6600 | 0.5116 | - | - | - | - | - |
| 0.3155 | 6800 | 0.5180 | - | - | - | - | - |
| 0.3248 | 7000 | 0.5109 | - | - | - | - | - |
| 0.3341 | 7200 | 0.5095 | - | - | - | - | - |
| 0.3434 | 7400 | 0.5009 | - | - | - | - | - |
| 0.3527 | 7600 | 0.5016 | - | - | - | - | - |
| 0.3619 | 7800 | 0.4985 | - | - | - | - | - |
| 0.3712 | 8000 | 0.5046 | - | - | - | - | - |
| 0.3805 | 8200 | 0.4984 | - | - | - | - | - |
| 0.3898 | 8400 | 0.4969 | - | - | - | - | - |
| 0.3991 | 8600 | 0.5002 | - | - | - | - | - |
| 0.4002 | 8624 | - | 0.6300 (+0.2296) | 0.4809 (-0.0595) | 0.3848 (+0.0597) | 0.4699 (-0.0308) | 0.4452 (-0.0102) |
| 0.4083 | 8800 | 0.4910 | - | - | - | - | - |
| 0.4176 | 9000 | 0.5025 | - | - | - | - | - |
| 0.4269 | 9200 | 0.4854 | - | - | - | - | - |
| 0.4362 | 9400 | 0.4911 | - | - | - | - | - |
| 0.4455 | 9600 | 0.4874 | - | - | - | - | - |
| 0.4547 | 9800 | 0.4895 | - | - | - | - | - |
| 0.4640 | 10000 | 0.4803 | - | - | - | - | - |
| 0.4733 | 10200 | 0.4876 | - | - | - | - | - |
| 0.4826 | 10400 | 0.4893 | - | - | - | - | - |
| 0.4919 | 10600 | 0.4774 | - | - | - | - | - |
| 0.5002 | 10780 | - | 0.6352 (+0.2347) | 0.5559 (+0.0154) | 0.3819 (+0.0568) | 0.5335 (+0.0329) | 0.4904 (+0.0351) |
| 0.5011 | 10800 | 0.4688 | - | - | - | - | - |
| 0.5104 | 11000 | 0.4723 | - | - | - | - | - |
| 0.5197 | 11200 | 0.4752 | - | - | - | - | - |
| 0.5290 | 11400 | 0.4711 | - | - | - | - | - |
| 0.5383 | 11600 | 0.4702 | - | - | - | - | - |
| 0.5475 | 11800 | 0.4680 | - | - | - | - | - |
| 0.5568 | 12000 | 0.4739 | - | - | - | - | - |
| 0.5661 | 12200 | 0.4529 | - | - | - | - | - |
| 0.5754 | 12400 | 0.4709 | - | - | - | - | - |
| 0.5847 | 12600 | 0.4518 | - | - | - | - | - |
| 0.5939 | 12800 | 0.4726 | - | - | - | - | - |
| 0.6003 | 12936 | - | 0.6405 (+0.2400) | 0.5069 (-0.0335) | 0.3581 (+0.0331) | 0.5042 (+0.0036) | 0.4564 (+0.0010) |
| 0.6032 | 13000 | 0.4698 | - | - | - | - | - |
| 0.6125 | 13200 | 0.4627 | - | - | - | - | - |
| 0.6218 | 13400 | 0.4562 | - | - | - | - | - |
| 0.6311 | 13600 | 0.4566 | - | - | - | - | - |
| 0.6403 | 13800 | 0.4775 | - | - | - | - | - |
| 0.6496 | 14000 | 0.4532 | - | - | - | - | - |
| 0.6589 | 14200 | 0.4660 | - | - | - | - | - |
| 0.6682 | 14400 | 0.4488 | - | - | - | - | - |
| 0.6775 | 14600 | 0.4482 | - | - | - | - | - |
| 0.6867 | 14800 | 0.4515 | - | - | - | - | - |
| 0.6960 | 15000 | 0.4596 | - | - | - | - | - |
| 0.7003 | 15092 | - | 0.6413 (+0.2409) | 0.4668 (-0.0736) | 0.3518 (+0.0268) | 0.4538 (-0.0469) | 0.4241 (-0.0312) |
| 0.7053 | 15200 | 0.4418 | - | - | - | - | - |
| 0.7146 | 15400 | 0.4499 | - | - | - | - | - |
| 0.7239 | 15600 | 0.4542 | - | - | - | - | - |
| 0.7331 | 15800 | 0.4636 | - | - | - | - | - |
| 0.7424 | 16000 | 0.4371 | - | - | - | - | - |
| 0.7517 | 16200 | 0.4344 | - | - | - | - | - |
| 0.7610 | 16400 | 0.4535 | - | - | - | - | - |
| 0.7703 | 16600 | 0.4429 | - | - | - | - | - |
| 0.7795 | 16800 | 0.4435 | - | - | - | - | - |
| 0.7888 | 17000 | 0.4398 | - | - | - | - | - |
| 0.7981 | 17200 | 0.4441 | - | - | - | - | - |
| 0.8003 | 17248 | - | 0.6410 (+0.2406) | 0.5221 (-0.0183) | 0.3324 (+0.0074) | 0.4941 (-0.0065) | 0.4496 (-0.0058) |
| 0.8074 | 17400 | 0.4501 | - | - | - | - | - |
| 0.8167 | 17600 | 0.4501 | - | - | - | - | - |
| 0.8259 | 17800 | 0.4228 | - | - | - | - | - |
| 0.8352 | 18000 | 0.4395 | - | - | - | - | - |
| 0.8445 | 18200 | 0.4383 | - | - | - | - | - |
| 0.8538 | 18400 | 0.4414 | - | - | - | - | - |
| 0.8631 | 18600 | 0.4315 | - | - | - | - | - |
| 0.8723 | 18800 | 0.4306 | - | - | - | - | - |
| 0.8816 | 19000 | 0.4249 | - | - | - | - | - |
| 0.8909 | 19200 | 0.4356 | - | - | - | - | - |
| 0.9002 | 19400 | 0.4326 | - | - | - | - | - |
| 0.9004 | 19404 | - | 0.6408 (+0.2404) | 0.4703 (-0.0702) | 0.3600 (+0.0349) | 0.4739 (-0.0267) | 0.4347 (-0.0207) |
| 0.9095 | 19600 | 0.4431 | - | - | - | - | - |
| 0.9188 | 19800 | 0.4199 | - | - | - | - | - |
| 0.9280 | 20000 | 0.4409 | - | - | - | - | - |
| 0.9373 | 20200 | 0.4351 | - | - | - | - | - |
| 0.9466 | 20400 | 0.4261 | - | - | - | - | - |
| 0.9559 | 20600 | 0.4245 | - | - | - | - | - |
| 0.9652 | 20800 | 0.4292 | - | - | - | - | - |
| 0.9744 | 21000 | 0.4300 | - | - | - | - | - |
| 0.9837 | 21200 | 0.4298 | - | - | - | - | - |
| 0.9930 | 21400 | 0.4263 | - | - | - | - | - |
@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",
}
<!--
## 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.*
-->