---
tags:
- sentence-transformers
- cross-encoder
- reranker
- generated_from_trainer
- dataset_size:3190
- loss:ListNetLoss
base_model: ProsusAI/finbert
pipeline_tag: text-ranking
library_name: sentence-transformers
---
# CrossEncoder based on ProsusAI/finbert
This is a [Cross Encoder](https://www.sbert.net/docs/cross_encoder/usage/usage.html) model finetuned from [ProsusAI/finbert](https://huggingface.co/ProsusAI/finbert) 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:** [ProsusAI/finbert](https://huggingface.co/ProsusAI/finbert)
- **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/finbert_new_v2")
# Get scores for pairs of texts
pairs = [
['What consolidation trends among competitors are highlighted in disclosures affecting Regions Financial Corporation’s regional banking operations?', '10-K'],
['What consolidation trends among competitors are highlighted in disclosures affecting Regions Financial Corporation’s regional banking operations?', 'Earnings'],
['What consolidation trends among competitors are highlighted in disclosures affecting Regions Financial Corporation’s regional banking operations?', 'DEF14A'],
['What consolidation trends among competitors are highlighted in disclosures affecting Regions Financial Corporation’s regional banking operations?', '8-K'],
['What consolidation trends among competitors are highlighted in disclosures affecting Regions Financial Corporation’s regional banking operations?', '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 consolidation trends among competitors are highlighted in disclosures affecting Regions Financial Corporation’s regional banking operations?',
[
'10-K',
'Earnings',
'DEF14A',
'8-K',
'10-Q',
]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
```
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 3,190 training samples
* Columns: query, docs, and labels
* Approximate statistics based on the first 1000 samples:
| | query | docs | labels |
|:--------|:-------------------------------------------------------------------------------------------------|:-----------------------------------|:-----------------------------------|
| type | string | list | list |
| details |
What year over year growth rate was shown for paid memberships in the same table | ['10-Q', '10-K', '8-K', 'Earnings', 'DEF14A'] | [4, 3, 2, 1, 0] |
| How did non‑GAAP EPS growth align with the incentive metrics set for management? | ['DEF14A', '8-K', '10-K', '10-Q', 'Earnings'] | [2, 1, 0, 0, 0] |
| What questions were raised regarding Xcel Energy Inc.’s risk factors and mitigation plans related to the integration of renewable energy sources into their grid? | ['10-K', 'Earnings', '8-K', '10-Q', '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
}
```
### Evaluation Dataset
#### Unnamed Dataset
* Size: 798 evaluation samples
* Columns: query, docs, and labels
* Approximate statistics based on the first 798 samples:
| | query | docs | labels |
|:--------|:-------------------------------------------------------------------------------------------------|:-----------------------------------|:-----------------------------------|
| type | string | list | list |
| details | What consolidation trends among competitors are highlighted in disclosures affecting Regions Financial Corporation’s regional banking operations? | ['10-K', 'Earnings', 'DEF14A', '8-K', '10-Q'] | [4, 3, 2, 1, 0] |
| How does Pentair manage equity award burn rate or share pool availability? | ['10-K', 'DEF14A', '10-Q', 'Earnings', '8-K'] | [4, 3, 2, 1, 0] |
| What key takeaways emerged from Valero Energy Corporation’s most recent earnings announcement? | ['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
- `bf16`: True
- `load_best_model_at_end`: True
- `optim`: adamw_torch
#### All Hyperparameters