---
tags:
- sentence-transformers
- cross-encoder
- reranker
- generated_from_trainer
- dataset_size:5400
- loss:BinaryCrossEntropyLoss
base_model: BAAI/bge-reranker-large
pipeline_tag: text-ranking
library_name: sentence-transformers
metrics:
- map
- mrr@10
- ndcg@10
model-index:
- name: CrossEncoder based on BAAI/bge-reranker-large
results:
- task:
type: cross-encoder-reranking
name: Cross Encoder Reranking
dataset:
name: support rerank eval
type: support-rerank-eval
metrics:
- type: map
value: 0.9087
name: Map
- type: mrr@10
value: 0.9087
name: Mrr@10
- type: ndcg@10
value: 0.9315
name: Ndcg@10
---
# CrossEncoder based on BAAI/bge-reranker-large
This is a [Cross Encoder](https://www.sbert.net/docs/cross_encoder/usage/usage.html) model finetuned from [BAAI/bge-reranker-large](https://huggingface.co/BAAI/bge-reranker-large) using the [sentence-transformers](https://www.SBERT.net) 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-large](https://huggingface.co/BAAI/bge-reranker-large)
- **Maximum Sequence Length:** 512 tokens
- **Number of Output Labels:** 1 label
### 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)
## 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 texts
pairs = [
['Hi, is there a way to show an image once the personalization toggle is on?', "Hi there, This is Hazel from Tepo Support team. I hope your day is going great! Yes, you can ultilize our conditional settings to show an image based on the toggle's selection, as demonstrated on our demo product [here](https://tepo.app/products/conditional-logic) <3 For step-by-step instructions on how to set up conditional settings on your end, please check out our [guide](https://support.tepo.app/en/article/set-up-conditional-logic-1sp9tac/). If you prefer watching than reading, feel free to take a look at our tutorial video [here](https://www.youtube.com/watch?v=7voAaJ2lzkc)"],
['Hi, is there a way to show an image once the personalization toggle is on?', "Hello there, I apologize for getting back to you a bit later, as we've been away during non-working hours. I hope your weekend went great! For your information, we have a feature to change the product image based on the option's selection. I have enabled this feature for your store, so feel free to follow our step-by-step instructions [here](https://support.tepo.app/en/article/change-product-images-based-on-selected-options-1831rew/) to set up this feature for your store. Please let me know if you encounter any difficulties. I am more than happy to help!"],
['Hi, is there a way to show an image once the personalization toggle is on?', "Hello, Thank you for contacting Tepo Support team! I hope you're having a wonderful day! To enlarge the size of the image swatches, you can refer to our guide [here](https://support.tepo.app/en/article/customize-style-for-app-options-using-css-26kmin/) for step-by-step instructions. This will allow you to make the necessary adjustments on your end. Feel free to give it a try, and if you encounter any difficulties or if coding isn't your forte, please don't hesitate to share the product URL with me. I'll be more than happy to assist further!"],
['Hi, is there a way to show an image once the personalization toggle is on?', 'Good day~ This is Robin from Tepo Support team! I hope your day has been amazing so far! To make sure I’m on the same page, when you say getting the older version of the option set, are you referring to undoing some changes after you’ve already hit save? If I’ve misunderstood anything, please don’t hesitate to correct me. I want to make sure I assist you as best as I can!'],
['Hi, is there a way to show an image once the personalization toggle is on?', "> Hello there, > This is Hazel from Tepo Support team. I hope your day is going great! > Thanks for sharing your concern with us. Regarding the packing slip, we do have a step-by-step instruction [here](https://support.tepo.app/en/article/how-to-show-options-in-shopify-packing-slip-1dyay7y/) that you can follow more easily on your end. Feel free to give it a try on your end to show Tepo options in your packing slip In Shopify, a courier slip is also known as a packing slip. I've seen that Hazel has sent you the instruction to add the code into the packing slip template to show the TEPO options already. May I ask if you give it a try on your end yet?"],
]
scores = model.predict(pairs)
print(scores.shape)
# (5,)
# Or rank different texts based on similarity to a single text
ranks = model.rank(
'Hi, is there a way to show an image once the personalization toggle is on?',
[
"Hi there, This is Hazel from Tepo Support team. I hope your day is going great! Yes, you can ultilize our conditional settings to show an image based on the toggle's selection, as demonstrated on our demo product [here](https://tepo.app/products/conditional-logic) <3 For step-by-step instructions on how to set up conditional settings on your end, please check out our [guide](https://support.tepo.app/en/article/set-up-conditional-logic-1sp9tac/). If you prefer watching than reading, feel free to take a look at our tutorial video [here](https://www.youtube.com/watch?v=7voAaJ2lzkc)",
"Hello there, I apologize for getting back to you a bit later, as we've been away during non-working hours. I hope your weekend went great! For your information, we have a feature to change the product image based on the option's selection. I have enabled this feature for your store, so feel free to follow our step-by-step instructions [here](https://support.tepo.app/en/article/change-product-images-based-on-selected-options-1831rew/) to set up this feature for your store. Please let me know if you encounter any difficulties. I am more than happy to help!",
"Hello, Thank you for contacting Tepo Support team! I hope you're having a wonderful day! To enlarge the size of the image swatches, you can refer to our guide [here](https://support.tepo.app/en/article/customize-style-for-app-options-using-css-26kmin/) for step-by-step instructions. This will allow you to make the necessary adjustments on your end. Feel free to give it a try, and if you encounter any difficulties or if coding isn't your forte, please don't hesitate to share the product URL with me. I'll be more than happy to assist further!",
'Good day~ This is Robin from Tepo Support team! I hope your day has been amazing so far! To make sure I’m on the same page, when you say getting the older version of the option set, are you referring to undoing some changes after you’ve already hit save? If I’ve misunderstood anything, please don’t hesitate to correct me. I want to make sure I assist you as best as I can!',
"> Hello there, > This is Hazel from Tepo Support team. I hope your day is going great! > Thanks for sharing your concern with us. Regarding the packing slip, we do have a step-by-step instruction [here](https://support.tepo.app/en/article/how-to-show-options-in-shopify-packing-slip-1dyay7y/) that you can follow more easily on your end. Feel free to give it a try on your end to show Tepo options in your packing slip In Shopify, a courier slip is also known as a packing slip. I've seen that Hazel has sent you the instruction to add the code into the packing slip template to show the TEPO options already. May I ask if you give it a try on your end yet?",
]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
```
## Evaluation
### Metrics
#### Cross Encoder Reranking
* Dataset: `support-rerank-eval`
* Evaluated with [CrossEncoderRerankingEvaluator](https://sbert.net/docs/package_reference/cross_encoder/evaluation.html#sentence_transformers.cross_encoder.evaluation.CrossEncoderRerankingEvaluator) with these parameters:
```json
{
"at_k": 10,
"always_rerank_positives": false
}
```
| Metric | Value |
|:------------|:---------------------|
| map | 0.9087 (-0.0913) |
| mrr@10 | 0.9087 (-0.0913) |
| **ndcg@10** | **0.9315 (-0.0685)** |
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 5,400 training samples
* Columns: sentence1, sentence2, and label
* Approximate statistics based on the first 1000 samples:
| | sentence1 | sentence2 | label |
|:--------|:--------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------|:---------------------------------------------------------------|
| type | string | string | float |
| details |
Hi, is there a way to show an image once the personalization toggle is on? | Hi there, This is Hazel from Tepo Support team. I hope your day is going great! Yes, you can ultilize our conditional settings to show an image based on the toggle's selection, as demonstrated on our demo product [here](https://tepo.app/products/conditional-logic) <3 For step-by-step instructions on how to set up conditional settings on your end, please check out our [guide](https://support.tepo.app/en/article/set-up-conditional-logic-1sp9tac/). If you prefer watching than reading, feel free to take a look at our tutorial video [here](https://www.youtube.com/watch?v=7voAaJ2lzkc) | 1.0 |
| Hi, is there a way to show an image once the personalization toggle is on? | Hello there, I apologize for getting back to you a bit later, as we've been away during non-working hours. I hope your weekend went great! For your information, we have a feature to change the product image based on the option's selection. I have enabled this feature for your store, so feel free to follow our step-by-step instructions [here](https://support.tepo.app/en/article/change-product-images-based-on-selected-options-1831rew/) to set up this feature for your store. Please let me know if you encounter any difficulties. I am more than happy to help! | 0.0 |
| Hi, is there a way to show an image once the personalization toggle is on? | Hello, Thank you for contacting Tepo Support team! I hope you're having a wonderful day! To enlarge the size of the image swatches, you can refer to our guide [here](https://support.tepo.app/en/article/customize-style-for-app-options-using-css-26kmin/) for step-by-step instructions. This will allow you to make the necessary adjustments on your end. Feel free to give it a try, and if you encounter any difficulties or if coding isn't your forte, please don't hesitate to share the product URL with me. I'll be more than happy to assist further! | 0.0 |
* Loss: [BinaryCrossEntropyLoss](https://sbert.net/docs/package_reference/cross_encoder/losses.html#binarycrossentropyloss) with these parameters:
```json
{
"activation_fn": "torch.nn.modules.linear.Identity",
"pos_weight": 5
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: steps
- `per_device_train_batch_size`: 1
- `gradient_accumulation_steps`: 32
- `learning_rate`: 1e-05
- `num_train_epochs`: 5
- `warmup_ratio`: 0.2
- `warmup_steps`: 0.2
- `seed`: 67
- `fp16`: True
- `load_best_model_at_end`: True
#### All Hyperparameters