Text Ranking
sentence-transformers
Safetensors
xlm-roberta
cross-encoder
reranker
Generated from Trainer
dataset_size:8000
loss:BinaryCrossEntropyLoss
Eval Results (legacy)
text-embeddings-inference
Instructions to use OloriBern/hotpotqa-hybrid-2000 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use OloriBern/hotpotqa-hybrid-2000 with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("OloriBern/hotpotqa-hybrid-2000") 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 hybrid model for hotpotqa (trained on 2000 queries)
Browse files- README.md +42 -45
- config.json +1 -1
- model.safetensors +2 -2
README.md
CHANGED
|
@@ -28,25 +28,25 @@ model-index:
|
|
| 28 |
type: validation
|
| 29 |
metrics:
|
| 30 |
- type: accuracy
|
| 31 |
-
value: 0.
|
| 32 |
name: Accuracy
|
| 33 |
- type: accuracy_threshold
|
| 34 |
-
value: 0.
|
| 35 |
name: Accuracy Threshold
|
| 36 |
- type: f1
|
| 37 |
-
value: 0.
|
| 38 |
name: F1
|
| 39 |
- type: f1_threshold
|
| 40 |
-
value: 0.
|
| 41 |
name: F1 Threshold
|
| 42 |
- type: precision
|
| 43 |
-
value:
|
| 44 |
name: Precision
|
| 45 |
- type: recall
|
| 46 |
-
value: 0.
|
| 47 |
name: Recall
|
| 48 |
- type: average_precision
|
| 49 |
-
value: 0.
|
| 50 |
name: Average Precision
|
| 51 |
- task:
|
| 52 |
type: cross-encoder-binary-classification
|
|
@@ -56,25 +56,25 @@ model-index:
|
|
| 56 |
type: train_subset
|
| 57 |
metrics:
|
| 58 |
- type: accuracy
|
| 59 |
-
value: 0.
|
| 60 |
name: Accuracy
|
| 61 |
- type: accuracy_threshold
|
| 62 |
-
value: 0.
|
| 63 |
name: Accuracy Threshold
|
| 64 |
- type: f1
|
| 65 |
-
value: 0.
|
| 66 |
name: F1
|
| 67 |
- type: f1_threshold
|
| 68 |
-
value: 0.
|
| 69 |
name: F1 Threshold
|
| 70 |
- type: precision
|
| 71 |
-
value: 0.
|
| 72 |
name: Precision
|
| 73 |
- type: recall
|
| 74 |
-
value: 0.
|
| 75 |
name: Recall
|
| 76 |
- type: average_precision
|
| 77 |
-
value: 0.
|
| 78 |
name: Average Precision
|
| 79 |
---
|
| 80 |
|
|
@@ -118,11 +118,11 @@ from sentence_transformers import CrossEncoder
|
|
| 118 |
model = CrossEncoder("cross_encoder_model_id")
|
| 119 |
# Get scores for pairs of texts
|
| 120 |
pairs = [
|
| 121 |
-
['
|
| 122 |
-
['
|
| 123 |
-
['
|
| 124 |
-
['
|
| 125 |
-
[
|
| 126 |
]
|
| 127 |
scores = model.predict(pairs)
|
| 128 |
print(scores.shape)
|
|
@@ -130,13 +130,13 @@ print(scores.shape)
|
|
| 130 |
|
| 131 |
# Or rank different texts based on similarity to a single text
|
| 132 |
ranks = model.rank(
|
| 133 |
-
'
|
| 134 |
[
|
| 135 |
-
|
| 136 |
-
'
|
| 137 |
-
'
|
| 138 |
-
'
|
| 139 |
-
'
|
| 140 |
]
|
| 141 |
)
|
| 142 |
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
|
|
@@ -177,13 +177,13 @@ You can finetune this model on your own dataset.
|
|
| 177 |
|
| 178 |
| Metric | validation | train_subset |
|
| 179 |
|:----------------------|:-----------|:-------------|
|
| 180 |
-
| accuracy | 0.
|
| 181 |
-
| accuracy_threshold | 0.
|
| 182 |
-
| f1 | 0.
|
| 183 |
-
| f1_threshold | 0.
|
| 184 |
-
| precision |
|
| 185 |
-
| recall | 0.
|
| 186 |
-
| **average_precision** | **0.
|
| 187 |
|
| 188 |
<!--
|
| 189 |
## Bias, Risks and Limitations
|
|
@@ -209,13 +209,13 @@ You can finetune this model on your own dataset.
|
|
| 209 |
| | sentence_0 | sentence_1 | label |
|
| 210 |
|:--------|:-------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------|:---------------------------------------------------------------|
|
| 211 |
| type | string | string | float |
|
| 212 |
-
| details | <ul><li>min: 35 characters</li><li>mean:
|
| 213 |
* Samples:
|
| 214 |
-
| sentence_0
|
| 215 |
-
|:----------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------|
|
| 216 |
-
| <code>
|
| 217 |
-
| <code>
|
| 218 |
-
| <code>
|
| 219 |
* Loss: [<code>BinaryCrossEntropyLoss</code>](https://sbert.net/docs/package_reference/cross_encoder/losses.html#binarycrossentropyloss) with these parameters:
|
| 220 |
```json
|
| 221 |
{
|
|
@@ -354,13 +354,10 @@ You can finetune this model on your own dataset.
|
|
| 354 |
### Training Logs
|
| 355 |
| Epoch | Step | Training Loss | validation_average_precision | train_subset_average_precision |
|
| 356 |
|:-----:|:----:|:-------------:|:----------------------------:|:------------------------------:|
|
| 357 |
-
| 0.
|
| 358 |
-
| 0.
|
| 359 |
-
| 0.
|
| 360 |
-
| 0.
|
| 361 |
-
| 0.125 | 500 | 0.4041 | 0.9997 | 0.9600 |
|
| 362 |
-
| 0.15 | 600 | - | 0.9995 | 0.9732 |
|
| 363 |
-
| 0.175 | 700 | - | 0.9996 | 0.9651 |
|
| 364 |
|
| 365 |
|
| 366 |
### Framework Versions
|
|
|
|
| 28 |
type: validation
|
| 29 |
metrics:
|
| 30 |
- type: accuracy
|
| 31 |
+
value: 0.9933333333333333
|
| 32 |
name: Accuracy
|
| 33 |
- type: accuracy_threshold
|
| 34 |
+
value: 0.16204833984375
|
| 35 |
name: Accuracy Threshold
|
| 36 |
- type: f1
|
| 37 |
+
value: 0.9932885906040269
|
| 38 |
name: F1
|
| 39 |
- type: f1_threshold
|
| 40 |
+
value: 0.16204833984375
|
| 41 |
name: F1 Threshold
|
| 42 |
- type: precision
|
| 43 |
+
value: 1.0
|
| 44 |
name: Precision
|
| 45 |
- type: recall
|
| 46 |
+
value: 0.9866666666666667
|
| 47 |
name: Recall
|
| 48 |
- type: average_precision
|
| 49 |
+
value: 0.9992144440924928
|
| 50 |
name: Average Precision
|
| 51 |
- task:
|
| 52 |
type: cross-encoder-binary-classification
|
|
|
|
| 56 |
type: train_subset
|
| 57 |
metrics:
|
| 58 |
- type: accuracy
|
| 59 |
+
value: 0.976
|
| 60 |
name: Accuracy
|
| 61 |
- type: accuracy_threshold
|
| 62 |
+
value: 0.599609375
|
| 63 |
name: Accuracy Threshold
|
| 64 |
- type: f1
|
| 65 |
+
value: 0.9770992366412214
|
| 66 |
name: F1
|
| 67 |
- type: f1_threshold
|
| 68 |
+
value: 0.599609375
|
| 69 |
name: F1 Threshold
|
| 70 |
- type: precision
|
| 71 |
+
value: 0.973384030418251
|
| 72 |
name: Precision
|
| 73 |
- type: recall
|
| 74 |
+
value: 0.9808429118773946
|
| 75 |
name: Recall
|
| 76 |
- type: average_precision
|
| 77 |
+
value: 0.9928588723194676
|
| 78 |
name: Average Precision
|
| 79 |
---
|
| 80 |
|
|
|
|
| 118 |
model = CrossEncoder("cross_encoder_model_id")
|
| 119 |
# Get scores for pairs of texts
|
| 120 |
pairs = [
|
| 121 |
+
['Paloma and Monkey Gland, are what type of item?', "Monkey Gland. The Monkey Gland is a cocktail of gin, orange juice, grenadine and absinthe created in the 1920s by Harry MacElhone, owner of Harry's New York Bar in Paris, France."],
|
| 122 |
+
['Tess Asplund fought against the Neo-Nazi movement that existed in which countries?', 'Tess Asplund. Tess Asplund, born 1974, is a Swedish activist who gained attention following her protest against neo-Nazis in Borlänge, Sweden. David Lagerlof is the photographer of the viral image of Asplund, which shows her facing uniformed members of the Swedish Nordic Resistance Movement with her fist in the air. She is originally from Colombia and describes herself as Afro-Swedish. About the incident, Asplund is quoted as having said “If this picture of me can get more people to dare to show resistance, then it’s all good...the people must unite and show that it is not okay that racism is becoming normalised and that fascists are running around on our streets.”'],
|
| 123 |
+
['Which magazine, Arizona Highways or Adventist World, is published by Herald Publishing Association?', 'My Worlds: The Collection. My Worlds: The Collection is the first compilation album released by Canadian recording artist Justin Bieber. As the international alternative to the Walmart and Sam\'s Club exclusive "My Worlds Acoustic" (2010), "My Worlds: The Collection" was released in numerous European countries on November 19, 2010. The album consists of two discs; the first is a slightly altered version of "My Worlds Acoustic", and the second is "My Worlds", a compilation itself made up of "My World" (2009) and "My World 2.0" (2010). In addition, the album also features a new song, an inspirational ballad entitled "Pray", a Jaden Smith collaboration, "Never Say Never", and remixes of "Somebody to Love". The new versions of the songs were produced by Bieber\'s music director, Dan Kanter, his vocal producer Kuk Harrell, and also producer Rob Wells. While most reviewers complimented the set , several thought that its release was unneeded. The album charted moderately in Europe, reaching the top half of several album charts.'],
|
| 124 |
+
['Who made the sculpture of the an American professional baseball player and manager regarded as one of the greatest players in baseball history?', 'Ted Williams. Theodore Samuel Williams (August 30, 1918 – July 5, 2002) was an American professional baseball player and manager. He played his entire 19-year Major League Baseball (MLB) career as a left fielder for the Boston Red Sox from 1939 to 1960, only interrupted by service time during World War II and the Korean War. Nicknamed "The Kid", "The Splendid Splinter", "Teddy Ballgame", "The Thumper", and "The Greatest Hitter Who Ever Lived", Williams is regarded as one of the greatest players in baseball history. Williams was also an outstanding fielder, especially in the difficult left field of Fenway Park in Boston, where he played his entire Major League career at that position.'],
|
| 125 |
+
['Paul-Werner Krapke is notable for his management of a main battle tank developed by who?', 'Paul-Werner Krapke. Paul-Werner Krapke (born 1915) is a German armored fighting vehicle engineer, notable for his management of the Leopard 2 project.'],
|
| 126 |
]
|
| 127 |
scores = model.predict(pairs)
|
| 128 |
print(scores.shape)
|
|
|
|
| 130 |
|
| 131 |
# Or rank different texts based on similarity to a single text
|
| 132 |
ranks = model.rank(
|
| 133 |
+
'Paloma and Monkey Gland, are what type of item?',
|
| 134 |
[
|
| 135 |
+
"Monkey Gland. The Monkey Gland is a cocktail of gin, orange juice, grenadine and absinthe created in the 1920s by Harry MacElhone, owner of Harry's New York Bar in Paris, France.",
|
| 136 |
+
'Tess Asplund. Tess Asplund, born 1974, is a Swedish activist who gained attention following her protest against neo-Nazis in Borlänge, Sweden. David Lagerlof is the photographer of the viral image of Asplund, which shows her facing uniformed members of the Swedish Nordic Resistance Movement with her fist in the air. She is originally from Colombia and describes herself as Afro-Swedish. About the incident, Asplund is quoted as having said “If this picture of me can get more people to dare to show resistance, then it’s all good...the people must unite and show that it is not okay that racism is becoming normalised and that fascists are running around on our streets.”',
|
| 137 |
+
'My Worlds: The Collection. My Worlds: The Collection is the first compilation album released by Canadian recording artist Justin Bieber. As the international alternative to the Walmart and Sam\'s Club exclusive "My Worlds Acoustic" (2010), "My Worlds: The Collection" was released in numerous European countries on November 19, 2010. The album consists of two discs; the first is a slightly altered version of "My Worlds Acoustic", and the second is "My Worlds", a compilation itself made up of "My World" (2009) and "My World 2.0" (2010). In addition, the album also features a new song, an inspirational ballad entitled "Pray", a Jaden Smith collaboration, "Never Say Never", and remixes of "Somebody to Love". The new versions of the songs were produced by Bieber\'s music director, Dan Kanter, his vocal producer Kuk Harrell, and also producer Rob Wells. While most reviewers complimented the set , several thought that its release was unneeded. The album charted moderately in Europe, reaching the top half of several album charts.',
|
| 138 |
+
'Ted Williams. Theodore Samuel Williams (August 30, 1918 – July 5, 2002) was an American professional baseball player and manager. He played his entire 19-year Major League Baseball (MLB) career as a left fielder for the Boston Red Sox from 1939 to 1960, only interrupted by service time during World War II and the Korean War. Nicknamed "The Kid", "The Splendid Splinter", "Teddy Ballgame", "The Thumper", and "The Greatest Hitter Who Ever Lived", Williams is regarded as one of the greatest players in baseball history. Williams was also an outstanding fielder, especially in the difficult left field of Fenway Park in Boston, where he played his entire Major League career at that position.',
|
| 139 |
+
'Paul-Werner Krapke. Paul-Werner Krapke (born 1915) is a German armored fighting vehicle engineer, notable for his management of the Leopard 2 project.',
|
| 140 |
]
|
| 141 |
)
|
| 142 |
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
|
|
|
|
| 177 |
|
| 178 |
| Metric | validation | train_subset |
|
| 179 |
|:----------------------|:-----------|:-------------|
|
| 180 |
+
| accuracy | 0.9933 | 0.976 |
|
| 181 |
+
| accuracy_threshold | 0.162 | 0.5996 |
|
| 182 |
+
| f1 | 0.9933 | 0.9771 |
|
| 183 |
+
| f1_threshold | 0.162 | 0.5996 |
|
| 184 |
+
| precision | 1.0 | 0.9734 |
|
| 185 |
+
| recall | 0.9867 | 0.9808 |
|
| 186 |
+
| **average_precision** | **0.9992** | **0.9929** |
|
| 187 |
|
| 188 |
<!--
|
| 189 |
## Bias, Risks and Limitations
|
|
|
|
| 209 |
| | sentence_0 | sentence_1 | label |
|
| 210 |
|:--------|:-------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------|:---------------------------------------------------------------|
|
| 211 |
| type | string | string | float |
|
| 212 |
+
| details | <ul><li>min: 35 characters</li><li>mean: 103.16 characters</li><li>max: 498 characters</li></ul> | <ul><li>min: 74 characters</li><li>mean: 550.07 characters</li><li>max: 2501 characters</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.51</li><li>max: 1.0</li></ul> |
|
| 213 |
* Samples:
|
| 214 |
+
| sentence_0 | sentence_1 | label |
|
| 215 |
+
|:-----------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------|
|
| 216 |
+
| <code>Paloma and Monkey Gland, are what type of item?</code> | <code>Monkey Gland. The Monkey Gland is a cocktail of gin, orange juice, grenadine and absinthe created in the 1920s by Harry MacElhone, owner of Harry's New York Bar in Paris, France.</code> | <code>1.0</code> |
|
| 217 |
+
| <code>Tess Asplund fought against the Neo-Nazi movement that existed in which countries?</code> | <code>Tess Asplund. Tess Asplund, born 1974, is a Swedish activist who gained attention following her protest against neo-Nazis in Borlänge, Sweden. David Lagerlof is the photographer of the viral image of Asplund, which shows her facing uniformed members of the Swedish Nordic Resistance Movement with her fist in the air. She is originally from Colombia and describes herself as Afro-Swedish. About the incident, Asplund is quoted as having said “If this picture of me can get more people to dare to show resistance, then it’s all good...the people must unite and show that it is not okay that racism is becoming normalised and that fascists are running around on our streets.”</code> | <code>1.0</code> |
|
| 218 |
+
| <code>Which magazine, Arizona Highways or Adventist World, is published by Herald Publishing Association?</code> | <code>My Worlds: The Collection. My Worlds: The Collection is the first compilation album released by Canadian recording artist Justin Bieber. As the international alternative to the Walmart and Sam's Club exclusive "My Worlds Acoustic" (2010), "My Worlds: The Collection" was released in numerous European countries on November 19, 2010. The album consists of two discs; the first is a slightly altered version of "My Worlds Acoustic", and the second is "My Worlds", a compilation itself made up of "My World" (2009) and "My World 2.0" (2010). In addition, the album also features a new song, an inspirational ballad entitled "Pray", a Jaden Smith collaboration, "Never Say Never", and remixes of "Somebody to Love". The new versions of the songs were produced by Bieber's music director, Dan Kanter, his vocal producer Kuk Harrell, and also producer Rob Wells. While most reviewers complimented the set , several thought that its release was unneeded. The album charted moderately in Europe, reachi...</code> | <code>0.0</code> |
|
| 219 |
* Loss: [<code>BinaryCrossEntropyLoss</code>](https://sbert.net/docs/package_reference/cross_encoder/losses.html#binarycrossentropyloss) with these parameters:
|
| 220 |
```json
|
| 221 |
{
|
|
|
|
| 354 |
### Training Logs
|
| 355 |
| Epoch | Step | Training Loss | validation_average_precision | train_subset_average_precision |
|
| 356 |
|:-----:|:----:|:-------------:|:----------------------------:|:------------------------------:|
|
| 357 |
+
| 0.125 | 250 | - | 0.9988 | 0.9896 |
|
| 358 |
+
| 0.25 | 500 | 0.2247 | 0.9989 | 0.9896 |
|
| 359 |
+
| 0.375 | 750 | - | 0.9988 | 0.9918 |
|
| 360 |
+
| 0.5 | 1000 | 0.2255 | 0.9992 | 0.9929 |
|
|
|
|
|
|
|
|
|
|
| 361 |
|
| 362 |
|
| 363 |
### Framework Versions
|
config.json
CHANGED
|
@@ -30,7 +30,7 @@
|
|
| 30 |
"activation_fn": "torch.nn.modules.activation.Sigmoid",
|
| 31 |
"version": "5.2.2"
|
| 32 |
},
|
| 33 |
-
"torch_dtype": "
|
| 34 |
"transformers_version": "4.44.2",
|
| 35 |
"type_vocab_size": 1,
|
| 36 |
"use_cache": true,
|
|
|
|
| 30 |
"activation_fn": "torch.nn.modules.activation.Sigmoid",
|
| 31 |
"version": "5.2.2"
|
| 32 |
},
|
| 33 |
+
"torch_dtype": "bfloat16",
|
| 34 |
"transformers_version": "4.44.2",
|
| 35 |
"type_vocab_size": 1,
|
| 36 |
"use_cache": true,
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:43baf54c79f0f0cbd34a6f24f8179ec5397b7c698c356ab5dfc7ef80ef4e0308
|
| 3 |
+
size 1135560090
|