CrossEncoder based on BAAI/bge-m3

This is a Cross Encoder model finetuned from BAAI/bge-m3 using the sentence-transformers library. It computes scores for pairs of texts, which can be used for text reranking and semantic search.

Model Details

Model Description

  • Model Type: Cross Encoder
  • Base model: BAAI/bge-m3
  • Maximum Sequence Length: 512 tokens
  • Number of Output Labels: 1 label

Model Sources

Usage

Direct Usage (Sentence Transformers)

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 texts
pairs = [
    ['When did the operator of SS Nomadic go out of business?', 'SS "Nomadic" was a steamship of the White Star Line. She was laid down in 1891, in yard 236 at Harland and Wolff Shipyards, Belfast, as a livestock carrier and completed on 14 April 1891.\n\nIn ancient times, Antrim was inhabited by a Celtic people called the Darini. In the early Middle Ages, southern County Antrim was part of the Kingdom of Ulidia, ruled by the Dál Fiatach clans Keenan and MacDonlevy/McDunlavey; the north was part of Dál Riada, which stretched into what is now western Scotland over the Irish Sea. Dál Riada was ruled by the O\'Lynch clan, who were vassals of the Ulidians. Besides the Ulidians and Dál Riada, there were the Dál nAraide of lower County Antrim, and the Cruthin, who were pre-Gaelic Celts and probably related to the Picts of Britain. Between the 8th and 11th centuries Antrim was exposed to the inroads of the Vikings.\n\nWhite Star Line Former type Partnership Industry Shipping, transportation Fate merged with Cunard Line Successor Cunard White Star Line Founded 1845 (1845) in Liverpool, England Defunct 1934 Area served Transatlantic Parent Ismay, Imrie and Co. Website www.cunard.co.uk'],
    ['Who founded the college Lawrence Humphrey attended?', "Lawrence Humphrey (or Laurence Humfrey) DD (1527? – 1 February 1590) was an English theologian, who was President of Magdalen College, Oxford, and Dean successively of Gloucester and Winchester.\n\nProminent theatre companies in Oklahoma include, in the capital city, Oklahoma City Theatre Company, Carpenter Square Theatre, Oklahoma Shakespeare in the Park, and CityRep. CityRep is a professional company affording equity points to those performers and technical theatre professionals. In Tulsa, Oklahoma's oldest resident professional company is American Theatre Company, and Theatre Tulsa is the oldest community theatre company west of the Mississippi. Other companies in Tulsa include Heller Theatre and Tulsa Spotlight Theater. The cities of Norman, Lawton, and Stillwater, among others, also host well-reviewed community theatre companies.\n\nHe was President of Magdalen College, Oxford, from 1480 to 1507; previously he had been a Fellow of New College, Oxford, and was brought in by William Waynflete. He was Vice-Chancellor of the University of Oxford in 1484–5, and Chancellor of the University of Oxford in 1502."],
    ['What was the new record label of the performer of Fame (The Game)?', "In Europe and Australia, the system was released to two separate marketing regions. One region consisted of most of mainland Europe (excluding Italy), and distribution there was handled by a number of different companies, with Nintendo responsible for most cartridge releases. Most of this region saw a 1986 release. Mattel handled distribution for the other region, consisting of the United Kingdom, Ireland, Canada, Italy, Australia and New Zealand, starting the following year. Not until the 1990s did Nintendo's newly created European branch direct distribution throughout Europe.\n\nBoeing 747 Boeing 747 - 100 of Pan American World Airways, the 747's launch customer, in September 1978 Role Wide - body jet airliner National origin United States Manufacturer Boeing Commercial Airplanes First flight February 9, 1969 Introduction January 22, 1970 with Pan American World Airways Status In service Primary users British Airways Lufthansa Korean Air Atlas Air Produced 1968 -- present Number built 1,544 as of April 2018 Program cost US $1 billion at roll - out (1968) 7.0 billion today Unit cost 747 - 100: US $24 million (1972) 747 - 200: US $39 million (1976) 747 - 300: US $83 million (1982) Variants Boeing 747SP Boeing 747 - 400 Boeing 747 - 8 Boeing VC - 25 Boeing E-4 Developed into Boeing YAL - 1 Boeing Dreamlifter\n\nThe Drinkard Singers were an American gospel singing group, most successful in the late 1950s and important in the careers of singers Cissy Houston, Dionne Warwick, Dee Dee Warwick, and Judy Clay."],
    ['When was the publisher of Crux launched?', 'Sleep Dank, also known as Sleep Da Danker or Sleepdank, is an American rapper signed to the late Mac Dre\'s label Thizz Entertainment.\n\nStrasbourg, well known as centre of humanism, has a long history of excellence in higher-education, at the crossroads of French and German intellectual traditions. Although Strasbourg had been annexed by the Kingdom of France in 1683, it still remained connected to the German-speaking intellectual world throughout the 18th century and the university attracted numerous students from the Holy Roman Empire, including Goethe, Metternich and Montgelas, who studied law in Strasbourg, among the most prominent. Nowadays, Strasbourg is known to offer among the best university courses in France, after Paris.\n\nGrinspoon is an Australian rock band from Lismore, New South Wales formed in 1995 and fronted by Phil Jamieson on vocals and guitar with Pat Davern on guitar, Joe Hansen on bass guitar and Kristian Hopes on drums. Also in 1995, they won the Triple J-sponsored Unearthed competition for Lismore, with their post-grunge song "Sickfest". Their name was taken from Dr. Lester Grinspoon an Associate Professor Emeritus of Psychiatry at Harvard Medical School, who supports marijuana for medical use.'],
    ['In what ways did Kanye draw inspiration from U2, Led Zeppelin, and the performer of Coming Down Again?', 'Titus Lucretius Tricipitinus was a politician and military leader in the early days of the Roman Republic. Twice, in the years 508 and 504 BC, he was elected Roman Consul, alongside Publius Valerius Poplicola. Also a military leader, he was victorious against Lars Porsena during his first consulate. According to Livy, he led the Roman army together with Valerius against the Sabines in 504 BC and both consuls were awarded the honour of a triumph, however the Fasti Triumphales only mention the triumph of Valerius, in May 504 BC.\n\nFresh off spending the previous year touring the world with U2 on their Vertigo Tour, West felt inspired to compose anthemic rap songs that could operate more efficiently in large arenas. To this end, West incorporated the synthesizer into his hip-hop production, utilized slower tempos, and experimented with electronic music and influenced by music of the 1980s. In addition to U2, West drew musical inspiration from arena rock bands such as The Rolling Stones and Led Zeppelin in terms of melody and chord progression. To make his next effort, the third in a planned tetralogy of education-themed studio albums, more introspective and personal in lyricism, West listened to folk and country singer-songwriters Bob Dylan and Johnny Cash in hopes of developing methods to augment his wordplay and storytelling ability.\n\n"Coming Down Again" is a song by the Rolling Stones featured on their 1973 album "Goats Head Soup". It is sung as a duet by Keith Richards and Mick Jagger.'],
]
scores = model.predict(pairs)
print(scores.shape)
# (5,)

# Or rank different texts based on similarity to a single text
ranks = model.rank(
    'When did the operator of SS Nomadic go out of business?',
    [
        'SS "Nomadic" was a steamship of the White Star Line. She was laid down in 1891, in yard 236 at Harland and Wolff Shipyards, Belfast, as a livestock carrier and completed on 14 April 1891.\n\nIn ancient times, Antrim was inhabited by a Celtic people called the Darini. In the early Middle Ages, southern County Antrim was part of the Kingdom of Ulidia, ruled by the Dál Fiatach clans Keenan and MacDonlevy/McDunlavey; the north was part of Dál Riada, which stretched into what is now western Scotland over the Irish Sea. Dál Riada was ruled by the O\'Lynch clan, who were vassals of the Ulidians. Besides the Ulidians and Dál Riada, there were the Dál nAraide of lower County Antrim, and the Cruthin, who were pre-Gaelic Celts and probably related to the Picts of Britain. Between the 8th and 11th centuries Antrim was exposed to the inroads of the Vikings.\n\nWhite Star Line Former type Partnership Industry Shipping, transportation Fate merged with Cunard Line Successor Cunard White Star Line Founded 1845 (1845) in Liverpool, England Defunct 1934 Area served Transatlantic Parent Ismay, Imrie and Co. Website www.cunard.co.uk',
        "Lawrence Humphrey (or Laurence Humfrey) DD (1527? – 1 February 1590) was an English theologian, who was President of Magdalen College, Oxford, and Dean successively of Gloucester and Winchester.\n\nProminent theatre companies in Oklahoma include, in the capital city, Oklahoma City Theatre Company, Carpenter Square Theatre, Oklahoma Shakespeare in the Park, and CityRep. CityRep is a professional company affording equity points to those performers and technical theatre professionals. In Tulsa, Oklahoma's oldest resident professional company is American Theatre Company, and Theatre Tulsa is the oldest community theatre company west of the Mississippi. Other companies in Tulsa include Heller Theatre and Tulsa Spotlight Theater. The cities of Norman, Lawton, and Stillwater, among others, also host well-reviewed community theatre companies.\n\nHe was President of Magdalen College, Oxford, from 1480 to 1507; previously he had been a Fellow of New College, Oxford, and was brought in by William Waynflete. He was Vice-Chancellor of the University of Oxford in 1484–5, and Chancellor of the University of Oxford in 1502.",
        "In Europe and Australia, the system was released to two separate marketing regions. One region consisted of most of mainland Europe (excluding Italy), and distribution there was handled by a number of different companies, with Nintendo responsible for most cartridge releases. Most of this region saw a 1986 release. Mattel handled distribution for the other region, consisting of the United Kingdom, Ireland, Canada, Italy, Australia and New Zealand, starting the following year. Not until the 1990s did Nintendo's newly created European branch direct distribution throughout Europe.\n\nBoeing 747 Boeing 747 - 100 of Pan American World Airways, the 747's launch customer, in September 1978 Role Wide - body jet airliner National origin United States Manufacturer Boeing Commercial Airplanes First flight February 9, 1969 Introduction January 22, 1970 with Pan American World Airways Status In service Primary users British Airways Lufthansa Korean Air Atlas Air Produced 1968 -- present Number built 1,544 as of April 2018 Program cost US $1 billion at roll - out (1968) 7.0 billion today Unit cost 747 - 100: US $24 million (1972) 747 - 200: US $39 million (1976) 747 - 300: US $83 million (1982) Variants Boeing 747SP Boeing 747 - 400 Boeing 747 - 8 Boeing VC - 25 Boeing E-4 Developed into Boeing YAL - 1 Boeing Dreamlifter\n\nThe Drinkard Singers were an American gospel singing group, most successful in the late 1950s and important in the careers of singers Cissy Houston, Dionne Warwick, Dee Dee Warwick, and Judy Clay.",
        'Sleep Dank, also known as Sleep Da Danker or Sleepdank, is an American rapper signed to the late Mac Dre\'s label Thizz Entertainment.\n\nStrasbourg, well known as centre of humanism, has a long history of excellence in higher-education, at the crossroads of French and German intellectual traditions. Although Strasbourg had been annexed by the Kingdom of France in 1683, it still remained connected to the German-speaking intellectual world throughout the 18th century and the university attracted numerous students from the Holy Roman Empire, including Goethe, Metternich and Montgelas, who studied law in Strasbourg, among the most prominent. Nowadays, Strasbourg is known to offer among the best university courses in France, after Paris.\n\nGrinspoon is an Australian rock band from Lismore, New South Wales formed in 1995 and fronted by Phil Jamieson on vocals and guitar with Pat Davern on guitar, Joe Hansen on bass guitar and Kristian Hopes on drums. Also in 1995, they won the Triple J-sponsored Unearthed competition for Lismore, with their post-grunge song "Sickfest". Their name was taken from Dr. Lester Grinspoon an Associate Professor Emeritus of Psychiatry at Harvard Medical School, who supports marijuana for medical use.',
        'Titus Lucretius Tricipitinus was a politician and military leader in the early days of the Roman Republic. Twice, in the years 508 and 504 BC, he was elected Roman Consul, alongside Publius Valerius Poplicola. Also a military leader, he was victorious against Lars Porsena during his first consulate. According to Livy, he led the Roman army together with Valerius against the Sabines in 504 BC and both consuls were awarded the honour of a triumph, however the Fasti Triumphales only mention the triumph of Valerius, in May 504 BC.\n\nFresh off spending the previous year touring the world with U2 on their Vertigo Tour, West felt inspired to compose anthemic rap songs that could operate more efficiently in large arenas. To this end, West incorporated the synthesizer into his hip-hop production, utilized slower tempos, and experimented with electronic music and influenced by music of the 1980s. In addition to U2, West drew musical inspiration from arena rock bands such as The Rolling Stones and Led Zeppelin in terms of melody and chord progression. To make his next effort, the third in a planned tetralogy of education-themed studio albums, more introspective and personal in lyricism, West listened to folk and country singer-songwriters Bob Dylan and Johnny Cash in hopes of developing methods to augment his wordplay and storytelling ability.\n\n"Coming Down Again" is a song by the Rolling Stones featured on their 1973 album "Goats Head Soup". It is sung as a duet by Keith Richards and Mick Jagger.',
    ]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]

Evaluation

Metrics

Cross Encoder Correlation

Metric Value
pearson 0.8782
spearman 0.8642

Training Details

Training Dataset

Unnamed Dataset

  • Size: 9,383 training samples
  • Columns: sentence_0, sentence_1, and label
  • Approximate statistics based on the first 1000 samples:
    sentence_0 sentence_1 label
    type string string float
    details
    • min: 31 characters
    • mean: 78.86 characters
    • max: 168 characters
    • min: 428 characters
    • mean: 1667.98 characters
    • max: 4032 characters
    • min: 0.0
    • mean: 0.49
    • max: 1.0
  • Samples:
    sentence_0 sentence_1 label
    When did the operator of SS Nomadic go out of business? SS "Nomadic" was a steamship of the White Star Line. She was laid down in 1891, in yard 236 at Harland and Wolff Shipyards, Belfast, as a livestock carrier and completed on 14 April 1891.

    In ancient times, Antrim was inhabited by a Celtic people called the Darini. In the early Middle Ages, southern County Antrim was part of the Kingdom of Ulidia, ruled by the Dál Fiatach clans Keenan and MacDonlevy/McDunlavey; the north was part of Dál Riada, which stretched into what is now western Scotland over the Irish Sea. Dál Riada was ruled by the O'Lynch clan, who were vassals of the Ulidians. Besides the Ulidians and Dál Riada, there were the Dál nAraide of lower County Antrim, and the Cruthin, who were pre-Gaelic Celts and probably related to the Picts of Britain. Between the 8th and 11th centuries Antrim was exposed to the inroads of the Vikings.

    White Star Line Former type Partnership Industry Shipping, transportation Fate merged with Cunard Line Successor Cunard White Star Line Founded 1...
    1.0
    Who founded the college Lawrence Humphrey attended? Lawrence Humphrey (or Laurence Humfrey) DD (1527? – 1 February 1590) was an English theologian, who was President of Magdalen College, Oxford, and Dean successively of Gloucester and Winchester.

    Prominent theatre companies in Oklahoma include, in the capital city, Oklahoma City Theatre Company, Carpenter Square Theatre, Oklahoma Shakespeare in the Park, and CityRep. CityRep is a professional company affording equity points to those performers and technical theatre professionals. In Tulsa, Oklahoma's oldest resident professional company is American Theatre Company, and Theatre Tulsa is the oldest community theatre company west of the Mississippi. Other companies in Tulsa include Heller Theatre and Tulsa Spotlight Theater. The cities of Norman, Lawton, and Stillwater, among others, also host well-reviewed community theatre companies.

    He was President of Magdalen College, Oxford, from 1480 to 1507; previously he had been a Fellow of New College, Oxford, and was brought in by William Way...
    1.0
    What was the new record label of the performer of Fame (The Game)? In Europe and Australia, the system was released to two separate marketing regions. One region consisted of most of mainland Europe (excluding Italy), and distribution there was handled by a number of different companies, with Nintendo responsible for most cartridge releases. Most of this region saw a 1986 release. Mattel handled distribution for the other region, consisting of the United Kingdom, Ireland, Canada, Italy, Australia and New Zealand, starting the following year. Not until the 1990s did Nintendo's newly created European branch direct distribution throughout Europe.

    Boeing 747 Boeing 747 - 100 of Pan American World Airways, the 747's launch customer, in September 1978 Role Wide - body jet airliner National origin United States Manufacturer Boeing Commercial Airplanes First flight February 9, 1969 Introduction January 22, 1970 with Pan American World Airways Status In service Primary users British Airways Lufthansa Korean Air Atlas Air Produced 1968 -- present Number built ...
    0.0
  • Loss: BinaryCrossEntropyLoss with these parameters:
    {
        "activation_fn": "torch.nn.modules.linear.Identity",
        "pos_weight": null
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 4
  • per_device_eval_batch_size: 4
  • num_train_epochs: 1

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: steps
  • prediction_loss_only: True
  • per_device_train_batch_size: 4
  • per_device_eval_batch_size: 4
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 5e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1
  • num_train_epochs: 1
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.0
  • warmup_steps: 0
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • save_safetensors: True
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • no_cuda: False
  • use_cpu: False
  • use_mps_device: False
  • seed: 42
  • data_seed: None
  • jit_mode_eval: False
  • bf16: False
  • fp16: False
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • local_rank: 0
  • ddp_backend: None
  • tpu_num_cores: None
  • tpu_metrics_debug: False
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • past_index: -1
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_min_num_params: 0
  • fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
  • parallelism_config: None
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch_fused
  • optim_args: None
  • adafactor: False
  • group_by_length: False
  • length_column_name: length
  • project: huggingface
  • trackio_space_id: trackio
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • skip_memory_metrics: True
  • use_legacy_prediction_loop: False
  • push_to_hub: False
  • resume_from_checkpoint: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_private_repo: None
  • hub_always_push: False
  • hub_revision: None
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • include_for_metrics: []
  • eval_do_concat_batches: True
  • fp16_backend: auto
  • push_to_hub_model_id: None
  • push_to_hub_organization: None
  • mp_parameters:
  • auto_find_batch_size: False
  • full_determinism: False
  • torchdynamo: None
  • ray_scope: last
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: no
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • eval_on_start: False
  • use_liger_kernel: False
  • liger_kernel_config: None
  • eval_use_gather_object: False
  • average_tokens_across_devices: True
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: proportional
  • router_mapping: {}
  • learning_rate_mapping: {}

Training Logs

Epoch Step Training Loss explorer-validation_spearman
0.2131 500 0.5622 0.8333
0.4263 1000 0.4409 0.8522
0.6394 1500 0.3972 0.8593
0.8525 2000 0.3861 0.8642

Framework Versions

  • Python: 3.12.11
  • Sentence Transformers: 5.2.0
  • Transformers: 4.57.3
  • PyTorch: 2.9.1+cu128
  • Accelerate: 1.12.0
  • Datasets: 4.4.2
  • Tokenizers: 0.22.2

Citation

BibTeX

Sentence Transformers

@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",
}
Downloads last month
1
Safetensors
Model size
0.6B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for OloriBern/checkpoints_musique_BAAI_bge-m3_3ep-bge-m3-2000-mixer-3ep

Base model

BAAI/bge-m3
Finetuned
(429)
this model

Paper for OloriBern/checkpoints_musique_BAAI_bge-m3_3ep-bge-m3-2000-mixer-3ep

Evaluation results