Downloads · 30 days
12
22% of all-time downloads
IoannisKat1/reranker-bge-reranker-v2-m3-dev
reranker-bge-reranker-v2-m3-dev is a text ranking model from IoannisKat1. 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 BAAI/bge-reranker-v2-m3 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
12
22% of all-time downloads
All-time downloads
54
Public
Parameters
568M
2.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.3 GB · 99%
From the Hugging Face model README
This is a Cross Encoder model finetuned from BAAI/bge-reranker-v2-m3 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': 'XLMRobertaForSequenceClassification'})
)
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("IoannisKat1/reranker-bge-reranker-v2-m3-dev")
# Get scores for pairs of inputs
pairs = [
['Τι είδους διαδικασία αναφέρεται στο κείμενο;', 'διαγωνισμό'],
['Τι είδους διαδικασία αναφέρεται στο κείμενο;', '. Σχετικά έγγραφα περιλαμβάνονται στην σελίδα: Επιστολή Προέδρου ΑΔΙΠ, Απόφαση Συμβουλίου ΑΔΙΠ, Έκθεση Πιστοποίησης.'],
['Τι είδους διαδικασία αναφέρεται στο κείμενο;', 'Ορισμός Αυτομάτων, Επεκτάσεις FSA: Δίδυμα, Παράλληλα, Μετατροπείς, Εφαρμογές Αυτομάτων, Μορφολογική Ανάλυση, Το Μορφολογικό Μοντέλο Kay-Kaplan, Το Μορφολογικό Μοντέλο Δύο Επιπέδων, Τυπικές Γλώσσες και Γραμματικές, Η Ιεραρχία Chomsky, Κανονική Μορφή κατά Chomsky (CNF), Ο Αλγόριθμος CKY, Λογάριθμοι και Logprob, Πιθανοτικές Γραμματικές Τύπου 2, Κατηγορίες Σωμάτων Κειμένων, Μετατροπή PCFG σε CNF,'],
['Τι είδους διαδικασία αναφέρεται στο κείμενο;', '. Διενεργείται στα εργαστήρια του τμήματος στο πλαίσιο ερευνητικών προγραμμάτων ανά εργαστήριο και χρηματοδοτείται είτε από δημόσιους πόρους (Τακτικός Προϋπολογισμός, Δημόσιες Επενδύσεις, εισφορά ΤΣΜΕΔΕ) είτε από εξωπανεπιστημιακούς φορείς (Γενική Γραμματεία Ερευνας και Τεχνολογίας, βιομηχανία, Ε.Ε., κλπ).'],
['Τι είδους διαδικασία αναφέρεται στο κείμενο;', 'λειτουργεί σαν κινητήρας'],
]
scores = model.predict(pairs)
print(scores)
# [9.9993e-01 2.5867e-05 2.7752e-05 2.6070e-05 2.6689e-05]
# Or rank different texts based on similarity to a single text
ranks = model.rank(
'Τι είδους διαδικασία αναφέρεται στο κείμενο;',
[
'διαγωνισμό',
'. Σχετικά έγγραφα περιλαμβάνονται στην σελίδα: Επιστολή Προέδρου ΑΔΙΠ, Απόφαση Συμβουλίου ΑΔΙΠ, Έκθεση Πιστοποίησης.',
'Ορισμός Αυτομάτων, Επεκτάσεις FSA: Δίδυμα, Παράλληλα, Μετατροπείς, Εφαρμογές Αυτομάτων, Μορφολογική Ανάλυση, Το Μορφολογικό Μοντέλο Kay-Kaplan, Το Μορφολογικό Μοντέλο Δύο Επιπέδων, Τυπικές Γλώσσες και Γραμματικές, Η Ιεραρχία Chomsky, Κανονική Μορφή κατά Chomsky (CNF), Ο Αλγόριθμος CKY, Λογάριθμοι και Logprob, Πιθανοτικές Γραμματικές Τύπου 2, Κατηγορίες Σωμάτων Κειμένων, Μετατροπή PCFG σε CNF,',
'. Διενεργείται στα εργαστήρια του τμήματος στο πλαίσιο ερευνητικών προγραμμάτων ανά εργαστήριο και χρηματοδοτείται είτε από δημόσιους πόρους (Τακτικός Προϋπολογισμός, Δημόσιες Επενδύσεις, εισφορά ΤΣΜΕΔΕ) είτε από εξωπανεπιστημιακούς φορείς (Γενική Γραμματεία Ερευνας και Τεχνολογίας, βιομηχανία, Ε.Ε., κλπ).',
'λειτουργεί σαν κινητήρας',
]
)
# [{'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.*
-->
bge-dev{
"at_k": 10,
"always_rerank_positives": false
}
| Metric | Value |
|---|---|
| map | 0.7300 (+0.1664) |
| mrr@10 | 0.7305 (+0.1705) |
| ndcg@10 | 0.7438 (+0.1415) |
NanoMSMARCO_R100, NanoNFCorpus_R100 and NanoNQ_R100{
"at_k": 10,
"always_rerank_positives": true
}
| Metric | NanoMSMARCO_R100 | NanoNFCorpus_R100 | NanoNQ_R100 |
|---|---|---|---|
| map | 0.6090 (+0.1195) | 0.3872 (+0.1262) | 0.5927 (+0.1731) |
| mrr@10 | 0.6134 (+0.1359) | 0.6127 (+0.1129) | 0.6245 (+0.1978) |
| ndcg@10 | 0.6766 (+0.1362) | 0.4318 (+0.1068) | 0.6469 (+0.1462) |
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.5297 (+0.1396) |
| mrr@10 | 0.6169 (+0.1488) |
| ndcg@10 | 0.5851 (+0.1297) |
| query | document | label | |
|---|---|---|---|
| type | string | string | int |
| modality | text | text | |
| details | <ul><li>min: 9 tokens</li><li>mean: 16.42 tokens</li><li>max: 27 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 85.97 tokens</li><li>max: 156 tokens</li></ul> | <ul><li>0: ~79.81%</li><li>1: ~20.19%</li></ul> |
| query | document | label |
|---|---|---|
| <code>Τι είδους διαδικασία αναφέρεται στο κείμενο;</code> | <code>διαγωνισμό</code> | <code>1</code> |
| <code>Τι είδους διαδικασία αναφέρεται στο κείμενο;</code> | <code>. Σχετικά έγγραφα περιλαμβάνονται στην σελίδα: Επιστολή Προέδρου ΑΔΙΠ, Απόφαση Συμβουλίου ΑΔΙΠ, Έκθεση Πιστοποίησης.</code> | <code>0</code> |
| <code>Τι είδους διαδικασία αναφέρεται στο κείμενο;</code> | <code>Ορισμός Αυτομάτων, Επεκτάσεις FSA: Δίδυμα, Παράλληλα, Μετατροπείς, Εφαρμογές Αυτομάτων, Μορφολογική Ανάλυση, Το Μορφολογικό Μοντέλο Kay-Kaplan, Το Μορφολογικό Μοντέλο Δύο Επιπέδων, Τυπικές Γλώσσες και Γραμματικές, Η Ιεραρχία Chomsky, Κανονική Μορφή κατά Chomsky (CNF), Ο Αλγόριθμος CKY, Λογάριθμοι και Logprob, Πιθανοτικές Γραμματικές Τύπου 2, Κατηγορίες Σωμάτων Κειμένων, Μετατροπή PCFG σε CNF,</code> | <code>0</code> |
{
"activation_fn": "torch.nn.modules.linear.Identity",
"pos_weight": 5
}
num_train_epochs: 10learning_rate: 2e-05warmup_steps: 0.1gradient_accumulation_steps: 4fp16: Trueeval_accumulation_steps: 4load_best_model_at_end: Trueseed: 12dataloader_num_workers: 2per_device_train_batch_size: 8num_train_epochs: 10max_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: 4average_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: 8prediction_loss_only: Trueeval_on_start: Falseeval_do_concat_batches: Trueeval_use_gather_object: Falseeval_accumulation_steps: 4include_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: 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: 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 | bge-dev_ndcg@10 | NanoMSMARCO_R100_ndcg@10 | NanoNFCorpus_R100_ndcg@10 | NanoNQ_R100_ndcg@10 | NanoBEIR_R100_mean_ndcg@10 |
|---|---|---|---|---|---|---|---|
| -1 | -1 | - | 0.7278 (+0.1254) | 0.6867 (+0.1463) | 0.3879 (+0.0628) | 0.7808 (+0.2802) | 0.6185 (+0.1631) |
| 0.0018 | 1 | 3.7141 | - | - | - | - | - |
| 1.7640 | 1000 | 0.4219 | - | - | - | - | - |
| 3.5276 | 2000 | 0.2279 | - | - | - | - | - |
| 5.2911 | 3000 | 0.1297 | - | - | - | - | - |
| 7.0547 | 4000 | 0.0732 | 0.7438 (+0.1415) | 0.6766 (+0.1362) | 0.4318 (+0.1068) | 0.6469 (+0.1462) | 0.5851 (+0.1297) |
| 8.8187 | 5000 | 0.0294 | - | - | - | - | - |
| 10.0 | 5670 | - | 0.7433 (+0.1409) | 0.6805 (+0.1400) | 0.3949 (+0.0699) | 0.6468 (+0.1461) | 0.5740 (+0.1187) |
| -1 | -1 | - | 0.7438 (+0.1415) | 0.6766 (+0.1362) | 0.4318 (+0.1068) | 0.6469 (+0.1462) | 0.5851 (+0.1297) |
@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.*
-->