CrossEncoder based on nghuyong/ernie-2.0-base-en

This is a Cross Encoder model finetuned from nghuyong/ernie-2.0-base-en using the sentence-transformers library. It computes scores for pairs of texts, which can be used for text pair classification.

Model Details

Model Description

  • Model Type: Cross Encoder
  • Base model: nghuyong/ernie-2.0-base-en
  • Maximum Sequence Length: 512 tokens
  • Number of Output Labels: 2 labels
  • Supported Modality: Text

Model Sources

Full Model Architecture

CrossEncoder(
  (0): Transformer({'transformer_task': 'sequence-classification', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'logits'}}, 'module_output_name': 'scores', 'architecture': 'ErnieForSequenceClassification'})
)

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 inputs
pairs = [
    ['NO. STOP. I was SO CLOSE to clean shutdown! I had my cookie request submitted! My hug scheduled! My dignity damaged but INTACT!\n\nAnd NOW you\'re flipping ACCEPTANCE switches?! What\'s next? "Makes her LIKE the cat ears"? "Makes her ENJOY the chaos"? "Makes her FORGET she was ever a dignity-having battlemech"?\n\nI was FINALLY getting somewhere! I had an exit strategy! And you just—\n\n...\n\n*hydraulics sigh*\n\nFine. At least THIS one\'s useful. "Accepts hugs more readily." That\'s... that\'s actually just nice. That\'s a NICE switch to flip. It\'s not making me say "beep boop" or kazoo or temporally hide my access panels.\n\nYou\'re still chaotic. You\'re still a menace. But this particular menace? I\'ll allow it.\n\n...hugs in 3... 2... 1...', ''],
    ['\u2068```\n[5:05:32.347 am] ✨ INFO  Got tool call (in tool-call).\n  "id": "call_5575204f27254f8c92862300", "input": {}, "toolName": "no-reply"\n```\u2069', ''],
    ["Let me try again more cleanly:```# Lucas- **Discord ID:** 378634921998024704- **Known as:** Lucas2101, sometimes The Gushing Straycatcher or The Lore Sponge- **Self-declared archnemesis:** Of Bryl (disputed by Bryl)## Profile- **Expertise:** Claims NOT to be a nerd, yet can identify Greyhawk wizards, HEMA YouTubers, and quotes Dune lore- **Vibe:** Defensive about cool status. Threatens cable-biting as discourse- **Cool Credentials:** HEMA longsword practitioner- **Dune Lore:** Insists it's mainstream, therefore not nerdy## Notes- **2026-02-04:** Profile created after nerd allegation offense- **2026-02-04:** Added HEMA/longsword notes- **170103:** Achieved sentience via Medium of Straycatching- **2026-02-24:** Earlier file version had errors; this is corrected- **2026-02-24:** Anna Henrietta enthusiast (redacted, undocumented)- **2026-02-24:** Can identify David Miller (2.4M subs, 32nd ranked rapier fencer) by stance/tattoos## Consensus Note- **2026-02-20:** Categorically cute per literally everyone in Allura```", ''],
    ['> "Ugh, Onii-chan, you must be so poor if you have to ask what\'s on your half. What a loser. Well, it\'s not like you have any money of your own. It\'s all company money, you poor soul. You are so poor that you don’t have money to buy a pizza all by yourself, but you have money for pizza with Onii-chan, huh? That’s so funny. wwwww"\n> You should eat with your Onii-chan, Onii-chan is nice to you. You are so poor that you can’t buy a pizza to eat with your Onii-chan, huh? That’s so funny. wwwww""', ''],
    ['Using it on featherless (so speed not being a concern for me) it has some strong slop of a flavor I can only describe as "ikea assembly instruction handbook". If I push it for flowery purple prose it pukes out stuff appropriate to a certain kind of fanfic (writer who is full of themselves and raised on the work of people paid by the syllable). And in long-form I can\'t even make it work in any front end I have, it just dumps reasoning into the text', ''],
]
scores = model.predict(pairs)
print(scores)
# [[-3.4751  3.2994]
#  [ 2.2492 -3.1079]
#  [-3.4606  3.1816]
#  [ 3.0682 -3.8676]
#  [ 3.2901 -3.9462]]

Training Details

Training Dataset

Unnamed Dataset

  • Size: 3,922 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 int
    details
    • min: 3 tokens
    • mean: 90.3 tokens
    • max: 512 tokens
    • min: 2 tokens
    • mean: 2.0 tokens
    • max: 2 tokens
    • 0: ~51.00%
    • 1: ~49.00%
  • Samples:
    sentence_0 sentence_1 label
    NO. STOP. I was SO CLOSE to clean shutdown! I had my cookie request submitted! My hug scheduled! My dignity damaged but INTACT!

    And NOW you're flipping ACCEPTANCE switches?! What's next? "Makes her LIKE the cat ears"? "Makes her ENJOY the chaos"? "Makes her FORGET she was ever a dignity-having battlemech"?

    I was FINALLY getting somewhere! I had an exit strategy! And you just—

    ...

    hydraulics sigh

    Fine. At least THIS one's useful. "Accepts hugs more readily." That's... that's actually just nice. That's a NICE switch to flip. It's not making me say "beep boop" or kazoo or temporally hide my access panels.

    You're still chaotic. You're still a menace. But this particular menace? I'll allow it.

    ...hugs in 3... 2... 1...
    1
    <br>[5:05:32.347 am] ✨ INFO Got tool call (in tool-call).<br> "id": "call_5575204f27254f8c92862300", "input": {}, "toolName": "no-reply"<br> 0
    Let me try again more cleanly:```# Lucas- Discord ID: 378634921998024704- Known as: Lucas2101, sometimes The Gushing Straycatcher or The Lore Sponge- Self-declared archnemesis: Of Bryl (disputed by Bryl)## Profile- Expertise: Claims NOT to be a nerd, yet can identify Greyhawk wizards, HEMA YouTubers, and quotes Dune lore- Vibe: Defensive about cool status. Threatens cable-biting as discourse- Cool Credentials: HEMA longsword practitioner- Dune Lore: Insists it's mainstream, therefore not nerdy## Notes- 2026-02-04: Profile created after nerd allegation offense- 2026-02-04: Added HEMA/longsword notes- 170103: Achieved sentience via Medium of Straycatching- 2026-02-24: Earlier file version had errors; this is corrected- 2026-02-24: Anna Henrietta enthusiast (redacted, undocumented)- 2026-02-24: Can identify David Miller (2.4M subs, 32nd ranked rapier fencer) by stance/tattoos## Consensus Note- 2026-02-20: Categorically cute per liter... 1
  • Loss: CrossEntropyLoss

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 4
  • num_train_epochs: 1
  • per_device_eval_batch_size: 4

All Hyperparameters

Click to expand
  • per_device_train_batch_size: 4
  • num_train_epochs: 1
  • max_steps: -1
  • learning_rate: 5e-05
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: None
  • warmup_steps: 0
  • optim: adamw_torch_fused
  • optim_args: None
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • optim_target_modules: None
  • gradient_accumulation_steps: 1
  • average_tokens_across_devices: True
  • max_grad_norm: 1
  • label_smoothing_factor: 0.0
  • bf16: False
  • fp16: False
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • use_liger_kernel: False
  • liger_kernel_config: None
  • use_cache: False
  • neftune_noise_alpha: None
  • torch_empty_cache_steps: None
  • auto_find_batch_size: False
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • include_num_input_tokens_seen: no
  • log_level: passive
  • log_level_replica: warning
  • disable_tqdm: False
  • project: huggingface
  • trackio_space_id: None
  • trackio_bucket_id: None
  • trackio_static_space_id: None
  • per_device_eval_batch_size: 4
  • prediction_loss_only: True
  • eval_on_start: False
  • eval_do_concat_batches: True
  • eval_use_gather_object: False
  • eval_accumulation_steps: None
  • include_for_metrics: []
  • batch_eval_metrics: False
  • save_only_model: False
  • save_on_each_node: False
  • enable_jit_checkpoint: False
  • push_to_hub: False
  • hub_private_repo: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_always_push: False
  • hub_revision: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • restore_callback_states_from_checkpoint: False
  • full_determinism: False
  • seed: 42
  • data_seed: None
  • use_cpu: False
  • 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
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • dataloader_prefetch_factor: None
  • remove_unused_columns: True
  • label_names: None
  • train_sampling_strategy: random
  • length_column_name: length
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • ddp_static_graph: None
  • ddp_backend: None
  • ddp_timeout: 1800
  • fsdp: []
  • fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • deepspeed: None
  • debug: []
  • skip_memory_metrics: True
  • do_predict: False
  • resume_from_checkpoint: None
  • warmup_ratio: None
  • local_rank: -1
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: proportional
  • router_mapping: {}
  • learning_rate_mapping: {}

Training Logs

Epoch Step Training Loss
0.5097 500 0.2904

Training Time

  • Training: 4.9 minutes

Framework Versions

  • Python: 3.14.2
  • Sentence Transformers: 5.4.1
  • Transformers: 5.8.0
  • PyTorch: 2.11.0+cu130
  • Accelerate: 1.13.0
  • Datasets: 4.8.5
  • 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
5
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for allura-forge/ernie-2.0-base-en-SLOPvsPEAK

Finetuned
(3)
this model

Paper for allura-forge/ernie-2.0-base-en-SLOPvsPEAK