---
tags:
- sentence-transformers
- cross-encoder
- reranker
- generated_from_trainer
- dataset_size:3988
- loss:ListNetLoss
base_model: colbert-ir/colbertv2.0
pipeline_tag: text-ranking
library_name: sentence-transformers
---
# CrossEncoder based on colbert-ir/colbertv2.0
This is a [Cross Encoder](https://www.sbert.net/docs/cross_encoder/usage/usage.html) model finetuned from [colbert-ir/colbertv2.0](https://huggingface.co/colbert-ir/colbertv2.0) 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:** [colbert-ir/colbertv2.0](https://huggingface.co/colbert-ir/colbertv2.0)
- **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("Pranjal2002/finetuned_colbert_finance_v2")
# Get scores for pairs of texts
pairs = [
['What guidance was offered on The Estée Lauder Companies Inc.’s inventory management or supply chain efficiency targets?', 'Earnings'],
['What guidance was offered on The Estée Lauder Companies Inc.’s inventory management or supply chain efficiency targets?', '8-K'],
['What guidance was offered on The Estée Lauder Companies Inc.’s inventory management or supply chain efficiency targets?', 'DEF14A'],
['What guidance was offered on The Estée Lauder Companies Inc.’s inventory management or supply chain efficiency targets?', '10-K'],
['What guidance was offered on The Estée Lauder Companies Inc.’s inventory management or supply chain efficiency targets?', '10-Q'],
]
scores = model.predict(pairs)
print(scores.shape)
# (5,)
# Or rank different texts based on similarity to a single text
ranks = model.rank(
'What guidance was offered on The Estée Lauder Companies Inc.’s inventory management or supply chain efficiency targets?',
[
'Earnings',
'8-K',
'DEF14A',
'10-K',
'10-Q',
]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
```
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 3,988 training samples
* Columns: query, docs, and labels
* Approximate statistics based on the first 1000 samples:
| | query | docs | labels |
|:--------|:-------------------------------------------------------------------------------------------------|:-----------------------------------|:-----------------------------------|
| type | string | list | list |
| details |
How has Keurig Dr Pepper’s beverage segment profitability trended over recent periods? | ['10-Q', '10-K', 'Earnings', '8-K', 'DEF14A'] | [4, 3, 2, 1, 0] |
| How does management describe competitive advantages in generative AI developer tooling | ['Earnings', '10-K', 'DEF14A', '8-K', '10-Q'] | [4, 3, 2, 1, 0] |
| What did Mohawk Industries’ leadership say about Mohawk Industries’ share repurchase plans? | ['10-K', '10-Q', 'Earnings', 'DEF14A', '8-K'] | [2, 2, 1, 0, 0] |
* Loss: [ListNetLoss](https://sbert.net/docs/package_reference/cross_encoder/losses.html#listnetloss) with these parameters:
```json
{
"activation_fn": "torch.nn.modules.linear.Identity",
"mini_batch_size": null
}
```
### Evaluation Dataset
#### Unnamed Dataset
* Size: 998 evaluation samples
* Columns: query, docs, and labels
* Approximate statistics based on the first 998 samples:
| | query | docs | labels |
|:--------|:-------------------------------------------------------------------------------------------------|:-----------------------------------|:-----------------------------------|
| type | string | list | list |
| details | What guidance was offered on The Estée Lauder Companies Inc.’s inventory management or supply chain efficiency targets? | ['Earnings', '8-K', 'DEF14A', '10-K', '10-Q'] | [4, 3, 2, 1, 0] |
| What questions were asked about Live Nation Entertainment’s concert attendance and ticket sales engagement metrics? | ['Earnings', '10-K', '8-K', '10-Q', 'DEF14A'] | [4, 3, 2, 1, 0] |
| How has the ratio of AvalonBay Communities’ recurring to one-time rental income evolved in the latest reporting period? | ['10-Q', '10-K', 'Earnings', '8-K', 'DEF14A'] | [4, 3, 2, 1, 0] |
* Loss: [ListNetLoss](https://sbert.net/docs/package_reference/cross_encoder/losses.html#listnetloss) with these parameters:
```json
{
"activation_fn": "torch.nn.modules.linear.Identity",
"mini_batch_size": null
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: steps
- `per_device_train_batch_size`: 4
- `per_device_eval_batch_size`: 4
- `gradient_accumulation_steps`: 2
- `learning_rate`: 2e-05
- `num_train_epochs`: 5
- `warmup_steps`: 100
- `fp16`: True
- `load_best_model_at_end`: True
#### All Hyperparameters