Add new SentenceTransformer model
Browse files- README.md +70 -71
- config.json +1 -1
README.md
CHANGED
|
@@ -12,51 +12,50 @@ tags:
|
|
| 12 |
- retrieval
|
| 13 |
- reranking
|
| 14 |
- generated_from_trainer
|
| 15 |
-
- dataset_size:
|
| 16 |
- loss:ArcFaceInBatchLoss
|
| 17 |
base_model: answerdotai/ModernBERT-large
|
| 18 |
widget:
|
| 19 |
-
- source_sentence:
|
| 20 |
-
All My Children `` , between 1990 and 2002 .
|
| 21 |
sentences:
|
| 22 |
-
-
|
| 23 |
-
|
| 24 |
-
-
|
| 25 |
-
|
| 26 |
-
-
|
| 27 |
-
|
| 28 |
-
- source_sentence: Olivella monilifera is a species of dwarf sea snail , small gastropod
|
| 29 |
-
mollusk in the family Olivellidae , the marine olives .
|
| 30 |
sentences:
|
| 31 |
-
-
|
| 32 |
-
|
| 33 |
-
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
- source_sentence: Hayashi said that Mackey `` is a sort of `` of the original model
|
| 38 |
-
for Tenchi .
|
| 39 |
sentences:
|
| 40 |
-
-
|
| 41 |
-
|
| 42 |
-
-
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
| 45 |
sentences:
|
| 46 |
-
-
|
| 47 |
-
|
| 48 |
-
-
|
| 49 |
-
|
| 50 |
-
-
|
| 51 |
-
|
| 52 |
-
- source_sentence:
|
| 53 |
-
|
| 54 |
sentences:
|
| 55 |
-
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
|
|
|
| 60 |
datasets:
|
| 61 |
- redis/langcache-sentencepairs-v2
|
| 62 |
pipeline_tag: sentence-similarity
|
|
@@ -81,28 +80,28 @@ model-index:
|
|
| 81 |
type: test
|
| 82 |
metrics:
|
| 83 |
- type: cosine_accuracy@1
|
| 84 |
-
value: 0.
|
| 85 |
name: Cosine Accuracy@1
|
| 86 |
- type: cosine_precision@1
|
| 87 |
-
value: 0.
|
| 88 |
name: Cosine Precision@1
|
| 89 |
- type: cosine_recall@1
|
| 90 |
-
value: 0.
|
| 91 |
name: Cosine Recall@1
|
| 92 |
- type: cosine_ndcg@10
|
| 93 |
-
value: 0.
|
| 94 |
name: Cosine Ndcg@10
|
| 95 |
- type: cosine_mrr@1
|
| 96 |
-
value: 0.
|
| 97 |
name: Cosine Mrr@1
|
| 98 |
- type: cosine_map@100
|
| 99 |
-
value: 0.
|
| 100 |
name: Cosine Map@100
|
| 101 |
- type: cosine_auc_precision_cache_hit_ratio
|
| 102 |
-
value: 0.
|
| 103 |
name: Cosine Auc Precision Cache Hit Ratio
|
| 104 |
- type: cosine_auc_similarity_distribution
|
| 105 |
-
value: 0.
|
| 106 |
name: Cosine Auc Similarity Distribution
|
| 107 |
---
|
| 108 |
|
|
@@ -156,9 +155,9 @@ from sentence_transformers import SentenceTransformer
|
|
| 156 |
model = SentenceTransformer("redis/langcache-embed-experimental")
|
| 157 |
# Run inference
|
| 158 |
sentences = [
|
| 159 |
-
'
|
| 160 |
-
'
|
| 161 |
-
'
|
| 162 |
]
|
| 163 |
embeddings = model.encode(sentences)
|
| 164 |
print(embeddings.shape)
|
|
@@ -167,9 +166,9 @@ print(embeddings.shape)
|
|
| 167 |
# Get the similarity scores for the embeddings
|
| 168 |
similarities = model.similarity(embeddings, embeddings)
|
| 169 |
print(similarities)
|
| 170 |
-
# tensor([[
|
| 171 |
-
# [0.
|
| 172 |
-
# [0.
|
| 173 |
```
|
| 174 |
|
| 175 |
<!--
|
|
@@ -207,14 +206,14 @@ You can finetune this model on your own dataset.
|
|
| 207 |
|
| 208 |
| Metric | Value |
|
| 209 |
|:-------------------------------------|:-----------|
|
| 210 |
-
| cosine_accuracy@1 | 0.
|
| 211 |
-
| cosine_precision@1 | 0.
|
| 212 |
-
| cosine_recall@1 | 0.
|
| 213 |
| **cosine_ndcg@10** | **0.6274** |
|
| 214 |
-
| cosine_mrr@1 | 0.
|
| 215 |
| cosine_map@100 | 0.575 |
|
| 216 |
-
| cosine_auc_precision_cache_hit_ratio | 0.
|
| 217 |
-
| cosine_auc_similarity_distribution | 0.
|
| 218 |
|
| 219 |
<!--
|
| 220 |
## Bias, Risks and Limitations
|
|
@@ -235,19 +234,19 @@ You can finetune this model on your own dataset.
|
|
| 235 |
#### LangCache Sentence Pairs (all)
|
| 236 |
|
| 237 |
* Dataset: [LangCache Sentence Pairs (all)](https://huggingface.co/datasets/redis/langcache-sentencepairs-v2)
|
| 238 |
-
* Size:
|
| 239 |
* Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
|
| 240 |
* Approximate statistics based on the first 1000 samples:
|
| 241 |
| | anchor | positive | negative |
|
| 242 |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
|
| 243 |
| type | string | string | string |
|
| 244 |
-
| details | <ul><li>min: 8 tokens</li><li>mean: 27.
|
| 245 |
* Samples:
|
| 246 |
-
| anchor | positive
|
| 247 |
-
|
| 248 |
-
| <code>The newer Punts are still very much in existence today and race in the same fleets as the older boats .</code> | <code>The newer punts are still very much in existence today and run in the same fleets as the older boats .</code>
|
| 249 |
-
| <code>The newer punts are still very much in existence today and run in the same fleets as the older boats .</code> | <code>The newer Punts are still very much in existence today and race in the same fleets as the older boats .</code>
|
| 250 |
-
| <code>Turner Valley , was at the Turner Valley Bar N Ranch Airport , southwest of the Turner Valley Bar N Ranch , Alberta , Canada .</code> | <code>Turner Valley ,
|
| 251 |
* Loss: <code>losses.ArcFaceInBatchLoss</code> with these parameters:
|
| 252 |
```json
|
| 253 |
{
|
|
@@ -262,19 +261,19 @@ You can finetune this model on your own dataset.
|
|
| 262 |
#### LangCache Sentence Pairs (all)
|
| 263 |
|
| 264 |
* Dataset: [LangCache Sentence Pairs (all)](https://huggingface.co/datasets/redis/langcache-sentencepairs-v2)
|
| 265 |
-
* Size:
|
| 266 |
* Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
|
| 267 |
* Approximate statistics based on the first 1000 samples:
|
| 268 |
| | anchor | positive | negative |
|
| 269 |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
|
| 270 |
| type | string | string | string |
|
| 271 |
-
| details | <ul><li>min: 8 tokens</li><li>mean: 27.
|
| 272 |
* Samples:
|
| 273 |
-
| anchor | positive
|
| 274 |
-
|
| 275 |
-
| <code>The newer Punts are still very much in existence today and race in the same fleets as the older boats .</code> | <code>The newer punts are still very much in existence today and run in the same fleets as the older boats .</code>
|
| 276 |
-
| <code>The newer punts are still very much in existence today and run in the same fleets as the older boats .</code> | <code>The newer Punts are still very much in existence today and race in the same fleets as the older boats .</code>
|
| 277 |
-
| <code>Turner Valley , was at the Turner Valley Bar N Ranch Airport , southwest of the Turner Valley Bar N Ranch , Alberta , Canada .</code> | <code>Turner Valley ,
|
| 278 |
* Loss: <code>losses.ArcFaceInBatchLoss</code> with these parameters:
|
| 279 |
```json
|
| 280 |
{
|
|
|
|
| 12 |
- retrieval
|
| 13 |
- reranking
|
| 14 |
- generated_from_trainer
|
| 15 |
+
- dataset_size:3587
|
| 16 |
- loss:ArcFaceInBatchLoss
|
| 17 |
base_model: answerdotai/ModernBERT-large
|
| 18 |
widget:
|
| 19 |
+
- source_sentence: Hunter College was originally Lehman College 's uptown campus .
|
|
|
|
| 20 |
sentences:
|
| 21 |
+
- Acquired programming includes the Irish soap `` Fair City `` and Finnish drama
|
| 22 |
+
`` Black Widows `` .
|
| 23 |
+
- According to the United States Census Bureau , the town has a total area of ;
|
| 24 |
+
of the area is land and 0.66 % is water .
|
| 25 |
+
- Hunter College originally was Lehman College Uptown Campus .
|
| 26 |
+
- source_sentence: He hoped to defeat them and then marry Ravonna .
|
|
|
|
|
|
|
| 27 |
sentences:
|
| 28 |
+
- Stillwater Creek received its official name in 1884 when William L. Couch established
|
| 29 |
+
his `` boomer colony `` on its banks .
|
| 30 |
+
- Note that the invertible of a matrix is always an exponential matrix .
|
| 31 |
+
- He hoped to defeat them and marry Ravonna .
|
| 32 |
+
- source_sentence: Born on February 2 , 1984 , Abrar Khan is a professional Pakistani
|
| 33 |
+
international Kabaddi player .
|
|
|
|
|
|
|
| 34 |
sentences:
|
| 35 |
+
- Born on February 2 , 1984 , Abrar Khan is a professional Pakistani international
|
| 36 |
+
Kabaddi player .
|
| 37 |
+
- Together , the paired mylohyoid muscles form a muscular floor for the oral cavity
|
| 38 |
+
of the mouth .
|
| 39 |
+
- Abrar Khan born 2 February 1984 is a Pakistani professional international Kabaddi
|
| 40 |
+
player .
|
| 41 |
+
- source_sentence: Certainly , `` Lucy was nothing like flat `` in physical form ,
|
| 42 |
+
social condition , and personality .
|
| 43 |
sentences:
|
| 44 |
+
- The real number is called the `` imaginary part `` of the real number ; the real
|
| 45 |
+
number is called the `` complex part `` of .
|
| 46 |
+
- From the Celebes lake , the captain Bullock observed the appearance of the corona
|
| 47 |
+
, while Gustav Fritsch accompanied an expedition to Aden .
|
| 48 |
+
- Certainly `` Lucy was , in physical form , social condition and personality ,
|
| 49 |
+
nothing like Shallow `` .
|
| 50 |
+
- source_sentence: The trio has performed besides Gesaffelstein , Justice , Bob Moses
|
| 51 |
+
and Lee Foss .
|
| 52 |
sentences:
|
| 53 |
+
- The trio has performed besides Gesaffelstein , Justice , Bob Moses and Lee Foss
|
| 54 |
+
.
|
| 55 |
+
- The suttas generally contain educational content , while other early Buddhist
|
| 56 |
+
texts deal with monastic discipline or vinaya .
|
| 57 |
+
- The trio has performed alongside Bob Moses , Justice , Gesaffelstein and Lee Foss
|
| 58 |
+
.
|
| 59 |
datasets:
|
| 60 |
- redis/langcache-sentencepairs-v2
|
| 61 |
pipeline_tag: sentence-similarity
|
|
|
|
| 80 |
type: test
|
| 81 |
metrics:
|
| 82 |
- type: cosine_accuracy@1
|
| 83 |
+
value: 0.44070346359110285
|
| 84 |
name: Cosine Accuracy@1
|
| 85 |
- type: cosine_precision@1
|
| 86 |
+
value: 0.44070346359110285
|
| 87 |
name: Cosine Precision@1
|
| 88 |
- type: cosine_recall@1
|
| 89 |
+
value: 0.42648577181064024
|
| 90 |
name: Cosine Recall@1
|
| 91 |
- type: cosine_ndcg@10
|
| 92 |
+
value: 0.627438499402098
|
| 93 |
name: Cosine Ndcg@10
|
| 94 |
- type: cosine_mrr@1
|
| 95 |
+
value: 0.44070346359110285
|
| 96 |
name: Cosine Mrr@1
|
| 97 |
- type: cosine_map@100
|
| 98 |
+
value: 0.5750186225138979
|
| 99 |
name: Cosine Map@100
|
| 100 |
- type: cosine_auc_precision_cache_hit_ratio
|
| 101 |
+
value: 0.27246772094744054
|
| 102 |
name: Cosine Auc Precision Cache Hit Ratio
|
| 103 |
- type: cosine_auc_similarity_distribution
|
| 104 |
+
value: 0.40850809564840007
|
| 105 |
name: Cosine Auc Similarity Distribution
|
| 106 |
---
|
| 107 |
|
|
|
|
| 155 |
model = SentenceTransformer("redis/langcache-embed-experimental")
|
| 156 |
# Run inference
|
| 157 |
sentences = [
|
| 158 |
+
'The trio has performed besides Gesaffelstein , Justice , Bob Moses and Lee Foss .',
|
| 159 |
+
'The trio has performed besides Gesaffelstein , Justice , Bob Moses and Lee Foss .',
|
| 160 |
+
'The trio has performed alongside Bob Moses , Justice , Gesaffelstein and Lee Foss .',
|
| 161 |
]
|
| 162 |
embeddings = model.encode(sentences)
|
| 163 |
print(embeddings.shape)
|
|
|
|
| 166 |
# Get the similarity scores for the embeddings
|
| 167 |
similarities = model.similarity(embeddings, embeddings)
|
| 168 |
print(similarities)
|
| 169 |
+
# tensor([[0.9961, 0.9961, 0.9883],
|
| 170 |
+
# [0.9961, 0.9961, 0.9883],
|
| 171 |
+
# [0.9883, 0.9883, 1.0000]], dtype=torch.bfloat16)
|
| 172 |
```
|
| 173 |
|
| 174 |
<!--
|
|
|
|
| 206 |
|
| 207 |
| Metric | Value |
|
| 208 |
|:-------------------------------------|:-----------|
|
| 209 |
+
| cosine_accuracy@1 | 0.4407 |
|
| 210 |
+
| cosine_precision@1 | 0.4407 |
|
| 211 |
+
| cosine_recall@1 | 0.4265 |
|
| 212 |
| **cosine_ndcg@10** | **0.6274** |
|
| 213 |
+
| cosine_mrr@1 | 0.4407 |
|
| 214 |
| cosine_map@100 | 0.575 |
|
| 215 |
+
| cosine_auc_precision_cache_hit_ratio | 0.2725 |
|
| 216 |
+
| cosine_auc_similarity_distribution | 0.4085 |
|
| 217 |
|
| 218 |
<!--
|
| 219 |
## Bias, Risks and Limitations
|
|
|
|
| 234 |
#### LangCache Sentence Pairs (all)
|
| 235 |
|
| 236 |
* Dataset: [LangCache Sentence Pairs (all)](https://huggingface.co/datasets/redis/langcache-sentencepairs-v2)
|
| 237 |
+
* Size: 1,922 training samples
|
| 238 |
* Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
|
| 239 |
* Approximate statistics based on the first 1000 samples:
|
| 240 |
| | anchor | positive | negative |
|
| 241 |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
|
| 242 |
| type | string | string | string |
|
| 243 |
+
| details | <ul><li>min: 8 tokens</li><li>mean: 27.26 tokens</li><li>max: 49 tokens</li></ul> | <ul><li>min: 8 tokens</li><li>mean: 27.24 tokens</li><li>max: 49 tokens</li></ul> | <ul><li>min: 9 tokens</li><li>mean: 27.09 tokens</li><li>max: 49 tokens</li></ul> |
|
| 244 |
* Samples:
|
| 245 |
+
| anchor | positive | negative |
|
| 246 |
+
|:--------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------|
|
| 247 |
+
| <code>The newer Punts are still very much in existence today and race in the same fleets as the older boats .</code> | <code>The newer punts are still very much in existence today and run in the same fleets as the older boats .</code> | <code>At that time , on June 22 , 1754 , Edward Bentham married Bentham Elizabeth Bates ( d . 1790 ) from Hampshire in the nearby county of Alton .</code> |
|
| 248 |
+
| <code>The newer punts are still very much in existence today and run in the same fleets as the older boats .</code> | <code>The newer Punts are still very much in existence today and race in the same fleets as the older boats .</code> | <code>In 2012 , Cornell 5th and Lehigh 8th , Cornell was also 4th in 2013 and 7th in 2014 .</code> |
|
| 249 |
+
| <code>Turner Valley , was at the Turner Valley Bar N Ranch Airport , southwest of the Turner Valley Bar N Ranch , Alberta , Canada .</code> | <code>Turner Valley , was at the Turner Valley Bar N Ranch Airport , southwest of the Turner Valley Bar N Ranch , Alberta , Canada .</code> | <code>Turner Valley Bar N Ranch Airport , , was located at Turner Valley Bar N Ranch , southwest of Turner Valley , Alberta , Canada .</code> |
|
| 250 |
* Loss: <code>losses.ArcFaceInBatchLoss</code> with these parameters:
|
| 251 |
```json
|
| 252 |
{
|
|
|
|
| 261 |
#### LangCache Sentence Pairs (all)
|
| 262 |
|
| 263 |
* Dataset: [LangCache Sentence Pairs (all)](https://huggingface.co/datasets/redis/langcache-sentencepairs-v2)
|
| 264 |
+
* Size: 1,922 evaluation samples
|
| 265 |
* Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
|
| 266 |
* Approximate statistics based on the first 1000 samples:
|
| 267 |
| | anchor | positive | negative |
|
| 268 |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
|
| 269 |
| type | string | string | string |
|
| 270 |
+
| details | <ul><li>min: 8 tokens</li><li>mean: 27.26 tokens</li><li>max: 49 tokens</li></ul> | <ul><li>min: 8 tokens</li><li>mean: 27.24 tokens</li><li>max: 49 tokens</li></ul> | <ul><li>min: 9 tokens</li><li>mean: 27.09 tokens</li><li>max: 49 tokens</li></ul> |
|
| 271 |
* Samples:
|
| 272 |
+
| anchor | positive | negative |
|
| 273 |
+
|:--------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------|
|
| 274 |
+
| <code>The newer Punts are still very much in existence today and race in the same fleets as the older boats .</code> | <code>The newer punts are still very much in existence today and run in the same fleets as the older boats .</code> | <code>At that time , on June 22 , 1754 , Edward Bentham married Bentham Elizabeth Bates ( d . 1790 ) from Hampshire in the nearby county of Alton .</code> |
|
| 275 |
+
| <code>The newer punts are still very much in existence today and run in the same fleets as the older boats .</code> | <code>The newer Punts are still very much in existence today and race in the same fleets as the older boats .</code> | <code>In 2012 , Cornell 5th and Lehigh 8th , Cornell was also 4th in 2013 and 7th in 2014 .</code> |
|
| 276 |
+
| <code>Turner Valley , was at the Turner Valley Bar N Ranch Airport , southwest of the Turner Valley Bar N Ranch , Alberta , Canada .</code> | <code>Turner Valley , was at the Turner Valley Bar N Ranch Airport , southwest of the Turner Valley Bar N Ranch , Alberta , Canada .</code> | <code>Turner Valley Bar N Ranch Airport , , was located at Turner Valley Bar N Ranch , southwest of Turner Valley , Alberta , Canada .</code> |
|
| 277 |
* Loss: <code>losses.ArcFaceInBatchLoss</code> with these parameters:
|
| 278 |
```json
|
| 279 |
{
|
config.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
"classifier_activation": "gelu",
|
| 9 |
"classifier_bias": false,
|
| 10 |
"classifier_dropout": 0.0,
|
| 11 |
-
"classifier_pooling": "
|
| 12 |
"cls_token_id": 50281,
|
| 13 |
"decoder_bias": true,
|
| 14 |
"deterministic_flash_attn": false,
|
|
|
|
| 8 |
"classifier_activation": "gelu",
|
| 9 |
"classifier_bias": false,
|
| 10 |
"classifier_dropout": 0.0,
|
| 11 |
+
"classifier_pooling": "cls",
|
| 12 |
"cls_token_id": 50281,
|
| 13 |
"decoder_bias": true,
|
| 14 |
"deterministic_flash_attn": false,
|