Downloads · 30 days
7
15% of all-time downloads
rohit-vt/tink-reranker-minilm
tink-reranker-minilm is a text ranking model from rohit-vt. 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 cross-encoder/ms-marco-MiniLM-L6-v2 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
7
15% of all-time downloads
All-time downloads
47
Public
Parameters
22.7M
90.9 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors90.9 MB · 99%
From the Hugging Face model README
This is a Cross Encoder model finetuned from cross-encoder/ms-marco-MiniLM-L6-v2 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("cross_encoder_model_id")
# Get scores for pairs of inputs
pairs = [
['skill: manage health care staff', 'skill: manage healthcare staff'],
['skill: manage health care staff', 'skill: manage staff'],
['skill: manage health care staff', 'skill: manage physiotherapy staff'],
['skill: manage health care staff', 'skill: manage a multidisciplinary team involved in patient care'],
['skill: manage health care staff', 'skill: work with nursing staff'],
]
scores = model.predict(pairs)
print(scores)
# [ 4.398 -1.7689 -3.7867 -3.7799 -4.4436]
# Or rank different texts based on similarity to a single text
ranks = model.rank(
'skill: manage health care staff',
[
'skill: manage healthcare staff',
'skill: manage staff',
'skill: manage physiotherapy staff',
'skill: manage a multidisciplinary team involved in patient care',
'skill: work with nursing staff',
]
)
# [{'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.*
-->
<!--
## Bias, Risks and Limitations
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
-->
<!--
### Recommendations
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
-->
| sentence_A | sentence_B | label | |
|---|---|---|---|
| type | string | string | float |
| modality | text | text | |
| details | <ul><li>min: 7 tokens</li><li>mean: 8.15 tokens</li><li>max: 11 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 7.49 tokens</li><li>max: 9 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.2</li><li>max: 1.0</li></ul> |
| sentence_A | sentence_B | label |
|---|---|---|
| <code>skill: manage security systems</code> | <code>skill: manage technical security systems</code> | <code>1.0</code> |
| <code>skill: manage security systems</code> | <code>skill: manage system security</code> | <code>0.0</code> |
| <code>skill: manage security systems</code> | <code>skill: manage alarm system</code> | <code>0.0</code> |
{
"activation_fn": "torch.nn.modules.linear.Identity",
"pos_weight": null
}
| sentence_A | sentence_B | label | |
|---|---|---|---|
| type | string | string | float |
| modality | text | text | |
| details | <ul><li>min: 6 tokens</li><li>mean: 9.26 tokens</li><li>max: 14 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 8.34 tokens</li><li>max: 16 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.2</li><li>max: 1.0</li></ul> |
| sentence_A | sentence_B | label |
|---|---|---|
| <code>skill: manage health care staff</code> | <code>skill: manage healthcare staff</code> | <code>1.0</code> |
| <code>skill: manage health care staff</code> | <code>skill: manage staff</code> | <code>0.0</code> |
| <code>skill: manage health care staff</code> | <code>skill: manage physiotherapy staff</code> | <code>0.0</code> |
{
"activation_fn": "torch.nn.modules.linear.Identity",
"pos_weight": null
}
per_device_train_batch_size: 32num_train_epochs: 2learning_rate: 2e-05warmup_steps: 0.1per_device_eval_batch_size: 64load_best_model_at_end: Trueper_device_train_batch_size: 32num_train_epochs: 2max_steps: -1learning_rate: 2e-05lr_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: Falsebf16_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: 64prediction_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: 42data_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: 0dataloader_pin_memory: Truedataloader_persistent_workers: Falsedataloader_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: []fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}deepspeed: 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 |
|---|---|---|---|
| 0.0580 | 20 | 0.9453 | - |
| 0.1159 | 40 | 0.5269 | - |
| 0.1739 | 60 | 0.4222 | - |
| 0.2319 | 80 | 0.3795 | - |
| 0.2899 | 100 | 0.3090 | - |
| 0.3478 | 120 | 0.3580 | - |
| 0.4058 | 140 | 0.3126 | - |
| 0.4638 | 160 | 0.2220 | - |
| 0.5217 | 180 | 0.2884 | - |
| 0.5797 | 200 | 0.2795 | - |
| 0.6377 | 220 | 0.2328 | - |
| 0.6957 | 240 | 0.2573 | - |
| 0.7536 | 260 | 0.2493 | - |
| 0.8116 | 280 | 0.2100 | - |
| 0.8696 | 300 | 0.2548 | - |
| 0.9275 | 320 | 0.2212 | - |
| 0.9855 | 340 | 0.2308 | - |
| 1.0 | 345 | - | 0.257 |
| 1.0435 | 360 | 0.2258 | - |
| 1.1014 | 380 | 0.1895 | - |
| 1.1594 | 400 | 0.1689 | - |
| 1.2174 | 420 | 0.2283 | - |
| 1.2754 | 440 | 0.2253 | - |
| 1.3333 | 460 | 0.2040 | - |
| 1.3913 | 480 | 0.1850 | - |
| 1.4493 | 500 | 0.1932 | - |
| 1.5072 | 520 | 0.1920 | - |
| 1.5652 | 540 | 0.1964 | - |
| 1.6232 | 560 | 0.1571 | - |
| 1.6812 | 580 | 0.2132 | - |
| 1.7391 | 600 | 0.1823 | - |
| 1.7971 | 620 | 0.1950 | - |
| 1.8551 | 640 | 0.1787 | - |
| 1.9130 | 660 | 0.2028 | - |
| 1.9710 | 680 | 0.1840 | - |
| 2.0 | 690 | - | 0.2671 |
@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.*
-->