Downloads · 30 days
8
12% of all-time downloads
damon6/reranker-MiniLM-L12-H384-uncased-gooaq-cmnrl
reranker-MiniLM-L12-H384-uncased-gooaq-cmnrl is a text ranking model from damon6. 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 microsoft/MiniLM-L12-H384-uncased on the gooaq dataset using the sentence-transformers library. It computes scores for pairs of texts, which can be used for text reranking…
Downloads · 30 days
8
12% of all-time downloads
All-time downloads
69
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 gooaq dataset using the sentence-transformers library. It computes scores for pairs of texts, which can be used for text reranking and semantic search.
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("damon6/reranker-MiniLM-L12-H384-uncased-gooaq-cmnrl")
# Get scores for pairs of texts
pairs = [
['should you take ibuprofen with high blood pressure?', "In general, people with high blood pressure should use acetaminophen or possibly aspirin for over-the-counter pain relief. Unless your health care provider has said it's OK, you should not use ibuprofen, ketoprofen, or naproxen sodium. If aspirin or acetaminophen doesn't help with your pain, call your doctor."],
['how old do you have to be to work in sc?', 'The general minimum age of employment for South Carolina youth is 14, although the state allows younger children who are performers to work in show business. If their families are agricultural workers, children younger than age 14 may also participate in farm labor.'],
['how to write a topic proposal for a research paper?', "['Write down the main topic of your paper. ... ', 'Write two or three short sentences under the main topic that explain why you chose that topic. ... ', 'Write a thesis sentence that states the angle and purpose of your research paper. ... ', 'List the items you will cover in the body of the paper that support your thesis statement.']"],
['how much does aaf pay players?', 'These dates provided an opportunity for players cut at the NFL roster deadline, and each player signed a non-guaranteed three-year contract worth a total of $250,000 ($70,000 in 2019; $80,000 in 2020; $100,000 in 2021), with performance-based and fan-interaction incentives allowing for players to earn more.'],
['is jove and zeus the same?', 'Jupiter, or Jove, in Roman mythology is the king of the gods and the god of sky and thunder, equivalent to Zeus in Greek traditions.'],
]
scores = model.predict(pairs)
print(scores.shape)
# (5,)
# Or rank different texts based on similarity to a single text
ranks = model.rank(
'should you take ibuprofen with high blood pressure?',
[
"In general, people with high blood pressure should use acetaminophen or possibly aspirin for over-the-counter pain relief. Unless your health care provider has said it's OK, you should not use ibuprofen, ketoprofen, or naproxen sodium. If aspirin or acetaminophen doesn't help with your pain, call your doctor.",
'The general minimum age of employment for South Carolina youth is 14, although the state allows younger children who are performers to work in show business. If their families are agricultural workers, children younger than age 14 may also participate in farm labor.',
"['Write down the main topic of your paper. ... ', 'Write two or three short sentences under the main topic that explain why you chose that topic. ... ', 'Write a thesis sentence that states the angle and purpose of your research paper. ... ', 'List the items you will cover in the body of the paper that support your thesis statement.']",
'These dates provided an opportunity for players cut at the NFL roster deadline, and each player signed a non-guaranteed three-year contract worth a total of $250,000 ($70,000 in 2019; $80,000 in 2020; $100,000 in 2021), with performance-based and fan-interaction incentives allowing for players to earn more.',
'Jupiter, or Jove, in Roman mythology is the king of the gods and the god of sky and thunder, equivalent to Zeus in Greek traditions.',
]
)
# [{'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.2443 (-0.2453) | 0.3373 (+0.0763) | 0.3510 (-0.0686) |
| mrr@10 | 0.2266 (-0.2509) | 0.4957 (-0.0041) | 0.3430 (-0.0837) |
| ndcg@10 | 0.3044 (-0.2360) | 0.3286 (+0.0036) | 0.4290 (-0.0717) |
NanoBEIR_R100_mean{
"dataset_names": [
"msmarco",
"nfcorpus",
"nq"
],
"rerank_k": 100,
"at_k": 10,
"always_rerank_positives": true
}
| Metric | Value |
|---|---|
| map | 0.3109 (-0.0792) |
| mrr@10 | 0.3551 (-0.1129) |
| ndcg@10 | 0.3540 (-0.1014) |
| question | answer | |
|---|---|---|
| type | string | string |
| details | <ul><li>min: 17 characters</li><li>mean: 42.88 characters</li><li>max: 95 characters</li></ul> | <ul><li>min: 53 characters</li><li>mean: 251.42 characters</li><li>max: 398 characters</li></ul> |
| question | answer |
|---|---|
| <code>what are the 5 characteristics of a star?</code> | <code>Key Concept: Characteristics used to classify stars include color, temperature, size, composition, and brightness.</code> |
| <code>are copic markers alcohol ink?</code> | <code>Copic Ink is alcohol-based and flammable. Keep away from direct sunlight and extreme temperatures.</code> |
| <code>what is the difference between appellate term and appellate division?</code> | <code>Appellate terms An appellate term is an intermediate appellate court that hears appeals from the inferior courts within their designated counties or judicial districts, and are intended to ease the workload on the Appellate Division and provide a less expensive forum closer to the people.</code> |
{
"scale": 10.0,
"num_negatives": 5,
"activation_fn": "torch.nn.modules.activation.Sigmoid",
"mini_batch_size": 16
}
| question | answer | |
|---|---|---|
| type | string | string |
| details | <ul><li>min: 18 characters</li><li>mean: 43.05 characters</li><li>max: 88 characters</li></ul> | <ul><li>min: 51 characters</li><li>mean: 252.39 characters</li><li>max: 386 characters</li></ul> |
| question | answer |
|---|---|
| <code>should you take ibuprofen with high blood pressure?</code> | <code>In general, people with high blood pressure should use acetaminophen or possibly aspirin for over-the-counter pain relief. Unless your health care provider has said it's OK, you should not use ibuprofen, ketoprofen, or naproxen sodium. If aspirin or acetaminophen doesn't help with your pain, call your doctor.</code> |
| <code>how old do you have to be to work in sc?</code> | <code>The general minimum age of employment for South Carolina youth is 14, although the state allows younger children who are performers to work in show business. If their families are agricultural workers, children younger than age 14 may also participate in farm labor.</code> |
| <code>how to write a topic proposal for a research paper?</code> | <code>['Write down the main topic of your paper. ... ', 'Write two or three short sentences under the main topic that explain why you chose that topic. ... ', 'Write a thesis sentence that states the angle and purpose of your research paper. ... ', 'List the items you will cover in the body of the paper that support your thesis statement.']</code> |
{
"scale": 10.0,
"num_negatives": 5,
"activation_fn": "torch.nn.modules.activation.Sigmoid",
"mini_batch_size": 16
}
eval_strategy: stepsper_device_train_batch_size: 64per_device_eval_batch_size: 64learning_rate: 2e-05num_train_epochs: 1warmup_ratio: 0.1seed: 12bf16: Trueoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 64per_device_eval_batch_size: 64per_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: Falseignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}tp_size: 0fsdp_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: 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| 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.0135 (-0.5269) | 0.2767 (-0.0484) | 0.0393 (-0.4613) | 0.1098 (-0.3455) |
| 0.0006 | 1 | 1.7928 | - | - | - | - | - |
| 0.0646 | 100 | 1.3987 | - | - | - | - | - |
| 0.1293 | 200 | 0.1092 | - | - | - | - | - |
| 0.1616 | 250 | - | 0.0572 | 0.1744 (-0.3660) | 0.2864 (-0.0387) | 0.2883 (-0.2123) | 0.2497 (-0.2057) |
| 0.1939 | 300 | 0.0728 | - | - | - | - | - |
| 0.2586 | 400 | 0.0488 | - | - | - | - | - |
| 0.3232 | 500 | 0.0346 | 0.0330 | 0.3017 (-0.2387) | 0.3226 (-0.0025) | 0.4226 (-0.0780) | 0.3490 (-0.1064) |
| 0.3878 | 600 | 0.0255 | - | - | - | - | - |
| 0.4525 | 700 | 0.0262 | - | - | - | - | - |
| 0.4848 | 750 | - | 0.0309 | 0.2347 (-0.3057) | 0.3167 (-0.0083) | 0.3799 (-0.1207) | 0.3105 (-0.1449) |
| 0.5171 | 800 | 0.0234 | - | - | - | - | - |
| 0.5818 | 900 | 0.0193 | - | - | - | - | - |
| 0.6464 | 1000 | 0.0185 | 0.0141 | 0.3353 (-0.2051) | 0.3297 (+0.0047) | 0.4774 (-0.0233) | 0.3808 (-0.0746) |
| 0.7111 | 1100 | 0.0165 | - | - | - | - | - |
| 0.7757 | 1200 | 0.024 | - | - | - | - | - |
| 0.8080 | 1250 | - | 0.0153 | 0.3176 (-0.2229) | 0.3217 (-0.0033) | 0.4177 (-0.0829) | 0.3523 (-0.1030) |
| 0.8403 | 1300 | 0.0189 | - | - | - | - | - |
| 0.9050 | 1400 | 0.0244 | - | - | - | - | - |
| 0.9696 | 1500 | 0.0236 | 0.0230 | 0.3033 (-0.2371) | 0.3274 (+0.0023) | 0.4173 (-0.0833) | 0.3494 (-0.1060) |
| -1 | -1 | - | - | 0.3044 (-0.2360) | 0.3286 (+0.0036) | 0.4290 (-0.0717) | 0.3540 (-0.1014) |
@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.*
-->