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: 8192 tokens
- Number of Output Labels: 1 label
- Supported Modality: Text
Model Sources
- Documentation: Sentence Transformers Documentation
- Documentation: Cross Encoder Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Cross Encoders on Hugging Face
Full Model Architecture
CrossEncoder(
(0): Transformer({'transformer_task': 'sequence-classification', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'logits'}}, 'module_output_name': 'scores', 'architecture': 'XLMRobertaForSequenceClassification'})
)
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("pameydorke/arcanumchat-reranker-bge-reranker-v2-m3")
# Get scores for pairs of inputs
pairs = [
['spell like dominate will but stronger', "Elixir of Hypnotic Suggestion. Elixir of Hypnotic Suggestion. The Elixir of Hypnotic Suggestion Schematic can be found in the Closed Sewers of Tarant (northwest corner). Expertise. Requires an expertise of 56 in Therapeutics Requires an expertise of 85 in Chemistry. Ingredients. Elixir\xa0of Persuasion\xa0+\xa0Hallucinite Elixir\xa0of Persuasion is the first degree in Therapeutics Hallucinite is the fifth degree in Chemistry. Effects. One unit can be obtained per unit of both components The target falls under the player's control as a temporary follower The follower has slave dialogue The effect last for about one hour The target will become hostile when the effect wears off. Used as an ingredient for:. None. Notes. The device is similar to the Dominate Will Spell except that it cannot be resisted. Item Page"],
['spell like dominate will but stronger', 'Character background. Night Mage. Character background. Night Mage. Available to all except dwarves. You were born with a magickal aptitude that has affinity for the night. At night (between the hours of 6 PM and 6 AM), you possess a 20% bonus to your Magickal Aptitude, but during the day you suffer a 20% penalty to your Magickal Aptitude.'],
['spell like dominate will but stronger', 'Spell Colleges. Morph. Spell Colleges. Morph. Hardened Hands Minimum requirements: Level 1, WP 6 Energy: 5 (1/10 seconds) Stackable: No This spell makes the target creature do +2 more melee damage regardless of Aptitude when the weapon slot is empty. Weaken Minimum requirements: Level 1, WP 9 Energy: 15 (2/10 seconds) Stackable: No Resisted by: Constitution -5 This spell weakens the substance of the target by reducing its Strength and damage resistance for the duration of the spell. Shrink Minimum requirements: Level 5, WP 12 Energy: 20 (2/10 seconds) Stackable: No Resisted by: Constitution -5 This spell reduces a creature to half its size. Flesh to Stone Minimum requirements: Level 10, WP 15 Energy: 20 Resisted by: Constitution -5 This spell converts the target to stone temporarily. The target is paralyzed and cannot be physically damaged. Polymorph Minimum requirements: Level 15, WP 18 Energy: 30 (5/10 seconds) Resisted by: Constitution -5 This spell transforms the target creature into a sheep for as long as the spell is maintained.'],
['spell like dominate will but stronger', 'Character background. Sold Your Soul. Character background. Sold Your Soul. Available to all. You have made a pact with a demon. In exchange for more magickal power, you have dedicated your life to the pursuit of evil. You gain 20% to Magickal Aptitude, but suffer -20 reaction from others and a -20 alignment (and your alignment can NEVER go higher). MA +20 / Reaction -20 / Alignment -20 / Alignment max -20'],
['spell like dominate will but stronger', 'IN. IN. The Statistic of Intelligence (abbreviated as "IN") is the overall mental accumulation and coordination of a character. It affects the following:. Affected Skills. Gambling Heal Repair. Derived Statistics. None. Uses. General. The Bonus for reaching an Intelligence of 20 is +10% to the success rate of every skill. Magick. An Intelligence of 5 or greater is needed to cast Spells or use Scrolls The number of Spell Slots active (concurrent) Spells is 1 Spell per 4 points of IN (rounded DOWN). Technology. The Intelligence needed for each degree in a Technological Disciplines is as seen in the table:. Degree Level L1 L2 L3 L4 L5 L6 L7 Intelligence 5 8 11 13 15 17 19. Dialogue. An Intelligence of less than 5 (and some Character backgrounds) will result in Dumb Dialogue An intelligence of 5 results in at least basic dialogue An intelligence of 9 will allow to ask Thorvald Two Stones to consider giving his spectacles An Intelligence of 10 and above gives additional options as follows: Ashbury: Quest for the Town Hall Meeting IN 10: Failure, IN 11-14: Ok, IN 15: Excellent Wheel Clan IN 10: Discussions about the "Stone and Shape" with various residents Stillwater IN 10 (and PS 8): Discussion with Marley regarding the return of the Stolen Idol Qintarra IN 13 (and PS 8): Extra dialogue with Ivory regarding the Death of Wrath IN 11, 12, 14: Extra game lore dialogue with student and potential follower Jormund T\'sen-Ang IN 10, 12, 14: Extra game lore dialogue with M\'in Gorad. Bonuses. Items Ring of Dark Magicks: gives +1 (magickal). Blessings None. Races None. Backgrounds Bookworm: gives +1 Agoraphobic: gives +2 (while not in the Open) Mad Doctor: gives +2 Rare Half-Ogre Birth: gives +2 Sheltered Childhood: gives +2 Miracle Operation: gives +3 Idiot Savant: gives +6 (but with Dumb Dialogue) Sickly: gives +6 Barbarian: removes -1 Bully: removes -1 Freed Bodyguard: removes -1 Halfling Orphan: removes -1 Sent to Charm School: removes -1 Afraid of the Dark: removes -2 (in the Dark) Hydrophobic: removes -2 (in Water) Ran Away with the Circus: removes -2 Special Person: removes -2 Super Model: removes -4 Feral Child: removes -6 Raised in the Pits: removes -6. Consumables Vivifier: gives +1 (permanent) Brain Builder: gives +1 (permanent) Mind Marvel: gives +2 (temporary) Revitalizer: gives +2 (temporary) Vendigrothian Elixir: gives +2 (temporary) Essence of Intellect: gives +10 (temporary) Muscle Maker: removes -1 (permanent) Alcoholic Beverages: removes -3 per drink (temporary)'],
]
scores = model.predict(pairs)
print(scores)
# [0.2883 0.0021 0.016 0.0026 0.0036]
# Or rank different texts based on similarity to a single text
ranks = model.rank(
'spell like dominate will but stronger',
[
"Elixir of Hypnotic Suggestion. Elixir of Hypnotic Suggestion. The Elixir of Hypnotic Suggestion Schematic can be found in the Closed Sewers of Tarant (northwest corner). Expertise. Requires an expertise of 56 in Therapeutics Requires an expertise of 85 in Chemistry. Ingredients. Elixir\xa0of Persuasion\xa0+\xa0Hallucinite Elixir\xa0of Persuasion is the first degree in Therapeutics Hallucinite is the fifth degree in Chemistry. Effects. One unit can be obtained per unit of both components The target falls under the player's control as a temporary follower The follower has slave dialogue The effect last for about one hour The target will become hostile when the effect wears off. Used as an ingredient for:. None. Notes. The device is similar to the Dominate Will Spell except that it cannot be resisted. Item Page",
'Character background. Night Mage. Character background. Night Mage. Available to all except dwarves. You were born with a magickal aptitude that has affinity for the night. At night (between the hours of 6 PM and 6 AM), you possess a 20% bonus to your Magickal Aptitude, but during the day you suffer a 20% penalty to your Magickal Aptitude.',
'Spell Colleges. Morph. Spell Colleges. Morph. Hardened Hands Minimum requirements: Level 1, WP 6 Energy: 5 (1/10 seconds) Stackable: No This spell makes the target creature do +2 more melee damage regardless of Aptitude when the weapon slot is empty. Weaken Minimum requirements: Level 1, WP 9 Energy: 15 (2/10 seconds) Stackable: No Resisted by: Constitution -5 This spell weakens the substance of the target by reducing its Strength and damage resistance for the duration of the spell. Shrink Minimum requirements: Level 5, WP 12 Energy: 20 (2/10 seconds) Stackable: No Resisted by: Constitution -5 This spell reduces a creature to half its size. Flesh to Stone Minimum requirements: Level 10, WP 15 Energy: 20 Resisted by: Constitution -5 This spell converts the target to stone temporarily. The target is paralyzed and cannot be physically damaged. Polymorph Minimum requirements: Level 15, WP 18 Energy: 30 (5/10 seconds) Resisted by: Constitution -5 This spell transforms the target creature into a sheep for as long as the spell is maintained.',
'Character background. Sold Your Soul. Character background. Sold Your Soul. Available to all. You have made a pact with a demon. In exchange for more magickal power, you have dedicated your life to the pursuit of evil. You gain 20% to Magickal Aptitude, but suffer -20 reaction from others and a -20 alignment (and your alignment can NEVER go higher). MA +20 / Reaction -20 / Alignment -20 / Alignment max -20',
'IN. IN. The Statistic of Intelligence (abbreviated as "IN") is the overall mental accumulation and coordination of a character. It affects the following:. Affected Skills. Gambling Heal Repair. Derived Statistics. None. Uses. General. The Bonus for reaching an Intelligence of 20 is +10% to the success rate of every skill. Magick. An Intelligence of 5 or greater is needed to cast Spells or use Scrolls The number of Spell Slots active (concurrent) Spells is 1 Spell per 4 points of IN (rounded DOWN). Technology. The Intelligence needed for each degree in a Technological Disciplines is as seen in the table:. Degree Level L1 L2 L3 L4 L5 L6 L7 Intelligence 5 8 11 13 15 17 19. Dialogue. An Intelligence of less than 5 (and some Character backgrounds) will result in Dumb Dialogue An intelligence of 5 results in at least basic dialogue An intelligence of 9 will allow to ask Thorvald Two Stones to consider giving his spectacles An Intelligence of 10 and above gives additional options as follows: Ashbury: Quest for the Town Hall Meeting IN 10: Failure, IN 11-14: Ok, IN 15: Excellent Wheel Clan IN 10: Discussions about the "Stone and Shape" with various residents Stillwater IN 10 (and PS 8): Discussion with Marley regarding the return of the Stolen Idol Qintarra IN 13 (and PS 8): Extra dialogue with Ivory regarding the Death of Wrath IN 11, 12, 14: Extra game lore dialogue with student and potential follower Jormund T\'sen-Ang IN 10, 12, 14: Extra game lore dialogue with M\'in Gorad. Bonuses. Items Ring of Dark Magicks: gives +1 (magickal). Blessings None. Races None. Backgrounds Bookworm: gives +1 Agoraphobic: gives +2 (while not in the Open) Mad Doctor: gives +2 Rare Half-Ogre Birth: gives +2 Sheltered Childhood: gives +2 Miracle Operation: gives +3 Idiot Savant: gives +6 (but with Dumb Dialogue) Sickly: gives +6 Barbarian: removes -1 Bully: removes -1 Freed Bodyguard: removes -1 Halfling Orphan: removes -1 Sent to Charm School: removes -1 Afraid of the Dark: removes -2 (in the Dark) Hydrophobic: removes -2 (in Water) Ran Away with the Circus: removes -2 Special Person: removes -2 Super Model: removes -4 Feral Child: removes -6 Raised in the Pits: removes -6. Consumables Vivifier: gives +1 (permanent) Brain Builder: gives +1 (permanent) Mind Marvel: gives +2 (temporary) Revitalizer: gives +2 (temporary) Vendigrothian Elixir: gives +2 (temporary) Essence of Intellect: gives +10 (temporary) Muscle Maker: removes -1 (permanent) Alcoholic Beverages: removes -3 per drink (temporary)',
]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
Evaluation
Metrics
Cross Encoder Reranking
- Dataset:
val-hard-negatives - Evaluated with CrossEncoderRerankingEvaluator with these parameters:
{ "at_k": 10 }
| Metric | Value |
|---|---|
| map | 0.9794 |
| mrr@10 | 0.9794 |
| ndcg@10 | 0.9847 |
Training Details
Training Dataset
Unnamed Dataset
- Size: 22,771 training samples
- Columns: query, document, and label
- Approximate statistics based on the first 100 samples:
query document label type string string int modality text text details min: 5 tokensmean: 8.04 tokensmax: 12 tokens min: 13 tokensmean: 376.51 tokensmax: 929 tokens 0: ~79.81%1: ~20.19% - Samples:
query document label how to learn spells Spell Colleges. See also. Spell Colleges. See also. Magick - for info about the mechanics of spells, and magick in general Scrolls - for info about single-use consumable items which cast a specific spell when used Tulla - for details about the mage city and instructions on mastering a college of Magick Books - for lore about Magick 1 how to learn spells Spell Colleges. Note. Spell Colleges. Note. Some of the colleges of Magick have extended names in the official Arcanum manual: Meta is referred to as Metaphysical, Morph is referred to as Morphological, Phantasm is referred to as Phantasmagorical. 0 how to learn spells Mastery of the Magickal Arts. Mastery of the Magickal Arts. Transcript. TRUE MYSTICISM AND MASTERY OF THE MAGICKAL ARTS. by Archmage Naomrin Palanar. Before travelling onward through the divergent dimensions, it is my wish to leave behind a reference guide for those whose journey may one day parallel my own. This work is intended for all young beings who seek to live an impassioned interest in the wonder and beauty of the arcane through a devoted and disciplined pursuit of their dreams. Reality as it exists from the truly unbounded perspective is infinitely more than the variously limited dreamscape of any particular living mind. Belief is the most powerful and influential factor in shaping what an individual experiences of reality and is therefore both the source and ultimate focus of our responsibility and personal power. Ability in shaping magick must not be seen merely as a way of accessing more exotic and powerful versions of physical tools and implements with which to achieve cer... 0 - Loss: BinaryCrossEntropyLoss with these parameters:
{ "activation_fn": "torch.nn.modules.linear.Identity", "pos_weight": null }
Evaluation Dataset
Unnamed Dataset
- Size: 2,826 evaluation samples
- Columns: query, document, and label
- Approximate statistics based on the first 100 samples:
query document label type string string int modality text text details min: 6 tokensmean: 9.52 tokensmax: 12 tokens min: 18 tokensmean: 350.83 tokensmax: 999 tokens 0: ~78.85%1: ~21.15% - Samples:
query document label spell like dominate will but stronger Elixir of Hypnotic Suggestion. Elixir of Hypnotic Suggestion. The Elixir of Hypnotic Suggestion Schematic can be found in the Closed Sewers of Tarant (northwest corner). Expertise. Requires an expertise of 56 in Therapeutics Requires an expertise of 85 in Chemistry. Ingredients. Elixir of Persuasion + Hallucinite Elixir of Persuasion is the first degree in Therapeutics Hallucinite is the fifth degree in Chemistry. Effects. One unit can be obtained per unit of both components The target falls under the player's control as a temporary follower The follower has slave dialogue The effect last for about one hour The target will become hostile when the effect wears off. Used as an ingredient for:. None. Notes. The device is similar to the Dominate Will Spell except that it cannot be resisted. Item Page 1 spell like dominate will but stronger Character background. Night Mage. Character background. Night Mage. Available to all except dwarves. You were born with a magickal aptitude that has affinity for the night. At night (between the hours of 6 PM and 6 AM), you possess a 20% bonus to your Magickal Aptitude, but during the day you suffer a 20% penalty to your Magickal Aptitude. 0 spell like dominate will but stronger Spell Colleges. Morph. Spell Colleges. Morph. Hardened Hands Minimum requirements: Level 1, WP 6 Energy: 5 (1/10 seconds) Stackable: No This spell makes the target creature do +2 more melee damage regardless of Aptitude when the weapon slot is empty. Weaken Minimum requirements: Level 1, WP 9 Energy: 15 (2/10 seconds) Stackable: No Resisted by: Constitution -5 This spell weakens the substance of the target by reducing its Strength and damage resistance for the duration of the spell. Shrink Minimum requirements: Level 5, WP 12 Energy: 20 (2/10 seconds) Stackable: No Resisted by: Constitution -5 This spell reduces a creature to half its size. Flesh to Stone Minimum requirements: Level 10, WP 15 Energy: 20 Resisted by: Constitution -5 This spell converts the target to stone temporarily. The target is paralyzed and cannot be physically damaged. Polymorph Minimum requirements: Level 15, WP 18 Energy: 30 (5/10 seconds) Resisted by: Constitution -5 This spell transforms the target creature in... 0 - Loss: BinaryCrossEntropyLoss with these parameters:
{ "activation_fn": "torch.nn.modules.linear.Identity", "pos_weight": null }
Training Hyperparameters
Non-Default Hyperparameters
per_device_train_batch_size: 16num_train_epochs: 1warmup_steps: 0.1gradient_accumulation_steps: 2per_device_eval_batch_size: 16eval_on_start: Trueload_best_model_at_end: True
All Hyperparameters
per_device_train_batch_size: 16num_train_epochs: 1max_steps: -1learning_rate: 5e-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: 2average_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: 16prediction_loss_only: Trueeval_on_start: Trueeval_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: Nonedataloader_multiprocessing_context: Nonedataloader_in_order: Trueremove_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: Nonelocal_rank: -1prompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}warmup_ratio: None
Training Logs
| Epoch | Step | Training Loss | Validation Loss | val-hard-negatives_ndcg@10 |
|---|---|---|---|---|
| 0 | 0 | - | 0.2981 | 0.9665 |
| 0.1404 | 100 | 0.2941 | 0.2135 | 0.9712 |
| 0.2809 | 200 | 0.2597 | 0.2064 | 0.9753 |
| 0.4213 | 300 | 0.2497 | 0.1834 | 0.9809 |
| 0.5618 | 400 | 0.2217 | 0.1946 | 0.9777 |
| 0.7022 | 500 | 0.2246 | 0.1837 | 0.9822 |
| 0.8427 | 600 | 0.205 | 0.1885 | 0.9851 |
| 0.9831 | 700 | 0.2107 | 0.1617 | 0.9847 |
| 1.0 | 712 | - | 0.1609 | 0.9847 |
- The bold row denotes the saved checkpoint.
Training Time
- Training: 1.0 hours
Framework Versions
- Python: 3.13.15
- Sentence Transformers: 6.2.0
- Transformers: 5.20.1
- PyTorch: 2.11.0+cu130
- Accelerate: 1.15.0
- Datasets: 4.8.5
- Tokenizers: 0.23.3
Additional Resources
- Training and Finetuning Reranker Models with Sentence Transformers: the end-to-end guide for training or finetuning Cross Encoder (reranker) models.
- Multimodal Embedding & Reranker Models with Sentence Transformers: use text, image, audio, and video reranker models through the same API.
- Training and Finetuning Multimodal Embedding & Reranker Models with Sentence Transformers: training multimodal Cross Encoders.
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",
}