---
tags:
- sentence-transformers
- cross-encoder
- text-classification
- generated_from_trainer
- dataset_size:2000000
- loss:BinaryCrossEntropyLoss
base_model: microsoft/MiniLM-L12-H384-uncased
pipeline_tag: text-classification
library_name: sentence-transformers
metrics:
- map
- mrr@10
- ndcg@10
co2_eq_emissions:
emissions: 194.67805160025472
energy_consumed: 0.5008413941792291
source: codecarbon
training_type: fine-tuning
on_cloud: false
cpu_model: 13th Gen Intel(R) Core(TM) i7-13700K
ram_total_size: 31.777088165283203
hours_used: 1.403
hardware_used: 1 x NVIDIA GeForce RTX 3090
model-index:
- name: CrossEncoder based on microsoft/MiniLM-L12-H384-uncased
results:
- task:
type: cross-encoder-reranking
name: Cross Encoder Reranking
dataset:
name: train eval
type: train-eval
metrics:
- type: map
value: 0.6511488304623287
name: Map
- type: mrr@10
value: 0.6494007936507935
name: Mrr@10
- type: ndcg@10
value: 0.7082478541686404
name: Ndcg@10
---
# CrossEncoder based on microsoft/MiniLM-L12-H384-uncased
This is a [Cross Encoder](https://www.sbert.net/docs/cross_encoder/usage/usage.html) model finetuned from [microsoft/MiniLM-L12-H384-uncased](https://huggingface.co/microsoft/MiniLM-L12-H384-uncased) using the [sentence-transformers](https://www.SBERT.net) library. It computes scores for pairs of texts, which can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
## Model Details
### Model Description
- **Model Type:** Cross Encoder
- **Base model:** [microsoft/MiniLM-L12-H384-uncased](https://huggingface.co/microsoft/MiniLM-L12-H384-uncased)
- **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/UKPLab/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("sentence_transformers_model_id")
# Get scores for pairs of texts
pairs = [
['how much should i pay for breast implants', 'Implant Fees. The cost of buying the implants themselves will influence the overall costs of the procedure. Silicone implants cost between $1,800 and $2,500 though this may go up to slightly over $3,000.Saline implants will cost anywhere between $1,200 and $1,600.The cost of implants varies due to size and manufacturer though there is usually not much of a difference.Anesthesia Fees. There are various options for your anesthesia and this will have a direct impact on the fee you will be charged.otal Costs of Brest Implants. With all the above factors taken into consideration, the total cost of breast implants generally are somewhere in the range of $5,000 and $15,000. However, it is best for your safety and peace of mind to avoid the lowest-charging surgeons and the ones charging very high fees.'],
['are merrell shoes lifetime warranty', "Best Answer: Regular shoes. If your horse doesn't have bad feet, don't put shoes on him. Shoes actually weaken the hooves due to a lack of circulation and the nail holes (they just make the hooves stronger while the shoes are on, once you take them off the hooves are weaker than they were at first).f your horse doesn't have bad feet, don't put shoes on him. Shoes actually weaken the hooves due to a lack of circulation and the nail holes (they just make the hooves stronger while the shoes are on, once you take them off the hooves are weaker than they were at first)."],
['what is the largest capacity dvd disc available', 'Insert a disc that contains files into the drive that is having the problem. Use a type of disc that is not being recognized in the drive. Good discs to use are game or software discs that were purchased from a store. Do not use music CDs. If the DVD drive can read CDs but not DVDs, insert a DVD movie.nsert a software CD (like a game or business software) into the CD/DVD drive and note what happens. If an AutoPlay window opens, the drive is able to read the disc. The data stored on the disc may still be bad, but an AutoPlay window proves that the drive can read data on the disc.'],
['weather in dead sea', "The higher above sea level you go, (for example, the tops of mountains,) the more separated and spaced out the molecules become, which causes cold weather. This is the ACCURATE answer to how elevation affects temperature. learned the answer to this in science this year, so don't worry, it is accurate: The higher above sea level/elevation you are, the colder the temperature becomes. The reas â\x80¦ on for this is because there are air molecules in the air bump closer together when you are lower above sea level-that creates warm weather."],
['who should not contribute to roth ira', 'You can contribute to a Roth at any age, even past retirement age, as long as youâ\x80\x99re still earning taxable income. A working spouse can also contribute to a Roth IRA on behalf of a nonworking spouse. For a 401(k), the 2014 contribution limit is $17,500, unless youâ\x80\x99re 50 or older, in which case the limit is $23,000.hen you can strategize your distributions to minimize your tax liability. You can also contribute to a traditional IRA even if you participate in an employer-sponsored retirement plan, but in some cases not all of your traditional IRA contributions will be tax deductible.'],
]
scores = model.predict(pairs)
print(scores.shape)
# (5,)
# Or rank different texts based on similarity to a single text
ranks = model.rank(
'how much should i pay for breast implants',
[
'Implant Fees. The cost of buying the implants themselves will influence the overall costs of the procedure. Silicone implants cost between $1,800 and $2,500 though this may go up to slightly over $3,000.Saline implants will cost anywhere between $1,200 and $1,600.The cost of implants varies due to size and manufacturer though there is usually not much of a difference.Anesthesia Fees. There are various options for your anesthesia and this will have a direct impact on the fee you will be charged.otal Costs of Brest Implants. With all the above factors taken into consideration, the total cost of breast implants generally are somewhere in the range of $5,000 and $15,000. However, it is best for your safety and peace of mind to avoid the lowest-charging surgeons and the ones charging very high fees.',
"Best Answer: Regular shoes. If your horse doesn't have bad feet, don't put shoes on him. Shoes actually weaken the hooves due to a lack of circulation and the nail holes (they just make the hooves stronger while the shoes are on, once you take them off the hooves are weaker than they were at first).f your horse doesn't have bad feet, don't put shoes on him. Shoes actually weaken the hooves due to a lack of circulation and the nail holes (they just make the hooves stronger while the shoes are on, once you take them off the hooves are weaker than they were at first).",
'Insert a disc that contains files into the drive that is having the problem. Use a type of disc that is not being recognized in the drive. Good discs to use are game or software discs that were purchased from a store. Do not use music CDs. If the DVD drive can read CDs but not DVDs, insert a DVD movie.nsert a software CD (like a game or business software) into the CD/DVD drive and note what happens. If an AutoPlay window opens, the drive is able to read the disc. The data stored on the disc may still be bad, but an AutoPlay window proves that the drive can read data on the disc.',
"The higher above sea level you go, (for example, the tops of mountains,) the more separated and spaced out the molecules become, which causes cold weather. This is the ACCURATE answer to how elevation affects temperature. learned the answer to this in science this year, so don't worry, it is accurate: The higher above sea level/elevation you are, the colder the temperature becomes. The reas â\x80¦ on for this is because there are air molecules in the air bump closer together when you are lower above sea level-that creates warm weather.",
'You can contribute to a Roth at any age, even past retirement age, as long as youâ\x80\x99re still earning taxable income. A working spouse can also contribute to a Roth IRA on behalf of a nonworking spouse. For a 401(k), the 2014 contribution limit is $17,500, unless youâ\x80\x99re 50 or older, in which case the limit is $23,000.hen you can strategize your distributions to minimize your tax liability. You can also contribute to a traditional IRA even if you participate in an employer-sponsored retirement plan, but in some cases not all of your traditional IRA contributions will be tax deductible.',
]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
```
## Evaluation
### Metrics
#### Cross Encoder Reranking
* Datasets: `train-eval`, `NanoMSMARCO`, `NanoNFCorpus` and `NanoNQ`
* Evaluated with [CERerankingEvaluator
](https://sbert.net/docs/package_reference/cross_encoder/evaluation.html#sentence_transformers.cross_encoder.evaluation.CERerankingEvaluator)
| Metric | train-eval | NanoMSMARCO | NanoNFCorpus | NanoNQ |
|:------------|:-----------|:---------------------|:---------------------|:---------------------|
| map | 0.6511 | 0.5909 (+0.1013) | 0.3364 (+0.0660) | 0.6673 (+0.2466) |
| mrr@10 | 0.6494 | 0.5862 (+0.1087) | 0.5282 (+0.0284) | 0.6862 (+0.2595) |
| **ndcg@10** | **0.7082** | **0.6658 (+0.1254)** | **0.3656 (+0.0405)** | **0.7191 (+0.2185)** |
#### Cross Encoder Nano BEIR
* Dataset: `NanoBEIR_mean`
* Evaluated with [CENanoBEIREvaluator
](https://sbert.net/docs/package_reference/cross_encoder/evaluation.html#sentence_transformers.cross_encoder.evaluation.CENanoBEIREvaluator)
| Metric | Value |
|:------------|:---------------------|
| map | 0.5315 (+0.1380) |
| mrr@10 | 0.6002 (+0.1322) |
| **ndcg@10** | **0.5835 (+0.1281)** |
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 2,000,000 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 |
how much should i pay for breast implants
| Implant Fees. The cost of buying the implants themselves will influence the overall costs of the procedure. Silicone implants cost between $1,800 and $2,500 though this may go up to slightly over $3,000.Saline implants will cost anywhere between $1,200 and $1,600.The cost of implants varies due to size and manufacturer though there is usually not much of a difference.Anesthesia Fees. There are various options for your anesthesia and this will have a direct impact on the fee you will be charged.otal Costs of Brest Implants. With all the above factors taken into consideration, the total cost of breast implants generally are somewhere in the range of $5,000 and $15,000. However, it is best for your safety and peace of mind to avoid the lowest-charging surgeons and the ones charging very high fees.
| 1
|
| are merrell shoes lifetime warranty
| Best Answer: Regular shoes. If your horse doesn't have bad feet, don't put shoes on him. Shoes actually weaken the hooves due to a lack of circulation and the nail holes (they just make the hooves stronger while the shoes are on, once you take them off the hooves are weaker than they were at first).f your horse doesn't have bad feet, don't put shoes on him. Shoes actually weaken the hooves due to a lack of circulation and the nail holes (they just make the hooves stronger while the shoes are on, once you take them off the hooves are weaker than they were at first).
| 0
|
| what is the largest capacity dvd disc available
| Insert a disc that contains files into the drive that is having the problem. Use a type of disc that is not being recognized in the drive. Good discs to use are game or software discs that were purchased from a store. Do not use music CDs. If the DVD drive can read CDs but not DVDs, insert a DVD movie.nsert a software CD (like a game or business software) into the CD/DVD drive and note what happens. If an AutoPlay window opens, the drive is able to read the disc. The data stored on the disc may still be bad, but an AutoPlay window proves that the drive can read data on the disc.
| 0
|
* Loss: [BinaryCrossEntropyLoss
](https://sbert.net/docs/package_reference/cross_encoder/losses.html#binarycrossentropyloss)
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: steps
- `per_device_train_batch_size`: 64
- `per_device_eval_batch_size`: 64
- `num_train_epochs`: 1
- `fp16`: True
#### All Hyperparameters