CrossEncoder based on BAAI/bge-reranker-v2-m3

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.

Model Details

Model Description

  • Model Type: Cross Encoder
  • Base model: BAAI/bge-reranker-v2-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("steerrec/bge-reranker-v2-m3-amazon")
# Get scores for pairs of texts
pairs = [
    ["I want something emotional and heartfelt, but not boring. I don't want another slow, dull show.", 'Civil Love Product description Civil Love Review Every so often you come across a movie you really enjoy. For me, this was it. This film contains everything a good movie needs: a good story, fine acting, direction, and a purpose. The theme of this film is that we are too quick to judge people sometimes and that people can occasionally surprise us. --Edwin L. Carpenter, Dove Foundation Movies & TV Genre for Featured Categories Drama'],
    ["I want something emotional and heartfelt, but not boring. I don't want another slow, dull show.", 'Surprised by Love A young businesswoman tries to convince her uptight parents to accept her boyfriend, but then she falls for an old high-school flame. Stars Hilarie Burton, Paul Campbell, and Tim Conway. IMDb 6.7 1 h 24 min 2015 7+ Drama Cheerful Passionate'],
    ["I want something emotional and heartfelt, but not boring. I don't want another slow, dull show.", 'All I Want for Christmas Tis the season for making dreams true. If everything goes according to plan for one young boy, he just may be sharing this Christmas with a new dad. Ever since her husband died, Sarah Armstrong has divided her time between working at a community center and caring for her nine-year-old son, Jesse. When Jesse wins the All I Want for Christmas contest sponsored by a toy company, his wish comes as no surprise to find a new dad. Just in time for the holidays, All I Want for Christmas is a surprise romantic treat for anyone who believes in the magic of love, friendship, and family. Movies & TV Holidays & Seasonal Christmas'],
    ["I just finished a few really touching movies and shows that left me feeling deeply moved and emotionally invested. I'm now looking for something that keeps that same heartfelt, character-driven vibe but with a bit more depth and complexity. I want to watch something that's a mix of drama and drama, maybe with some drama or drama, but it's hard to say. I'm looking for something that combines the elements of a story, a character, and the setting of the characters. It's like a movie where the plot is driven by the people involved, not just the events. I'm craving something that's not too fast-paced, but still has enough substance to keep me engaged. Maybe something that's a little more complex than your average film, but not so much that it feels overwhelming. I'm also interested in something that's not too dark, but still has some emotional weight. I want to feel connected to the characters and their journeys, even if they're not the most straightforward. I'm in the mood for something that's a bit more than just a movie. I need something that's a bit more intricate, with a strong narrative that's not just about the characters but the world they inhabit. I'm looking for a show that's not just a collection of characters but a full, immersive experience. I'm not sure what exactly I", "The Guardian Action-packed drama that takes you inside the never-before-seen world of the elite Coast Guard Rescue Swimmers. Reeling with grief from a mission gone tragically wrong, a legendary swimmer is given a mission he doesn't want -- training raw recruits. IMDb 6.9 2 h 19 min 2006 X-Ray PG-13 Drama Adventure Compelling Inspiring"],
    ["I just finished a few really touching movies and shows that left me feeling deeply moved and emotionally invested. I'm now looking for something that keeps that same heartfelt, character-driven vibe but with a bit more depth and complexity. I want to watch something that's a mix of drama and drama, maybe with some drama or drama, but it's hard to say. I'm looking for something that combines the elements of a story, a character, and the setting of the characters. It's like a movie where the plot is driven by the people involved, not just the events. I'm craving something that's not too fast-paced, but still has enough substance to keep me engaged. Maybe something that's a little more complex than your average film, but not so much that it feels overwhelming. I'm also interested in something that's not too dark, but still has some emotional weight. I want to feel connected to the characters and their journeys, even if they're not the most straightforward. I'm in the mood for something that's a bit more than just a movie. I need something that's a bit more intricate, with a strong narrative that's not just about the characters but the world they inhabit. I'm looking for a show that's not just a collection of characters but a full, immersive experience. I'm not sure what exactly I", 'Magnolia [VHS] An intriguing and entertaining study in characters going through varying levels of crisis and introspection. This psychological drama leads you in several different directions, weaving and intersecting various subplots and characters, from a brilliant Tom Cruise, as a self-proclaimed pied-piper, to a child forced to go on a TV game show and the pressures he faces from a ruthless father. Movies & TV Genre for Featured Categories Drama'],
]
scores = model.predict(pairs)
print(scores.shape)
# (5,)

# Or rank different texts based on similarity to a single text
ranks = model.rank(
    "I want something emotional and heartfelt, but not boring. I don't want another slow, dull show.",
    [
        'Civil Love Product description Civil Love Review Every so often you come across a movie you really enjoy. For me, this was it. This film contains everything a good movie needs: a good story, fine acting, direction, and a purpose. The theme of this film is that we are too quick to judge people sometimes and that people can occasionally surprise us. --Edwin L. Carpenter, Dove Foundation Movies & TV Genre for Featured Categories Drama',
        'Surprised by Love A young businesswoman tries to convince her uptight parents to accept her boyfriend, but then she falls for an old high-school flame. Stars Hilarie Burton, Paul Campbell, and Tim Conway. IMDb 6.7 1 h 24 min 2015 7+ Drama Cheerful Passionate',
        'All I Want for Christmas Tis the season for making dreams true. If everything goes according to plan for one young boy, he just may be sharing this Christmas with a new dad. Ever since her husband died, Sarah Armstrong has divided her time between working at a community center and caring for her nine-year-old son, Jesse. When Jesse wins the All I Want for Christmas contest sponsored by a toy company, his wish comes as no surprise to find a new dad. Just in time for the holidays, All I Want for Christmas is a surprise romantic treat for anyone who believes in the magic of love, friendship, and family. Movies & TV Holidays & Seasonal Christmas',
        "The Guardian Action-packed drama that takes you inside the never-before-seen world of the elite Coast Guard Rescue Swimmers. Reeling with grief from a mission gone tragically wrong, a legendary swimmer is given a mission he doesn't want -- training raw recruits. IMDb 6.9 2 h 19 min 2006 X-Ray PG-13 Drama Adventure Compelling Inspiring",
        'Magnolia [VHS] An intriguing and entertaining study in characters going through varying levels of crisis and introspection. This psychological drama leads you in several different directions, weaving and intersecting various subplots and characters, from a brilliant Tom Cruise, as a self-proclaimed pied-piper, to a child forced to go on a TV game show and the pressures he faces from a ruthless father. Movies & TV Genre for Featured Categories Drama',
    ]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]

Evaluation

Metrics

Cross Encoder Reranking

Metric amazon_test amazon_val
map 0.8518 0.8329
mrr@10 0.8888 0.8814
ndcg@10 0.9086 0.9007

Training Details

Training Dataset

Unnamed Dataset

  • Size: 320,937 training samples
  • Columns: sentence1, sentence2, and label
  • Approximate statistics based on the first 1000 samples:
    sentence1 sentence2 label
    type string string float
    details
    • min: 78 characters
    • mean: 537.26 characters
    • max: 1341 characters
    • min: 48 characters
    • mean: 1079.61 characters
    • max: 10645 characters
    • min: 0.0
    • mean: 0.33
    • max: 1.0
  • Samples:
    sentence1 sentence2 label
    I want something emotional and heartfelt, but not boring. I don't want another slow, dull show. Civil Love Product description Civil Love Review Every so often you come across a movie you really enjoy. For me, this was it. This film contains everything a good movie needs: a good story, fine acting, direction, and a purpose. The theme of this film is that we are too quick to judge people sometimes and that people can occasionally surprise us. --Edwin L. Carpenter, Dove Foundation Movies & TV Genre for Featured Categories Drama 0.0
    I want something emotional and heartfelt, but not boring. I don't want another slow, dull show. Surprised by Love A young businesswoman tries to convince her uptight parents to accept her boyfriend, but then she falls for an old high-school flame. Stars Hilarie Burton, Paul Campbell, and Tim Conway. IMDb 6.7 1 h 24 min 2015 7+ Drama Cheerful Passionate 0.0
    I want something emotional and heartfelt, but not boring. I don't want another slow, dull show. All I Want for Christmas Tis the season for making dreams true. If everything goes according to plan for one young boy, he just may be sharing this Christmas with a new dad. Ever since her husband died, Sarah Armstrong has divided her time between working at a community center and caring for her nine-year-old son, Jesse. When Jesse wins the All I Want for Christmas contest sponsored by a toy company, his wish comes as no surprise to find a new dad. Just in time for the holidays, All I Want for Christmas is a surprise romantic treat for anyone who believes in the magic of love, friendship, and family. Movies & TV Holidays & Seasonal Christmas 0.0
  • Loss: BinaryCrossEntropyLoss with these parameters:
    {
        "activation_fn": "torch.nn.modules.linear.Identity",
        "pos_weight": null
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: epoch
  • per_device_train_batch_size: 32
  • learning_rate: 0.0001
  • weight_decay: 0.01
  • num_train_epochs: 1
  • lr_scheduler_type: cosine
  • warmup_ratio: 0.05
  • seed: 3407
  • bf16: True

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: epoch
  • prediction_loss_only: True
  • per_device_train_batch_size: 32
  • per_device_eval_batch_size: 8
  • 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: 0.0001
  • weight_decay: 0.01
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1.0
  • num_train_epochs: 1
  • max_steps: -1
  • lr_scheduler_type: cosine
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.05
  • 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: 3407
  • data_seed: None
  • jit_mode_eval: False
  • use_ipex: False
  • bf16: True
  • 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
  • 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: False
  • 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: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: proportional
  • router_mapping: {}
  • learning_rate_mapping: {}

Training Logs

Click to expand
Epoch Step Training Loss amazon_test_ndcg@10 amazon_val_ndcg@10
-1 -1 - 0.6715 -
0.0050 50 1.8011 - -
0.0100 100 0.8447 - -
0.0150 150 0.6551 - -
0.0199 200 0.6045 - -
0.0249 250 0.5639 - -
0.0299 300 0.5355 - -
0.0349 350 0.5021 - -
0.0399 400 0.5279 - -
0.0449 450 0.4843 - -
0.0499 500 0.4735 - -
0.0548 550 0.4647 - -
0.0598 600 0.4738 - -
0.0648 650 0.4657 - -
0.0698 700 0.4873 - -
0.0748 750 0.4611 - -
0.0798 800 0.439 - -
0.0847 850 0.4302 - -
0.0897 900 0.4417 - -
0.0947 950 0.4461 - -
0.0997 1000 0.4277 - -
0.1047 1050 0.4367 - -
0.1097 1100 0.4273 - -
0.1147 1150 0.4104 - -
0.1196 1200 0.4259 - -
0.1246 1250 0.4412 - -
0.1296 1300 0.4075 - -
0.1346 1350 0.4307 - -
0.1396 1400 0.4473 - -
0.1446 1450 0.4502 - -
0.1496 1500 0.4168 - -
0.1545 1550 0.4174 - -
0.1595 1600 0.4229 - -
0.1645 1650 0.4276 - -
0.1695 1700 0.4152 - -
0.1745 1750 0.4236 - -
0.1795 1800 0.3981 - -
0.1844 1850 0.4082 - -
0.1894 1900 0.4261 - -
0.1944 1950 0.3888 - -
0.1994 2000 0.4314 - -
0.2044 2050 0.4254 - -
0.2094 2100 0.4296 - -
0.2144 2150 0.4324 - -
0.2193 2200 0.4074 - -
0.2243 2250 0.4127 - -
0.2293 2300 0.4206 - -
0.2343 2350 0.4078 - -
0.2393 2400 0.4015 - -
0.2443 2450 0.4316 - -
0.2493 2500 0.4067 - -
0.2542 2550 0.4066 - -
0.2592 2600 0.3945 - -
0.2642 2650 0.3927 - -
0.2692 2700 0.4264 - -
0.2742 2750 0.3822 - -
0.2792 2800 0.4176 - -
0.2841 2850 0.4128 - -
0.2891 2900 0.3914 - -
0.2941 2950 0.4091 - -
0.2991 3000 0.3949 - -
0.3041 3050 0.407 - -
0.3091 3100 0.3848 - -
0.3141 3150 0.4007 - -
0.3190 3200 0.4089 - -
0.3240 3250 0.3995 - -
0.3290 3300 0.3811 - -
0.3340 3350 0.3821 - -
0.3390 3400 0.3891 - -
0.3440 3450 0.3952 - -
0.3490 3500 0.4013 - -
0.3539 3550 0.4033 - -
0.3589 3600 0.3738 - -
0.3639 3650 0.3887 - -
0.3689 3700 0.3882 - -
0.3739 3750 0.3929 - -
0.3789 3800 0.3858 - -
0.3838 3850 0.3932 - -
0.3888 3900 0.3953 - -
0.3938 3950 0.393 - -
0.3988 4000 0.3937 - -
0.4038 4050 0.4102 - -
0.4088 4100 0.4216 - -
0.4138 4150 0.3825 - -
0.4187 4200 0.3997 - -
0.4237 4250 0.401 - -
0.4287 4300 0.3984 - -
0.4337 4350 0.4041 - -
0.4387 4400 0.388 - -
0.4437 4450 0.3947 - -
0.4487 4500 0.3988 - -
0.4536 4550 0.3826 - -
0.4586 4600 0.3981 - -
0.4636 4650 0.4018 - -
0.4686 4700 0.3696 - -
0.4736 4750 0.3739 - -
0.4786 4800 0.397 - -
0.4835 4850 0.4046 - -
0.4885 4900 0.3774 - -
0.4935 4950 0.3795 - -
0.4985 5000 0.3897 - -
0.5035 5050 0.3929 - -
0.5085 5100 0.3783 - -
0.5135 5150 0.389 - -
0.5184 5200 0.3832 - -
0.5234 5250 0.3477 - -
0.5284 5300 0.3694 - -
0.5334 5350 0.4011 - -
0.5384 5400 0.3978 - -
0.5434 5450 0.3776 - -
0.5484 5500 0.3939 - -
0.5533 5550 0.3656 - -
0.5583 5600 0.3815 - -
0.5633 5650 0.3664 - -
0.5683 5700 0.4057 - -
0.5733 5750 0.3859 - -
0.5783 5800 0.4032 - -
0.5833 5850 0.3853 - -
0.5882 5900 0.3679 - -
0.5932 5950 0.3748 - -
0.5982 6000 0.3839 - -
0.6032 6050 0.3719 - -
0.6082 6100 0.3626 - -
0.6132 6150 0.3991 - -
0.6181 6200 0.3927 - -
0.6231 6250 0.3923 - -
0.6281 6300 0.3649 - -
0.6331 6350 0.3843 - -
0.6381 6400 0.4072 - -
0.6431 6450 0.3875 - -
0.6481 6500 0.3903 - -
0.6530 6550 0.3658 - -
0.6580 6600 0.3889 - -
0.6630 6650 0.3823 - -
0.6680 6700 0.3789 - -
0.6730 6750 0.3623 - -
0.6780 6800 0.3865 - -
0.6830 6850 0.3809 - -
0.6879 6900 0.3833 - -
0.6929 6950 0.3752 - -
0.6979 7000 0.3834 - -
0.7029 7050 0.3667 - -
0.7079 7100 0.3791 - -
0.7129 7150 0.3689 - -
0.7178 7200 0.3663 - -
0.7228 7250 0.3995 - -
0.7278 7300 0.3696 - -
0.7328 7350 0.3747 - -
0.7378 7400 0.377 - -
0.7428 7450 0.3669 - -
0.7478 7500 0.3865 - -
0.7527 7550 0.3757 - -
0.7577 7600 0.3715 - -
0.7627 7650 0.3699 - -
0.7677 7700 0.363 - -
0.7727 7750 0.3861 - -
0.7777 7800 0.3518 - -
0.7827 7850 0.3801 - -
0.7876 7900 0.3881 - -
0.7926 7950 0.3797 - -
0.7976 8000 0.3788 - -
0.8026 8050 0.3761 - -
0.8076 8100 0.3838 - -
0.8126 8150 0.3664 - -
0.8175 8200 0.3745 - -
0.8225 8250 0.3706 - -
0.8275 8300 0.3771 - -
0.8325 8350 0.3865 - -
0.8375 8400 0.3601 - -
0.8425 8450 0.366 - -
0.8475 8500 0.3651 - -
0.8524 8550 0.366 - -
0.8574 8600 0.3676 - -
0.8624 8650 0.3828 - -
0.8674 8700 0.3374 - -
0.8724 8750 0.3644 - -
0.8774 8800 0.385 - -
0.8824 8850 0.3678 - -
0.8873 8900 0.3754 - -
0.8923 8950 0.3715 - -
0.8973 9000 0.3889 - -
0.9023 9050 0.367 - -
0.9073 9100 0.378 - -
0.9123 9150 0.3773 - -
0.9172 9200 0.388 - -
0.9222 9250 0.3549 - -
0.9272 9300 0.3726 - -
0.9322 9350 0.3787 - -
0.9372 9400 0.3863 - -
0.9422 9450 0.3705 - -
0.9472 9500 0.3643 - -
0.9521 9550 0.4003 - -
0.9571 9600 0.388 - -
0.9621 9650 0.3612 - -
0.9671 9700 0.3664 - -
0.9721 9750 0.3657 - -
0.9771 9800 0.3854 - -
0.9821 9850 0.3544 - -
0.9870 9900 0.3771 - -
0.9920 9950 0.3517 - -
0.9970 10000 0.3659 - -
1.0 10030 - - 0.9007
-1 -1 - 0.9086 -

Framework Versions

  • Python: 3.12.3
  • Sentence Transformers: 5.3.0
  • Transformers: 4.56.2
  • PyTorch: 2.11.0+cu128
  • Accelerate: 1.13.0
  • Datasets: 4.3.0
  • 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
23
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 steerrec/bge-reranker-v2-m3-amazon

Finetuned
(89)
this model

Paper for steerrec/bge-reranker-v2-m3-amazon

Evaluation results