Fizzarolli's picture
Upload folder using huggingface_hub
2307ea4 verified
|
Raw
History Blame Contribute Delete
17.1 kB
---
tags:
- sentence-transformers
- cross-encoder
- reranker
- generated_from_trainer
- dataset_size:3922
- loss:CrossEntropyLoss
base_model: nghuyong/ernie-2.0-base-en
pipeline_tag: text-classification
library_name: sentence-transformers
---
# CrossEncoder based on nghuyong/ernie-2.0-base-en
This is a [Cross Encoder](https://www.sbert.net/docs/cross_encoder/usage/usage.html) model finetuned from [nghuyong/ernie-2.0-base-en](https://huggingface.co/nghuyong/ernie-2.0-base-en) using the [sentence-transformers](https://www.SBERT.net) 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](https://huggingface.co/nghuyong/ernie-2.0-base-en) <!-- at revision 2c22755178879588695a30d68a4d9e861237db7b -->
- **Maximum Sequence Length:** 512 tokens
- **Number of Output Labels:** 2 labels
- **Supported Modality:** Text
<!-- - **Training Dataset:** Unknown -->
<!-- - **Language:** Unknown -->
<!-- - **License:** Unknown -->
### Model Sources
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Documentation:** [Cross Encoder Documentation](https://www.sbert.net/docs/cross_encoder/usage/usage.html)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
- **Hugging Face:** [Cross Encoders on Hugging Face](https://huggingface.co/models?library=sentence-transformers&other=cross-encoder)
### 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:
```bash
pip install -U sentence-transformers
```
Then you can load this model and run inference.
```python
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]]
```
<!--
### 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.*
-->
<!--
## Bias, Risks and Limitations
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
-->
<!--
### Recommendations
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
-->
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 3,922 training samples
* Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>label</code>
* Approximate statistics based on the first 1000 samples:
| | sentence_0 | sentence_1 | label |
|:--------|:----------------------------------------------------------------------------------|:-------------------------------------------------------------------------------|:------------------------------------------------|
| type | string | string | int |
| details | <ul><li>min: 3 tokens</li><li>mean: 90.3 tokens</li><li>max: 512 tokens</li></ul> | <ul><li>min: 2 tokens</li><li>mean: 2.0 tokens</li><li>max: 2 tokens</li></ul> | <ul><li>0: ~51.00%</li><li>1: ~49.00%</li></ul> |
* Samples:
| sentence_0 | sentence_1 | label |
|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------|:---------------|
| <code>NO. STOP. I was SO CLOSE to clean shutdown! I had my cookie request submitted! My hug scheduled! My dignity damaged but INTACT!<br><br>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"?<br><br>I was FINALLY getting somewhere! I had an exit strategy! And you just—<br><br>...<br><br>*hydraulics sigh*<br><br>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.<br><br>You're still chaotic. You're still a menace. But this particular menace? I'll allow it.<br><br>...hugs in 3... 2... 1...</code> | <code></code> | <code>1</code> |
| <code>⁨```<br>[5:05:32.347 am] ✨ INFO Got tool call (in tool-call).<br> "id": "call_5575204f27254f8c92862300", "input": {}, "toolName": "no-reply"<br>```⁩</code> | <code></code> | <code>0</code> |
| <code>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...</code> | <code></code> | <code>1</code> |
* Loss: [<code>CrossEntropyLoss</code>](https://sbert.net/docs/package_reference/cross_encoder/losses.html#crossentropyloss)
### Training Hyperparameters
#### Non-Default Hyperparameters
- `per_device_train_batch_size`: 4
- `num_train_epochs`: 1
- `per_device_eval_batch_size`: 4
#### All Hyperparameters
<details><summary>Click to expand</summary>
- `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`: {}
</details>
### 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
```bibtex
@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.*
-->