Add new SentenceTransformer model
Browse files- 1_Pooling/config.json +2 -2
- README.md +20 -20
- config_sentence_transformers.json +2 -2
- model.safetensors +1 -1
- tokenizer_config.json +1 -1
1_Pooling/config.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"word_embedding_dimension": 768,
|
| 3 |
-
"pooling_mode_cls_token":
|
| 4 |
-
"pooling_mode_mean_tokens":
|
| 5 |
"pooling_mode_max_tokens": false,
|
| 6 |
"pooling_mode_mean_sqrt_len_tokens": false,
|
| 7 |
"pooling_mode_weightedmean_tokens": false,
|
|
|
|
| 1 |
{
|
| 2 |
"word_embedding_dimension": 768,
|
| 3 |
+
"pooling_mode_cls_token": false,
|
| 4 |
+
"pooling_mode_mean_tokens": true,
|
| 5 |
"pooling_mode_max_tokens": false,
|
| 6 |
"pooling_mode_mean_sqrt_len_tokens": false,
|
| 7 |
"pooling_mode_weightedmean_tokens": false,
|
README.md
CHANGED
|
@@ -14,7 +14,7 @@ tags:
|
|
| 14 |
- generated_from_trainer
|
| 15 |
- dataset_size:1451941
|
| 16 |
- loss:MultipleNegativesRankingLoss
|
| 17 |
-
base_model:
|
| 18 |
widget:
|
| 19 |
- source_sentence: Gocharya ji authored Krishna Cahrit Manas in the poetic form describing
|
| 20 |
about the full life of Lord Krishna ( from birth to Nirvana ) .
|
|
@@ -76,34 +76,34 @@ model-index:
|
|
| 76 |
type: train
|
| 77 |
metrics:
|
| 78 |
- type: cosine_accuracy@1
|
| 79 |
-
value: 0.
|
| 80 |
name: Cosine Accuracy@1
|
| 81 |
- type: cosine_precision@1
|
| 82 |
-
value: 0.
|
| 83 |
name: Cosine Precision@1
|
| 84 |
- type: cosine_recall@1
|
| 85 |
-
value: 0.
|
| 86 |
name: Cosine Recall@1
|
| 87 |
- type: cosine_ndcg@10
|
| 88 |
-
value: 0.
|
| 89 |
name: Cosine Ndcg@10
|
| 90 |
- type: cosine_mrr@1
|
| 91 |
-
value: 0.
|
| 92 |
name: Cosine Mrr@1
|
| 93 |
- type: cosine_map@100
|
| 94 |
-
value: 0.
|
| 95 |
name: Cosine Map@100
|
| 96 |
---
|
| 97 |
|
| 98 |
# Redis fine-tuned BiEncoder model for semantic caching on LangCache
|
| 99 |
|
| 100 |
-
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [
|
| 101 |
|
| 102 |
## Model Details
|
| 103 |
|
| 104 |
### Model Description
|
| 105 |
- **Model Type:** Sentence Transformer
|
| 106 |
-
- **Base model:** [
|
| 107 |
- **Maximum Sequence Length:** 100 tokens
|
| 108 |
- **Output Dimensionality:** 768 dimensions
|
| 109 |
- **Similarity Function:** Cosine Similarity
|
|
@@ -123,7 +123,7 @@ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [A
|
|
| 123 |
```
|
| 124 |
SentenceTransformer(
|
| 125 |
(0): Transformer({'max_seq_length': 100, 'do_lower_case': False, 'architecture': 'ModernBertModel'})
|
| 126 |
-
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token':
|
| 127 |
)
|
| 128 |
```
|
| 129 |
|
|
@@ -156,9 +156,9 @@ print(embeddings.shape)
|
|
| 156 |
# Get the similarity scores for the embeddings
|
| 157 |
similarities = model.similarity(embeddings, embeddings)
|
| 158 |
print(similarities)
|
| 159 |
-
# tensor([[0.9961, 0.9922, 0.
|
| 160 |
-
# [0.9922, 1.0000, 0.
|
| 161 |
-
# [0.
|
| 162 |
```
|
| 163 |
|
| 164 |
<!--
|
|
@@ -196,12 +196,12 @@ You can finetune this model on your own dataset.
|
|
| 196 |
|
| 197 |
| Metric | Value |
|
| 198 |
|:-------------------|:-----------|
|
| 199 |
-
| cosine_accuracy@1 | 0.
|
| 200 |
-
| cosine_precision@1 | 0.
|
| 201 |
-
| cosine_recall@1 | 0.
|
| 202 |
-
| **cosine_ndcg@10** | **0.
|
| 203 |
-
| cosine_mrr@1 | 0.
|
| 204 |
-
| cosine_map@100 | 0.
|
| 205 |
|
| 206 |
<!--
|
| 207 |
## Bias, Risks and Limitations
|
|
@@ -274,7 +274,7 @@ You can finetune this model on your own dataset.
|
|
| 274 |
### Training Logs
|
| 275 |
| Epoch | Step | train_cosine_ndcg@10 |
|
| 276 |
|:-----:|:----:|:--------------------:|
|
| 277 |
-
| -1 | -1 | 0.
|
| 278 |
|
| 279 |
|
| 280 |
### Framework Versions
|
|
|
|
| 14 |
- generated_from_trainer
|
| 15 |
- dataset_size:1451941
|
| 16 |
- loss:MultipleNegativesRankingLoss
|
| 17 |
+
base_model: answerdotai/ModernBERT-base
|
| 18 |
widget:
|
| 19 |
- source_sentence: Gocharya ji authored Krishna Cahrit Manas in the poetic form describing
|
| 20 |
about the full life of Lord Krishna ( from birth to Nirvana ) .
|
|
|
|
| 76 |
type: train
|
| 77 |
metrics:
|
| 78 |
- type: cosine_accuracy@1
|
| 79 |
+
value: 0.37778739987010174
|
| 80 |
name: Cosine Accuracy@1
|
| 81 |
- type: cosine_precision@1
|
| 82 |
+
value: 0.37778739987010174
|
| 83 |
name: Cosine Precision@1
|
| 84 |
- type: cosine_recall@1
|
| 85 |
+
value: 0.36103963757730806
|
| 86 |
name: Cosine Recall@1
|
| 87 |
- type: cosine_ndcg@10
|
| 88 |
+
value: 0.5622280163193171
|
| 89 |
name: Cosine Ndcg@10
|
| 90 |
- type: cosine_mrr@1
|
| 91 |
+
value: 0.37778739987010174
|
| 92 |
name: Cosine Mrr@1
|
| 93 |
- type: cosine_map@100
|
| 94 |
+
value: 0.5081953861443469
|
| 95 |
name: Cosine Map@100
|
| 96 |
---
|
| 97 |
|
| 98 |
# Redis fine-tuned BiEncoder model for semantic caching on LangCache
|
| 99 |
|
| 100 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) on the [LangCache Sentence Pairs (all)](https://huggingface.co/datasets/redis/langcache-sentencepairs-v1) dataset. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for sentence pair similarity.
|
| 101 |
|
| 102 |
## Model Details
|
| 103 |
|
| 104 |
### Model Description
|
| 105 |
- **Model Type:** Sentence Transformer
|
| 106 |
+
- **Base model:** [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) <!-- at revision 8949b909ec900327062f0ebf497f51aef5e6f0c8 -->
|
| 107 |
- **Maximum Sequence Length:** 100 tokens
|
| 108 |
- **Output Dimensionality:** 768 dimensions
|
| 109 |
- **Similarity Function:** Cosine Similarity
|
|
|
|
| 123 |
```
|
| 124 |
SentenceTransformer(
|
| 125 |
(0): Transformer({'max_seq_length': 100, 'do_lower_case': False, 'architecture': 'ModernBertModel'})
|
| 126 |
+
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
|
| 127 |
)
|
| 128 |
```
|
| 129 |
|
|
|
|
| 156 |
# Get the similarity scores for the embeddings
|
| 157 |
similarities = model.similarity(embeddings, embeddings)
|
| 158 |
print(similarities)
|
| 159 |
+
# tensor([[0.9961, 0.9922, 0.9922],
|
| 160 |
+
# [0.9922, 1.0000, 0.9961],
|
| 161 |
+
# [0.9922, 0.9961, 1.0000]], dtype=torch.bfloat16)
|
| 162 |
```
|
| 163 |
|
| 164 |
<!--
|
|
|
|
| 196 |
|
| 197 |
| Metric | Value |
|
| 198 |
|:-------------------|:-----------|
|
| 199 |
+
| cosine_accuracy@1 | 0.3778 |
|
| 200 |
+
| cosine_precision@1 | 0.3778 |
|
| 201 |
+
| cosine_recall@1 | 0.361 |
|
| 202 |
+
| **cosine_ndcg@10** | **0.5622** |
|
| 203 |
+
| cosine_mrr@1 | 0.3778 |
|
| 204 |
+
| cosine_map@100 | 0.5082 |
|
| 205 |
|
| 206 |
<!--
|
| 207 |
## Bias, Risks and Limitations
|
|
|
|
| 274 |
### Training Logs
|
| 275 |
| Epoch | Step | train_cosine_ndcg@10 |
|
| 276 |
|:-----:|:----:|:--------------------:|
|
| 277 |
+
| -1 | -1 | 0.5622 |
|
| 278 |
|
| 279 |
|
| 280 |
### Framework Versions
|
config_sentence_transformers.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"__version__": {
|
| 3 |
"sentence_transformers": "5.1.0",
|
| 4 |
"transformers": "4.56.0",
|
|
@@ -9,6 +10,5 @@
|
|
| 9 |
"document": ""
|
| 10 |
},
|
| 11 |
"default_prompt_name": null,
|
| 12 |
-
"similarity_fn_name": "cosine"
|
| 13 |
-
"model_type": "SentenceTransformer"
|
| 14 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"model_type": "SentenceTransformer",
|
| 3 |
"__version__": {
|
| 4 |
"sentence_transformers": "5.1.0",
|
| 5 |
"transformers": "4.56.0",
|
|
|
|
| 10 |
"document": ""
|
| 11 |
},
|
| 12 |
"default_prompt_name": null,
|
| 13 |
+
"similarity_fn_name": "cosine"
|
|
|
|
| 14 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 298041696
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:49130ca9bb82456b8d7d77dc9819d74b11864b9d854ef1eff2ed157e37bc1afe
|
| 3 |
size 298041696
|
tokenizer_config.json
CHANGED
|
@@ -938,7 +938,7 @@
|
|
| 938 |
"input_ids",
|
| 939 |
"attention_mask"
|
| 940 |
],
|
| 941 |
-
"model_max_length":
|
| 942 |
"pad_token": "[PAD]",
|
| 943 |
"sep_token": "[SEP]",
|
| 944 |
"tokenizer_class": "PreTrainedTokenizerFast",
|
|
|
|
| 938 |
"input_ids",
|
| 939 |
"attention_mask"
|
| 940 |
],
|
| 941 |
+
"model_max_length": 8192,
|
| 942 |
"pad_token": "[PAD]",
|
| 943 |
"sep_token": "[SEP]",
|
| 944 |
"tokenizer_class": "PreTrainedTokenizerFast",
|