Text Ranking
sentence-transformers
Safetensors
deberta-v2
cross-encoder
reranker
Generated from Trainer
dataset_size:7419
loss:BinaryCrossEntropyLoss
Eval Results (legacy)
text-embeddings-inference
Instructions to use ColeH0415/comp90042-crossencoder-factcheck with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use ColeH0415/comp90042-crossencoder-factcheck with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("ColeH0415/comp90042-crossencoder-factcheck") 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
CE fine-tuned epoch 2/3 best_val=0.5733
Browse files- README.md +34 -34
- model.safetensors +1 -1
README.md
CHANGED
|
@@ -28,25 +28,25 @@ model-index:
|
|
| 28 |
type: ce-val
|
| 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: 0.
|
| 44 |
name: Precision
|
| 45 |
- type: recall
|
| 46 |
-
value: 0.
|
| 47 |
name: Recall
|
| 48 |
- type: average_precision
|
| 49 |
-
value: 0.
|
| 50 |
name: Average Precision
|
| 51 |
---
|
| 52 |
|
|
@@ -99,25 +99,25 @@ from sentence_transformers import CrossEncoder
|
|
| 99 |
model = CrossEncoder("cross_encoder_model_id")
|
| 100 |
# Get scores for pairs of inputs
|
| 101 |
pairs = [
|
| 102 |
-
['The last time the planet was even four degrees warmer, Peter Brannen points out in The Ends of the World, his new history of the planet’s major extinction events, the oceans were hundreds of feet higher.', '
|
| 103 |
-
[
|
| 104 |
-
['
|
| 105 |
-
['
|
| 106 |
-
['
|
| 107 |
]
|
| 108 |
scores = model.predict(pairs)
|
| 109 |
print(scores)
|
| 110 |
-
# [0.
|
| 111 |
|
| 112 |
# Or rank different texts based on similarity to a single text
|
| 113 |
ranks = model.rank(
|
| 114 |
'The last time the planet was even four degrees warmer, Peter Brannen points out in The Ends of the World, his new history of the planet’s major extinction events, the oceans were hundreds of feet higher.',
|
| 115 |
[
|
| 116 |
-
'
|
| 117 |
-
'
|
| 118 |
-
'
|
| 119 |
-
'
|
| 120 |
-
'
|
| 121 |
]
|
| 122 |
)
|
| 123 |
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
|
|
@@ -156,15 +156,15 @@ You can finetune this model on your own dataset.
|
|
| 156 |
* Dataset: `ce-val`
|
| 157 |
* Evaluated with [<code>CrossEncoderClassificationEvaluator</code>](https://sbert.net/docs/package_reference/cross_encoder/evaluation.html#sentence_transformers.cross_encoder.evaluation.CrossEncoderClassificationEvaluator)
|
| 158 |
|
| 159 |
-
| Metric | Value
|
| 160 |
-
|:----------------------|:----------
|
| 161 |
-
| accuracy | 0.
|
| 162 |
-
| accuracy_threshold | 0.
|
| 163 |
-
| f1 | 0.
|
| 164 |
-
| f1_threshold | 0.
|
| 165 |
-
| precision | 0.5037
|
| 166 |
-
| recall | 0.
|
| 167 |
-
| **average_precision** | **0.
|
| 168 |
|
| 169 |
<!--
|
| 170 |
## Bias, Risks and Limitations
|
|
@@ -190,13 +190,13 @@ You can finetune this model on your own dataset.
|
|
| 190 |
| | sentence_0 | sentence_1 | label |
|
| 191 |
|:--------|:----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:---------------------------------------------------------------|
|
| 192 |
| type | string | string | float |
|
| 193 |
-
| details | <ul><li>min: 7 tokens</li><li>mean: 26.
|
| 194 |
* Samples:
|
| 195 |
-
| sentence_0 | sentence_1
|
| 196 |
-
|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------|
|
| 197 |
-
| <code>The last time the planet was even four degrees warmer, Peter Brannen points out in The Ends of the World, his new history of the planet’s major extinction events, the oceans were hundreds of feet higher.</code> | <code>
|
| 198 |
-
| <code>
|
| 199 |
-
| <code>
|
| 200 |
* Loss: [<code>BinaryCrossEntropyLoss</code>](https://sbert.net/docs/package_reference/cross_encoder/losses.html#binarycrossentropyloss) with these parameters:
|
| 201 |
```json
|
| 202 |
{
|
|
@@ -318,7 +318,7 @@ You can finetune this model on your own dataset.
|
|
| 318 |
### Training Logs
|
| 319 |
| Epoch | Step | ce-val_average_precision |
|
| 320 |
|:-----:|:----:|:------------------------:|
|
| 321 |
-
| -1 | -1 | 0.
|
| 322 |
|
| 323 |
|
| 324 |
### Training Time
|
|
|
|
| 28 |
type: ce-val
|
| 29 |
metrics:
|
| 30 |
- type: accuracy
|
| 31 |
+
value: 0.5733333333333334
|
| 32 |
name: Accuracy
|
| 33 |
- type: accuracy_threshold
|
| 34 |
+
value: 0.5057904720306396
|
| 35 |
name: Accuracy Threshold
|
| 36 |
- type: f1
|
| 37 |
+
value: 0.669374492282697
|
| 38 |
name: F1
|
| 39 |
- type: f1_threshold
|
| 40 |
+
value: 0.45144930481910706
|
| 41 |
name: F1 Threshold
|
| 42 |
- type: precision
|
| 43 |
+
value: 0.5036674816625917
|
| 44 |
name: Precision
|
| 45 |
- type: recall
|
| 46 |
+
value: 0.9975786924939467
|
| 47 |
name: Recall
|
| 48 |
- type: average_precision
|
| 49 |
+
value: 0.5550313029987005
|
| 50 |
name: Average Precision
|
| 51 |
---
|
| 52 |
|
|
|
|
| 99 |
model = CrossEncoder("cross_encoder_model_id")
|
| 100 |
# Get scores for pairs of inputs
|
| 101 |
pairs = [
|
| 102 |
+
['The last time the planet was even four degrees warmer, Peter Brannen points out in The Ends of the World, his new history of the planet’s major extinction events, the oceans were hundreds of feet higher.', 'Almost all scientists acknowledge that the rate of species loss is greater now than at any time in human history, with extinctions occurring at rates hundreds of times higher than background extinction rates.'],
|
| 103 |
+
['[S]unspot activity on the surface of our star has dropped to a new low.', 'It has a regular activity cycle of starspots.'],
|
| 104 |
+
['More money is dedicated within the Department of Homeland Security to climate change than what\'s spent combating "Islamist terrorists radicalizing over the Internet in the United States of America."', 'Homeland security is officially defined by the National Strategy for Homeland Security as "a concerted national effort to prevent terrorist attacks within the United States, reduce America\'s vulnerability to terrorism, and minimize the damage and recover from attacks that do occur".'],
|
| 105 |
+
['Worst-case global heating scenarios may need to be revised upwards in light of a better understanding of the role of clouds, scientists have said.', 'Results from the CERES and other NASA missions, such as the Earth Radiation Budget Experiment (ERBE), could lead to a better understanding of the role of clouds and the energy cycle in global climate change.'],
|
| 106 |
+
['Prof Adam Scaife, a climate modelling expert at the UK’s Met Office, said the evidence for a link to shrinking Arctic ice was now good: ‘The consensus points towards that being a real effect.’”', 'Some models of modern climate exhibit Arctic amplification without changes in snow and ice cover.'],
|
| 107 |
]
|
| 108 |
scores = model.predict(pairs)
|
| 109 |
print(scores)
|
| 110 |
+
# [0.5149 0.4764 0.5282 0.5084 0.5007]
|
| 111 |
|
| 112 |
# Or rank different texts based on similarity to a single text
|
| 113 |
ranks = model.rank(
|
| 114 |
'The last time the planet was even four degrees warmer, Peter Brannen points out in The Ends of the World, his new history of the planet’s major extinction events, the oceans were hundreds of feet higher.',
|
| 115 |
[
|
| 116 |
+
'Almost all scientists acknowledge that the rate of species loss is greater now than at any time in human history, with extinctions occurring at rates hundreds of times higher than background extinction rates.',
|
| 117 |
+
'It has a regular activity cycle of starspots.',
|
| 118 |
+
'Homeland security is officially defined by the National Strategy for Homeland Security as "a concerted national effort to prevent terrorist attacks within the United States, reduce America\'s vulnerability to terrorism, and minimize the damage and recover from attacks that do occur".',
|
| 119 |
+
'Results from the CERES and other NASA missions, such as the Earth Radiation Budget Experiment (ERBE), could lead to a better understanding of the role of clouds and the energy cycle in global climate change.',
|
| 120 |
+
'Some models of modern climate exhibit Arctic amplification without changes in snow and ice cover.',
|
| 121 |
]
|
| 122 |
)
|
| 123 |
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
|
|
|
|
| 156 |
* Dataset: `ce-val`
|
| 157 |
* Evaluated with [<code>CrossEncoderClassificationEvaluator</code>](https://sbert.net/docs/package_reference/cross_encoder/evaluation.html#sentence_transformers.cross_encoder.evaluation.CrossEncoderClassificationEvaluator)
|
| 158 |
|
| 159 |
+
| Metric | Value |
|
| 160 |
+
|:----------------------|:----------|
|
| 161 |
+
| accuracy | 0.5733 |
|
| 162 |
+
| accuracy_threshold | 0.5058 |
|
| 163 |
+
| f1 | 0.6694 |
|
| 164 |
+
| f1_threshold | 0.4514 |
|
| 165 |
+
| precision | 0.5037 |
|
| 166 |
+
| recall | 0.9976 |
|
| 167 |
+
| **average_precision** | **0.555** |
|
| 168 |
|
| 169 |
<!--
|
| 170 |
## Bias, Risks and Limitations
|
|
|
|
| 190 |
| | sentence_0 | sentence_1 | label |
|
| 191 |
|:--------|:----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:---------------------------------------------------------------|
|
| 192 |
| type | string | string | float |
|
| 193 |
+
| details | <ul><li>min: 7 tokens</li><li>mean: 26.66 tokens</li><li>max: 80 tokens</li></ul> | <ul><li>min: 8 tokens</li><li>mean: 31.95 tokens</li><li>max: 256 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.52</li><li>max: 1.0</li></ul> |
|
| 194 |
* Samples:
|
| 195 |
+
| sentence_0 | sentence_1 | label |
|
| 196 |
+
|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------|
|
| 197 |
+
| <code>The last time the planet was even four degrees warmer, Peter Brannen points out in The Ends of the World, his new history of the planet’s major extinction events, the oceans were hundreds of feet higher.</code> | <code>Almost all scientists acknowledge that the rate of species loss is greater now than at any time in human history, with extinctions occurring at rates hundreds of times higher than background extinction rates.</code> | <code>0.0</code> |
|
| 198 |
+
| <code>[S]unspot activity on the surface of our star has dropped to a new low.</code> | <code>It has a regular activity cycle of starspots.</code> | <code>1.0</code> |
|
| 199 |
+
| <code>More money is dedicated within the Department of Homeland Security to climate change than what's spent combating "Islamist terrorists radicalizing over the Internet in the United States of America."</code> | <code>Homeland security is officially defined by the National Strategy for Homeland Security as "a concerted national effort to prevent terrorist attacks within the United States, reduce America's vulnerability to terrorism, and minimize the damage and recover from attacks that do occur".</code> | <code>1.0</code> |
|
| 200 |
* Loss: [<code>BinaryCrossEntropyLoss</code>](https://sbert.net/docs/package_reference/cross_encoder/losses.html#binarycrossentropyloss) with these parameters:
|
| 201 |
```json
|
| 202 |
{
|
|
|
|
| 318 |
### Training Logs
|
| 319 |
| Epoch | Step | ce-val_average_precision |
|
| 320 |
|:-----:|:----:|:------------------------:|
|
| 321 |
+
| -1 | -1 | 0.5550 |
|
| 322 |
|
| 323 |
|
| 324 |
### Training Time
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 737716172
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c881c82d69a63589526eb988bc70667f516ac3a14e3d074e3d03833047c913b8
|
| 3 |
size 737716172
|