Text Ranking
sentence-transformers
Safetensors
new
cross-encoder
reranker
Generated from Trainer
dataset_size:24588
loss:BinaryCrossEntropyLoss
custom_code
Eval Results (legacy)
text-embeddings-inference
Instructions to use TakoData/chart-reranker with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use TakoData/chart-reranker with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("TakoData/chart-reranker", trust_remote_code=True) query = "Which planet is known as the Red Planet?" passages = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", "Saturn, famous for its rings, is sometimes mistaken for the Red Planet." ] scores = model.predict([(query, passage) for passage in passages]) print(scores) - Notebooks
- Google Colab
- Kaggle
Upload fine-tuned chart reranker model
Browse files- README.md +55 -64
- eval/CrossEncoderCorrelationEvaluator_validation_results.csv +5 -5
- model.safetensors +1 -1
- training_info.txt +1 -1
README.md
CHANGED
|
@@ -4,7 +4,7 @@ tags:
|
|
| 4 |
- cross-encoder
|
| 5 |
- reranker
|
| 6 |
- generated_from_trainer
|
| 7 |
-
- dataset_size:
|
| 8 |
- loss:BinaryCrossEntropyLoss
|
| 9 |
base_model: Alibaba-NLP/gte-multilingual-reranker-base
|
| 10 |
pipeline_tag: text-ranking
|
|
@@ -23,10 +23,10 @@ model-index:
|
|
| 23 |
type: validation
|
| 24 |
metrics:
|
| 25 |
- type: pearson
|
| 26 |
-
value: 0.
|
| 27 |
name: Pearson
|
| 28 |
- type: spearman
|
| 29 |
-
value: 0.
|
| 30 |
name: Spearman
|
| 31 |
---
|
| 32 |
|
|
@@ -70,11 +70,11 @@ from sentence_transformers import CrossEncoder
|
|
| 70 |
model = CrossEncoder("cross_encoder_model_id")
|
| 71 |
# Get scores for pairs of texts
|
| 72 |
pairs = [
|
| 73 |
-
['
|
| 74 |
-
['
|
| 75 |
-
['
|
| 76 |
-
['
|
| 77 |
-
['
|
| 78 |
]
|
| 79 |
scores = model.predict(pairs)
|
| 80 |
print(scores.shape)
|
|
@@ -82,13 +82,13 @@ print(scores.shape)
|
|
| 82 |
|
| 83 |
# Or rank different texts based on similarity to a single text
|
| 84 |
ranks = model.rank(
|
| 85 |
-
'
|
| 86 |
[
|
| 87 |
-
'Title: "
|
| 88 |
-
'Title: "
|
| 89 |
-
'Title: "
|
| 90 |
-
'Title: "
|
| 91 |
-
'Title: "
|
| 92 |
]
|
| 93 |
)
|
| 94 |
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
|
|
@@ -129,8 +129,8 @@ You can finetune this model on your own dataset.
|
|
| 129 |
|
| 130 |
| Metric | Value |
|
| 131 |
|:-------------|:-----------|
|
| 132 |
-
| pearson | 0.
|
| 133 |
-
| **spearman** | **0.
|
| 134 |
|
| 135 |
<!--
|
| 136 |
## Bias, Risks and Limitations
|
|
@@ -150,19 +150,19 @@ You can finetune this model on your own dataset.
|
|
| 150 |
|
| 151 |
#### Unnamed Dataset
|
| 152 |
|
| 153 |
-
* Size:
|
| 154 |
* Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>label</code>
|
| 155 |
* Approximate statistics based on the first 1000 samples:
|
| 156 |
| | sentence_0 | sentence_1 | label |
|
| 157 |
|:--------|:-----------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------|:---------------------------------------------------------------|
|
| 158 |
| type | string | string | float |
|
| 159 |
-
| details | <ul><li>min:
|
| 160 |
* Samples:
|
| 161 |
-
| sentence_0
|
| 162 |
-
|:-----------------------------------------------------------------------------------
|
| 163 |
-
| <code>
|
| 164 |
-
| <code>
|
| 165 |
-
| <code>
|
| 166 |
* Loss: [<code>BinaryCrossEntropyLoss</code>](https://sbert.net/docs/package_reference/cross_encoder/losses.html#binarycrossentropyloss) with these parameters:
|
| 167 |
```json
|
| 168 |
{
|
|
@@ -308,47 +308,38 @@ You can finetune this model on your own dataset.
|
|
| 308 |
### Training Logs
|
| 309 |
| Epoch | Step | Training Loss | validation_spearman |
|
| 310 |
|:------:|:----:|:-------------:|:-------------------:|
|
| 311 |
-
| 0.
|
| 312 |
-
| 0.
|
| 313 |
-
| 0.
|
| 314 |
-
| 0.
|
| 315 |
-
| 0.
|
| 316 |
-
| 0.
|
| 317 |
-
| 0.
|
| 318 |
-
|
|
| 319 |
-
| 1.
|
| 320 |
-
| 1.
|
| 321 |
-
| 1.
|
| 322 |
-
| 1.
|
| 323 |
-
| 1.
|
| 324 |
-
| 1.
|
| 325 |
-
| 1.
|
| 326 |
-
| 1.
|
| 327 |
-
|
|
| 328 |
-
|
|
| 329 |
-
| 2.
|
| 330 |
-
| 2.
|
| 331 |
-
| 2.
|
| 332 |
-
| 2.
|
| 333 |
-
| 2.
|
| 334 |
-
| 2.
|
| 335 |
-
|
|
| 336 |
-
|
|
| 337 |
-
|
|
| 338 |
-
|
|
| 339 |
-
| 3.
|
| 340 |
-
| 3.
|
| 341 |
-
| 3.
|
| 342 |
-
| 3.
|
| 343 |
-
| 3.3937 | 3000 | 0.3435 | 0.8656 |
|
| 344 |
-
| 3.5068 | 3100 | - | 0.8665 |
|
| 345 |
-
| 3.6199 | 3200 | - | 0.8661 |
|
| 346 |
-
| 3.7330 | 3300 | - | 0.8660 |
|
| 347 |
-
| 3.8462 | 3400 | - | 0.8666 |
|
| 348 |
-
| 3.9593 | 3500 | 0.3364 | 0.8679 |
|
| 349 |
-
| 4.0 | 3536 | - | 0.8674 |
|
| 350 |
-
| 4.0724 | 3600 | - | 0.8670 |
|
| 351 |
-
| 4.1855 | 3700 | - | 0.8697 |
|
| 352 |
|
| 353 |
|
| 354 |
### Framework Versions
|
|
|
|
| 4 |
- cross-encoder
|
| 5 |
- reranker
|
| 6 |
- generated_from_trainer
|
| 7 |
+
- dataset_size:24504
|
| 8 |
- loss:BinaryCrossEntropyLoss
|
| 9 |
base_model: Alibaba-NLP/gte-multilingual-reranker-base
|
| 10 |
pipeline_tag: text-ranking
|
|
|
|
| 23 |
type: validation
|
| 24 |
metrics:
|
| 25 |
- type: pearson
|
| 26 |
+
value: 0.8721120209782917
|
| 27 |
name: Pearson
|
| 28 |
- type: spearman
|
| 29 |
+
value: 0.8685098375943734
|
| 30 |
name: Spearman
|
| 31 |
---
|
| 32 |
|
|
|
|
| 70 |
model = CrossEncoder("cross_encoder_model_id")
|
| 71 |
# Get scores for pairs of texts
|
| 72 |
pairs = [
|
| 73 |
+
['include the popular publications as well', 'Title: "Americans\' Library use - past 3 months (United States)"\nCollections: YouGov Trackers\nDatasets: YouGovTrackerValueV2\nChart Type: survey:timeseries\nSources: YouGov'],
|
| 74 |
+
['Give it a good research topic', 'Title: "The most important issues facing the country (United Kingdom)"\nCollections: YouGov Trackers\nDatasets: YouGovTrackerValueV2\nChart Type: survey:timeseries\nSources: YouGov'],
|
| 75 |
+
['When and where are the Denver Broncos playing the Kansas City Chiefs?', 'Title: "Denver Broncos at Kansas City Chiefs"\nCollections: Football\nChart Type: game_score:football'],
|
| 76 |
+
['49ers vs Seahawks', 'Title: "Seahawk Deep Ocean Technology, Inc. Overview"\nCollections: Companies\nChart Type: company:finance\nCanonical forms: "Overview"="Stock Overview"\nSources: S&P Global'],
|
| 77 |
+
['Comparative review of JBL vs Marshall 2025 Bluetooth speakers', 'Title: "B&C Speakers Overview"\nCollections: Companies\nChart Type: company:finance\nCanonical forms: "B&C Speakers"="B&C Speakers S.p.A.", "Overview"="Stock Overview"\nSources: S&P Global'],
|
| 78 |
]
|
| 79 |
scores = model.predict(pairs)
|
| 80 |
print(scores.shape)
|
|
|
|
| 82 |
|
| 83 |
# Or rank different texts based on similarity to a single text
|
| 84 |
ranks = model.rank(
|
| 85 |
+
'include the popular publications as well',
|
| 86 |
[
|
| 87 |
+
'Title: "Americans\' Library use - past 3 months (United States)"\nCollections: YouGov Trackers\nDatasets: YouGovTrackerValueV2\nChart Type: survey:timeseries\nSources: YouGov',
|
| 88 |
+
'Title: "The most important issues facing the country (United Kingdom)"\nCollections: YouGov Trackers\nDatasets: YouGovTrackerValueV2\nChart Type: survey:timeseries\nSources: YouGov',
|
| 89 |
+
'Title: "Denver Broncos at Kansas City Chiefs"\nCollections: Football\nChart Type: game_score:football',
|
| 90 |
+
'Title: "Seahawk Deep Ocean Technology, Inc. Overview"\nCollections: Companies\nChart Type: company:finance\nCanonical forms: "Overview"="Stock Overview"\nSources: S&P Global',
|
| 91 |
+
'Title: "B&C Speakers Overview"\nCollections: Companies\nChart Type: company:finance\nCanonical forms: "B&C Speakers"="B&C Speakers S.p.A.", "Overview"="Stock Overview"\nSources: S&P Global',
|
| 92 |
]
|
| 93 |
)
|
| 94 |
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
|
|
|
|
| 129 |
|
| 130 |
| Metric | Value |
|
| 131 |
|:-------------|:-----------|
|
| 132 |
+
| pearson | 0.8721 |
|
| 133 |
+
| **spearman** | **0.8685** |
|
| 134 |
|
| 135 |
<!--
|
| 136 |
## Bias, Risks and Limitations
|
|
|
|
| 150 |
|
| 151 |
#### Unnamed Dataset
|
| 152 |
|
| 153 |
+
* Size: 24,504 training samples
|
| 154 |
* Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>label</code>
|
| 155 |
* Approximate statistics based on the first 1000 samples:
|
| 156 |
| | sentence_0 | sentence_1 | label |
|
| 157 |
|:--------|:-----------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------|:---------------------------------------------------------------|
|
| 158 |
| type | string | string | float |
|
| 159 |
+
| details | <ul><li>min: 2 characters</li><li>mean: 86.83 characters</li><li>max: 993 characters</li></ul> | <ul><li>min: 77 characters</li><li>mean: 169.16 characters</li><li>max: 360 characters</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.42</li><li>max: 1.0</li></ul> |
|
| 160 |
* Samples:
|
| 161 |
+
| sentence_0 | sentence_1 | label |
|
| 162 |
+
|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------|
|
| 163 |
+
| <code>include the popular publications as well</code> | <code>Title: "Americans' Library use - past 3 months (United States)"<br>Collections: YouGov Trackers<br>Datasets: YouGovTrackerValueV2<br>Chart Type: survey:timeseries<br>Sources: YouGov</code> | <code>0.5</code> |
|
| 164 |
+
| <code>Give it a good research topic</code> | <code>Title: "The most important issues facing the country (United Kingdom)"<br>Collections: YouGov Trackers<br>Datasets: YouGovTrackerValueV2<br>Chart Type: survey:timeseries<br>Sources: YouGov</code> | <code>1.0</code> |
|
| 165 |
+
| <code>When and where are the Denver Broncos playing the Kansas City Chiefs?</code> | <code>Title: "Denver Broncos at Kansas City Chiefs"<br>Collections: Football<br>Chart Type: game_score:football</code> | <code>1.0</code> |
|
| 166 |
* Loss: [<code>BinaryCrossEntropyLoss</code>](https://sbert.net/docs/package_reference/cross_encoder/losses.html#binarycrossentropyloss) with these parameters:
|
| 167 |
```json
|
| 168 |
{
|
|
|
|
| 308 |
### Training Logs
|
| 309 |
| Epoch | Step | Training Loss | validation_spearman |
|
| 310 |
|:------:|:----:|:-------------:|:-------------------:|
|
| 311 |
+
| 0.1305 | 100 | - | 0.7594 |
|
| 312 |
+
| 0.2611 | 200 | - | 0.7951 |
|
| 313 |
+
| 0.3916 | 300 | - | 0.8050 |
|
| 314 |
+
| 0.5222 | 400 | - | 0.8200 |
|
| 315 |
+
| 0.6527 | 500 | 0.468 | 0.8290 |
|
| 316 |
+
| 0.7833 | 600 | - | 0.8331 |
|
| 317 |
+
| 0.9138 | 700 | - | 0.8347 |
|
| 318 |
+
| 1.0 | 766 | - | 0.8434 |
|
| 319 |
+
| 1.0444 | 800 | - | 0.8432 |
|
| 320 |
+
| 1.1749 | 900 | - | 0.8467 |
|
| 321 |
+
| 1.3055 | 1000 | 0.4135 | 0.8473 |
|
| 322 |
+
| 1.4360 | 1100 | - | 0.8475 |
|
| 323 |
+
| 1.5666 | 1200 | - | 0.8535 |
|
| 324 |
+
| 1.6971 | 1300 | - | 0.8518 |
|
| 325 |
+
| 1.8277 | 1400 | - | 0.8571 |
|
| 326 |
+
| 1.9582 | 1500 | 0.3747 | 0.8577 |
|
| 327 |
+
| 2.0 | 1532 | - | 0.8556 |
|
| 328 |
+
| 2.0888 | 1600 | - | 0.8587 |
|
| 329 |
+
| 2.2193 | 1700 | - | 0.8609 |
|
| 330 |
+
| 2.3499 | 1800 | - | 0.8612 |
|
| 331 |
+
| 2.4804 | 1900 | - | 0.8619 |
|
| 332 |
+
| 2.6110 | 2000 | 0.3515 | 0.8626 |
|
| 333 |
+
| 2.7415 | 2100 | - | 0.8622 |
|
| 334 |
+
| 2.8721 | 2200 | - | 0.8653 |
|
| 335 |
+
| 3.0 | 2298 | - | 0.8656 |
|
| 336 |
+
| 3.0026 | 2300 | - | 0.8656 |
|
| 337 |
+
| 3.1332 | 2400 | - | 0.8643 |
|
| 338 |
+
| 3.2637 | 2500 | 0.3421 | 0.8646 |
|
| 339 |
+
| 3.3943 | 2600 | - | 0.8654 |
|
| 340 |
+
| 3.5248 | 2700 | - | 0.8666 |
|
| 341 |
+
| 3.6554 | 2800 | - | 0.8640 |
|
| 342 |
+
| 3.7859 | 2900 | - | 0.8685 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 343 |
|
| 344 |
|
| 345 |
### Framework Versions
|
eval/CrossEncoderCorrelationEvaluator_validation_results.csv
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
epoch,steps,Pearson_Correlation,Spearman_Correlation
|
| 2 |
-
1.0,
|
| 3 |
-
2.0,
|
| 4 |
-
3.0,
|
| 5 |
-
4.0,
|
| 6 |
-
5.0,
|
|
|
|
| 1 |
epoch,steps,Pearson_Correlation,Spearman_Correlation
|
| 2 |
+
1.0,766,0.8453028536443531,0.8434351098924865
|
| 3 |
+
2.0,1532,0.8574271674817566,0.8556349102862147
|
| 4 |
+
3.0,2298,0.8687755325286843,0.865637110569002
|
| 5 |
+
4.0,3064,0.8698030506575616,0.8669249926545327
|
| 6 |
+
5.0,3830,0.8701775404822807,0.8675087793394471
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1223854204
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:06035d5c262912d8a1e0fd97e71fc51f0e84c66ed6a5f7e14862da0e88600252
|
| 3 |
size 1223854204
|
training_info.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
Base Model: Alibaba-NLP/gte-multilingual-reranker-base
|
| 2 |
-
Training Samples:
|
| 3 |
Epochs: 5
|
| 4 |
Batch Size: 32
|
| 5 |
Learning Rate: 2e-05
|
|
|
|
| 1 |
Base Model: Alibaba-NLP/gte-multilingual-reranker-base
|
| 2 |
+
Training Samples: 24504
|
| 3 |
Epochs: 5
|
| 4 |
Batch Size: 32
|
| 5 |
Learning Rate: 2e-05
|