---
language:
- multilingual
license: apache-2.0
tags:
- sentence-transformers
- cross-encoder
- reranker
- generated_from_trainer
- dataset_size:16862
- loss:BinaryCrossEntropyLoss
base_model: Alibaba-NLP/gte-multilingual-reranker-base
pipeline_tag: text-ranking
library_name: sentence-transformers
metrics:
- map
- mrr@10
- ndcg@10
model-index:
- name: cometadata/gte-multilingual-reranker-affiliations
results:
- task:
type: cross-encoder-reranking
name: Cross Encoder Reranking
dataset:
name: affiliation val
type: affiliation-val
metrics:
- type: map
value: 0.9666
name: Map
- type: mrr@10
value: 0.9666
name: Mrr@10
- type: ndcg@10
value: 0.9753
name: Ndcg@10
---
# cometadata/gte-multilingual-reranker-affiliations
This is a [Cross Encoder](https://www.sbert.net/docs/cross_encoder/usage/usage.html) model finetuned from [Alibaba-NLP/gte-multilingual-reranker-base](https://huggingface.co/Alibaba-NLP/gte-multilingual-reranker-base) 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:** [Alibaba-NLP/gte-multilingual-reranker-base](https://huggingface.co/Alibaba-NLP/gte-multilingual-reranker-base)
- **Maximum Sequence Length:** 8192 tokens
- **Number of Output Labels:** 1 label
- **Language:** multilingual
- **License:** apache-2.0
### 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("cometadata/gte-multilingual-reranker-affiliations")
# Get scores for pairs of texts
pairs = [
['Université Toulouse', 'a Université de Toulouse, Mines Albi, CNRS, Centre RAPSODEE , Albi , France'],
['Université Toulouse', 'National Polytechnic Institute of Toulouse'],
['School of Fundamental Science and Technology, Keio University 1 , 3-14-1 Hiyoshi, Kohoku-ku, Yokohama 223-8522, Japan', 'Center for Supercentenarian Research, Keio University, Tokyo, Japan'],
['School of Fundamental Science and Technology, Keio University 1 , 3-14-1 Hiyoshi, Kohoku-ku, Yokohama 223-8522, Japan', 'g Toin Human Science and Technology Center, Department of Materials Science and Technology, Toin University of Yokohama, 1614 Kurogane-cho, Aoba-ku, Yokohama 225, Japan'],
['Division of Pulmonary and Critical Care Medicine, University of North Carolina School of Medicine, Chapel Hill, North Carolina', 'Lineberger Comprehensive Cancer Center, University of North Carolina at Chapel Hill, 101 Manning Drive, CB# 7295, Chapel Hill, NC 27599, USA'],
]
scores = model.predict(pairs)
print(scores.shape)
# (5,)
# Or rank different texts based on similarity to a single text
ranks = model.rank(
'Université Toulouse',
[
'a Université de Toulouse, Mines Albi, CNRS, Centre RAPSODEE , Albi , France',
'National Polytechnic Institute of Toulouse',
'Center for Supercentenarian Research, Keio University, Tokyo, Japan',
'g Toin Human Science and Technology Center, Department of Materials Science and Technology, Toin University of Yokohama, 1614 Kurogane-cho, Aoba-ku, Yokohama 225, Japan',
'Lineberger Comprehensive Cancer Center, University of North Carolina at Chapel Hill, 101 Manning Drive, CB# 7295, Chapel Hill, NC 27599, USA',
]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
```
## Evaluation
### Metrics
#### Cross Encoder Reranking
* Dataset: `affiliation-val`
* 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": true
}
```
| Metric | Value |
|:------------|:---------------------|
| map | 0.9666 (-0.0334) |
| mrr@10 | 0.9666 (-0.0334) |
| **ndcg@10** | **0.9753 (-0.0247)** |
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 16,862 training samples
* Columns: query, document, and label
* Approximate statistics based on the first 1000 samples:
| | query | document | label |
|:--------|:-----------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------|:------------------------------------------------|
| type | string | string | int |
| details |
Nanjing University of Science and Technology,Computer Science and Engineering,Nanjing,China | Nanjing University of Science And Technology, China | 1 |
| Nanjing University of Science and Technology,Computer Science and Engineering,Nanjing,China | Nanjing university of finance & economics, China. | 0 |
| University of Bonn, Bonn, Germany | Department of Geophysics, University of Bonn, 53115 Bonn, Germany | 1 |
* 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": null
}
```
### Evaluation Dataset
#### Unnamed Dataset
* Size: 808 evaluation samples
* Columns: query, document, and label
* Approximate statistics based on the first 808 samples:
| | query | document | label |
|:--------|:------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------|:------------------------------------------------|
| type | string | string | int |
| details | Université Toulouse | a Université de Toulouse, Mines Albi, CNRS, Centre RAPSODEE , Albi , France | 1 |
| Université Toulouse | National Polytechnic Institute of Toulouse | 0 |
| School of Fundamental Science and Technology, Keio University 1 , 3-14-1 Hiyoshi, Kohoku-ku, Yokohama 223-8522, Japan | Center for Supercentenarian Research, Keio University, Tokyo, Japan | 1 |
* 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": null
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: steps
- `per_device_train_batch_size`: 32
- `per_device_eval_batch_size`: 32
- `learning_rate`: 2e-05
- `num_train_epochs`: 2
- `warmup_ratio`: 0.1
- `load_best_model_at_end`: True
- `hub_model_id`: cometadata/gte-multilingual-reranker-affiliations
#### All Hyperparameters