---
tags:
- sentence-transformers
- cross-encoder
- generated_from_trainer
- dataset_size:5
- loss:MultipleNegativesRankingLoss
base_model: cross-encoder/ms-marco-MiniLM-L12-v2
pipeline_tag: text-ranking
library_name: sentence-transformers
---
# CrossEncoder based on cross-encoder/ms-marco-MiniLM-L12-v2
This is a [Cross Encoder](https://www.sbert.net/docs/cross_encoder/usage/usage.html) model finetuned from [cross-encoder/ms-marco-MiniLM-L12-v2](https://huggingface.co/cross-encoder/ms-marco-MiniLM-L12-v2) 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:** [cross-encoder/ms-marco-MiniLM-L12-v2](https://huggingface.co/cross-encoder/ms-marco-MiniLM-L12-v2)
- **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("Davidsamuel101/ft-ms-marco-MiniLM-L12-v2-claims-reranker")
# Get scores for pairs of texts
pairs = [
["It found the scientists' rigour and honesty are not in doubt, and their behaviour did not prejudice the IPCC's conclusions, though they did fail to display the proper degree of openness.", 'The report, issued on 18 February 2011, cleared the researchers and "did not find any evidence that NOAA inappropriately manipulated data or failed to adhere to appropriate peer review procedures".'],
["It found the scientists' rigour and honesty are not in doubt, and their behaviour did not prejudice the IPCC's conclusions, though they did fail to display the proper degree of openness.", 'Ongoing experiments are conducted by more than 4,000 scientists from many nations.'],
["It found the scientists' rigour and honesty are not in doubt, and their behaviour did not prejudice the IPCC's conclusions, though they did fail to display the proper degree of openness.", 'Novell did not seem to proceed to a full court case after losing their case there.'],
["It found the scientists' rigour and honesty are not in doubt, and their behaviour did not prejudice the IPCC's conclusions, though they did fail to display the proper degree of openness.", 'In the face of determined opposition from the National Park Service and conservation groups, the dam was never built.'],
["It found the scientists' rigour and honesty are not in doubt, and their behaviour did not prejudice the IPCC's conclusions, though they did fail to display the proper degree of openness.", 'At Caltech he developed the first instrument able to measure carbon dioxide in atmospheric samples with consistently reliable accuracy.'],
]
scores = model.predict(pairs)
print(scores.shape)
# (5,)
# Or rank different texts based on similarity to a single text
ranks = model.rank(
"It found the scientists' rigour and honesty are not in doubt, and their behaviour did not prejudice the IPCC's conclusions, though they did fail to display the proper degree of openness.",
[
'The report, issued on 18 February 2011, cleared the researchers and "did not find any evidence that NOAA inappropriately manipulated data or failed to adhere to appropriate peer review procedures".',
'Ongoing experiments are conducted by more than 4,000 scientists from many nations.',
'Novell did not seem to proceed to a full court case after losing their case there.',
'In the face of determined opposition from the National Park Service and conservation groups, the dam was never built.',
'At Caltech he developed the first instrument able to measure carbon dioxide in atmospheric samples with consistently reliable accuracy.',
]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
```
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 5 training samples
* Columns: text1
, text2
, and label
* Approximate statistics based on the first 5 samples:
| | text1 | text2 | label |
|:--------|:-------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------|:------------------------------------------------|
| type | string | string | int |
| details |
It found the scientists' rigour and honesty are not in doubt, and their behaviour did not prejudice the IPCC's conclusions, though they did fail to display the proper degree of openness.
| The report, issued on 18 February 2011, cleared the researchers and "did not find any evidence that NOAA inappropriately manipulated data or failed to adhere to appropriate peer review procedures".
| 1
|
| It found the scientists' rigour and honesty are not in doubt, and their behaviour did not prejudice the IPCC's conclusions, though they did fail to display the proper degree of openness.
| Ongoing experiments are conducted by more than 4,000 scientists from many nations.
| 0
|
| It found the scientists' rigour and honesty are not in doubt, and their behaviour did not prejudice the IPCC's conclusions, though they did fail to display the proper degree of openness.
| Novell did not seem to proceed to a full court case after losing their case there.
| 0
|
* Loss: [MultipleNegativesRankingLoss
](https://sbert.net/docs/package_reference/cross_encoder/losses.html#multiplenegativesrankingloss) with these parameters:
```json
{
"scale": 10.0,
"num_negatives": 4,
"activation_fn": "torch.nn.modules.activation.Sigmoid"
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: steps
- `per_device_train_batch_size`: 16
- `learning_rate`: 1e-05
- `num_train_epochs`: 10
- `bf16`: True
- `load_best_model_at_end`: True
#### All Hyperparameters