radoslavralev commited on
Commit
f728020
·
verified ·
1 Parent(s): 9734b02

Add new SentenceTransformer model

Browse files
Files changed (3) hide show
  1. 1_Pooling/config.json +3 -3
  2. README.md +374 -82
  3. modules.json +6 -0
1_Pooling/config.json CHANGED
@@ -1,7 +1,7 @@
1
  {
2
- "word_embedding_dimension": 512,
3
- "pooling_mode_cls_token": true,
4
- "pooling_mode_mean_tokens": false,
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": 384,
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
@@ -5,51 +5,232 @@ tags:
5
  - feature-extraction
6
  - dense
7
  - generated_from_trainer
8
- - dataset_size:100000
9
  - loss:MultipleNegativesRankingLoss
10
- base_model: prajjwal1/bert-small
11
  widget:
12
- - source_sentence: How do I polish my English skills?
 
13
  sentences:
14
- - How can we polish English skills?
15
- - Why should I move to Israel as a Jew?
16
- - What are vitamins responsible for?
17
- - source_sentence: Can I use the Kozuka Gothic Pro font as a font-face on my web site?
 
 
18
  sentences:
19
- - Can I use the Kozuka Gothic Pro font as a font-face on my web site?
20
- - Why are Google, Facebook, YouTube and other social networking sites banned in
21
- China?
22
- - What font is used in Bloomberg Terminal?
23
- - source_sentence: Is Quora the best Q&A site?
24
  sentences:
25
- - What was the best Quora question ever?
26
- - Is Quora the best inquiry site?
27
- - Where do I buy Oway hair products online?
28
- - source_sentence: How can I customize my walking speed on Google Maps?
 
 
29
  sentences:
30
- - How do I bring back Google maps icon in my home screen?
31
- - How many pages are there in all the Harry Potter books combined?
32
- - How can I customize my walking speed on Google Maps?
33
- - source_sentence: DId something exist before the Big Bang?
 
34
  sentences:
35
- - How can I improve my memory problem?
36
- - Where can I buy Fairy Tail Manga?
37
- - Is there a scientific name for what existed before the Big Bang?
38
  pipeline_tag: sentence-similarity
39
  library_name: sentence-transformers
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  ---
41
 
42
- # SentenceTransformer based on prajjwal1/bert-small
43
 
44
- This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [prajjwal1/bert-small](https://huggingface.co/prajjwal1/bert-small). It maps sentences & paragraphs to a 512-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
45
 
46
  ## Model Details
47
 
48
  ### Model Description
49
  - **Model Type:** Sentence Transformer
50
- - **Base model:** [prajjwal1/bert-small](https://huggingface.co/prajjwal1/bert-small) <!-- at revision 0ec5f86f27c1a77d704439db5e01c307ea11b9d4 -->
51
  - **Maximum Sequence Length:** 128 tokens
52
- - **Output Dimensionality:** 512 dimensions
53
  - **Similarity Function:** Cosine Similarity
54
  <!-- - **Training Dataset:** Unknown -->
55
  <!-- - **Language:** Unknown -->
@@ -66,7 +247,8 @@ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [p
66
  ```
67
  SentenceTransformer(
68
  (0): Transformer({'max_seq_length': 128, 'do_lower_case': False, 'architecture': 'BertModel'})
69
- (1): Pooling({'word_embedding_dimension': 512, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
 
70
  )
71
  ```
72
 
@@ -85,23 +267,23 @@ Then you can load this model and run inference.
85
  from sentence_transformers import SentenceTransformer
86
 
87
  # Download from the 🤗 Hub
88
- model = SentenceTransformer("sentence_transformers_model_id")
89
  # Run inference
90
  sentences = [
91
- 'DId something exist before the Big Bang?',
92
- 'Is there a scientific name for what existed before the Big Bang?',
93
- 'Where can I buy Fairy Tail Manga?',
94
  ]
95
  embeddings = model.encode(sentences)
96
  print(embeddings.shape)
97
- # [3, 512]
98
 
99
  # Get the similarity scores for the embeddings
100
  similarities = model.similarity(embeddings, embeddings)
101
  print(similarities)
102
- # tensor([[ 1.0000, 0.7596, -0.0398],
103
- # [ 0.7596, 1.0000, -0.0308],
104
- # [-0.0398, -0.0308, 1.0000]])
105
  ```
106
 
107
  <!--
@@ -128,6 +310,65 @@ You can finetune this model on your own dataset.
128
  *List how the model may foreseeably be misused and address what users ought not to do with the model.*
129
  -->
130
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  <!--
132
  ## Bias, Risks and Limitations
133
 
@@ -146,23 +387,49 @@ You can finetune this model on your own dataset.
146
 
147
  #### Unnamed Dataset
148
 
149
- * Size: 100,000 training samples
150
- * Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>sentence_2</code>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  * Approximate statistics based on the first 1000 samples:
152
- | | sentence_0 | sentence_1 | sentence_2 |
153
- |:--------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|
154
- | type | string | string | string |
155
- | details | <ul><li>min: 3 tokens</li><li>mean: 15.53 tokens</li><li>max: 59 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 15.5 tokens</li><li>max: 59 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 16.87 tokens</li><li>max: 128 tokens</li></ul> |
156
  * Samples:
157
- | sentence_0 | sentence_1 | sentence_2 |
158
- |:----------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------|:-----------------------------------------------------------------------|
159
- | <code>Is there visitor entry facility in Jaipur airport. How much is the ticket?</code> | <code>Is there visitor entry facility in Jaipur airport. How much is the ticket?</code> | <code>How much is the airport tax in bogota?</code> |
160
- | <code>Which concept is more important: good planning or hard work?</code> | <code>Which concept is more important: good planning or hard work?</code> | <code>What is important in life: luck or hard work?</code> |
161
- | <code>What is the most efficient way to make money?</code> | <code>How can I make my money make money?</code> | <code>What can one learn about Quantum Mechanics in 10 minutes?</code> |
162
  * Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
163
  ```json
164
  {
165
- "scale": 20.0,
166
  "similarity_fct": "cos_sim",
167
  "gather_across_devices": false
168
  }
@@ -171,36 +438,49 @@ You can finetune this model on your own dataset.
171
  ### Training Hyperparameters
172
  #### Non-Default Hyperparameters
173
 
174
- - `per_device_train_batch_size`: 64
175
- - `per_device_eval_batch_size`: 64
 
 
 
 
 
176
  - `fp16`: True
177
- - `multi_dataset_batch_sampler`: round_robin
 
 
 
 
 
 
 
 
178
 
179
  #### All Hyperparameters
180
  <details><summary>Click to expand</summary>
181
 
182
  - `overwrite_output_dir`: False
183
  - `do_predict`: False
184
- - `eval_strategy`: no
185
  - `prediction_loss_only`: True
186
- - `per_device_train_batch_size`: 64
187
- - `per_device_eval_batch_size`: 64
188
  - `per_gpu_train_batch_size`: None
189
  - `per_gpu_eval_batch_size`: None
190
  - `gradient_accumulation_steps`: 1
191
  - `eval_accumulation_steps`: None
192
  - `torch_empty_cache_steps`: None
193
- - `learning_rate`: 5e-05
194
- - `weight_decay`: 0.0
195
  - `adam_beta1`: 0.9
196
  - `adam_beta2`: 0.999
197
  - `adam_epsilon`: 1e-08
198
- - `max_grad_norm`: 1
199
- - `num_train_epochs`: 3
200
- - `max_steps`: -1
201
  - `lr_scheduler_type`: linear
202
  - `lr_scheduler_kwargs`: {}
203
- - `warmup_ratio`: 0.0
204
  - `warmup_steps`: 0
205
  - `log_level`: passive
206
  - `log_level_replica`: warning
@@ -228,14 +508,14 @@ You can finetune this model on your own dataset.
228
  - `tpu_num_cores`: None
229
  - `tpu_metrics_debug`: False
230
  - `debug`: []
231
- - `dataloader_drop_last`: False
232
- - `dataloader_num_workers`: 0
233
- - `dataloader_prefetch_factor`: None
234
  - `past_index`: -1
235
  - `disable_tqdm`: False
236
  - `remove_unused_columns`: True
237
  - `label_names`: None
238
- - `load_best_model_at_end`: False
239
  - `ignore_data_skip`: False
240
  - `fsdp`: []
241
  - `fsdp_min_num_params`: 0
@@ -245,23 +525,23 @@ You can finetune this model on your own dataset.
245
  - `parallelism_config`: None
246
  - `deepspeed`: None
247
  - `label_smoothing_factor`: 0.0
248
- - `optim`: adamw_torch_fused
249
  - `optim_args`: None
250
  - `adafactor`: False
251
  - `group_by_length`: False
252
  - `length_column_name`: length
253
  - `project`: huggingface
254
  - `trackio_space_id`: trackio
255
- - `ddp_find_unused_parameters`: None
256
  - `ddp_bucket_cap_mb`: None
257
  - `ddp_broadcast_buffers`: False
258
  - `dataloader_pin_memory`: True
259
  - `dataloader_persistent_workers`: False
260
  - `skip_memory_metrics`: True
261
  - `use_legacy_prediction_loop`: False
262
- - `push_to_hub`: False
263
  - `resume_from_checkpoint`: None
264
- - `hub_model_id`: None
265
  - `hub_strategy`: every_save
266
  - `hub_private_repo`: None
267
  - `hub_always_push`: False
@@ -288,31 +568,43 @@ You can finetune this model on your own dataset.
288
  - `neftune_noise_alpha`: None
289
  - `optim_target_modules`: None
290
  - `batch_eval_metrics`: False
291
- - `eval_on_start`: False
292
  - `use_liger_kernel`: False
293
  - `liger_kernel_config`: None
294
  - `eval_use_gather_object`: False
295
  - `average_tokens_across_devices`: True
296
  - `prompts`: None
297
  - `batch_sampler`: batch_sampler
298
- - `multi_dataset_batch_sampler`: round_robin
299
  - `router_mapping`: {}
300
  - `learning_rate_mapping`: {}
301
 
302
  </details>
303
 
304
  ### Training Logs
305
- | Epoch | Step | Training Loss |
306
- |:------:|:----:|:-------------:|
307
- | 0.3199 | 500 | 0.2284 |
308
- | 0.6398 | 1000 | 0.0571 |
309
- | 0.9597 | 1500 | 0.0486 |
310
- | 1.2796 | 2000 | 0.0378 |
311
- | 1.5995 | 2500 | 0.0367 |
312
- | 1.9194 | 3000 | 0.0338 |
313
- | 2.2393 | 3500 | 0.0327 |
314
- | 2.5592 | 4000 | 0.0285 |
315
- | 2.8791 | 4500 | 0.0285 |
 
 
 
 
 
 
 
 
 
 
 
 
316
 
317
 
318
  ### Framework Versions
@@ -321,7 +613,7 @@ You can finetune this model on your own dataset.
321
  - Transformers: 4.57.3
322
  - PyTorch: 2.9.1+cu128
323
  - Accelerate: 1.12.0
324
- - Datasets: 4.4.2
325
  - Tokenizers: 0.22.1
326
 
327
  ## Citation
 
5
  - feature-extraction
6
  - dense
7
  - generated_from_trainer
8
+ - dataset_size:359997
9
  - loss:MultipleNegativesRankingLoss
10
+ base_model: thenlper/gte-small
11
  widget:
12
+ - source_sentence: When do you use Ms. or Mrs.? Is one for a married woman and one
13
+ for one that's not married? Which one is for what?
14
  sentences:
15
+ - When do you use Ms. or Mrs.? Is one for a married woman and one for one that's
16
+ not married? Which one is for what?
17
+ - Nations that do/does otherwise? Which one do I use?
18
+ - Why don't bikes have a gear indicator?
19
+ - source_sentence: Which ointment is applied to the face of UFC fighters at the commencement
20
+ of a bout? What does it do?
21
  sentences:
22
+ - How can I save a Snapchat video that others posted?
23
+ - Which ointment is applied to the face of UFC fighters at the commencement of a
24
+ bout? What does it do?
25
+ - How do I get the body of a UFC Fighter?
26
+ - source_sentence: Do you love the life you live?
27
  sentences:
28
+ - Can I do shoulder and triceps workout on same day? What other combinations like
29
+ this can I do?
30
+ - Do you love the life you're living?
31
+ - Where can you find an online TI-84 calculator?
32
+ - source_sentence: Ordered food on Swiggy 3 days ago.After accepting my money, said
33
+ no more on Menu! When if ever will I atleast get refund in cr card a/c?
34
  sentences:
35
+ - Is getting to the Tel Aviv airport to catch a 5:30 AM flight very expensive?
36
+ - How do I die and make it look like an accident?
37
+ - Ordered food on Swiggy 3 days ago.After accepting my money, said no more on Menu!
38
+ When if ever will I atleast get refund in cr card a/c?
39
+ - source_sentence: How do you earn money on Quora?
40
  sentences:
41
+ - What is a cheap healthy diet I can keep the same and eat every day?
42
+ - What are some things new employees should know going into their first day at Maximus?
43
+ - What is the best way to make money on Quora?
44
  pipeline_tag: sentence-similarity
45
  library_name: sentence-transformers
46
+ metrics:
47
+ - cosine_accuracy@1
48
+ - cosine_accuracy@3
49
+ - cosine_accuracy@5
50
+ - cosine_accuracy@10
51
+ - cosine_precision@1
52
+ - cosine_precision@3
53
+ - cosine_precision@5
54
+ - cosine_precision@10
55
+ - cosine_recall@1
56
+ - cosine_recall@3
57
+ - cosine_recall@5
58
+ - cosine_recall@10
59
+ - cosine_ndcg@10
60
+ - cosine_mrr@10
61
+ - cosine_map@100
62
+ model-index:
63
+ - name: SentenceTransformer based on thenlper/gte-small
64
+ results:
65
+ - task:
66
+ type: information-retrieval
67
+ name: Information Retrieval
68
+ dataset:
69
+ name: NanoMSMARCO
70
+ type: NanoMSMARCO
71
+ metrics:
72
+ - type: cosine_accuracy@1
73
+ value: 0.26
74
+ name: Cosine Accuracy@1
75
+ - type: cosine_accuracy@3
76
+ value: 0.56
77
+ name: Cosine Accuracy@3
78
+ - type: cosine_accuracy@5
79
+ value: 0.7
80
+ name: Cosine Accuracy@5
81
+ - type: cosine_accuracy@10
82
+ value: 0.78
83
+ name: Cosine Accuracy@10
84
+ - type: cosine_precision@1
85
+ value: 0.26
86
+ name: Cosine Precision@1
87
+ - type: cosine_precision@3
88
+ value: 0.18666666666666668
89
+ name: Cosine Precision@3
90
+ - type: cosine_precision@5
91
+ value: 0.14
92
+ name: Cosine Precision@5
93
+ - type: cosine_precision@10
94
+ value: 0.078
95
+ name: Cosine Precision@10
96
+ - type: cosine_recall@1
97
+ value: 0.26
98
+ name: Cosine Recall@1
99
+ - type: cosine_recall@3
100
+ value: 0.56
101
+ name: Cosine Recall@3
102
+ - type: cosine_recall@5
103
+ value: 0.7
104
+ name: Cosine Recall@5
105
+ - type: cosine_recall@10
106
+ value: 0.78
107
+ name: Cosine Recall@10
108
+ - type: cosine_ndcg@10
109
+ value: 0.5166057772867828
110
+ name: Cosine Ndcg@10
111
+ - type: cosine_mrr@10
112
+ value: 0.4317142857142857
113
+ name: Cosine Mrr@10
114
+ - type: cosine_map@100
115
+ value: 0.4425420850161611
116
+ name: Cosine Map@100
117
+ - task:
118
+ type: information-retrieval
119
+ name: Information Retrieval
120
+ dataset:
121
+ name: NanoNQ
122
+ type: NanoNQ
123
+ metrics:
124
+ - type: cosine_accuracy@1
125
+ value: 0.34
126
+ name: Cosine Accuracy@1
127
+ - type: cosine_accuracy@3
128
+ value: 0.56
129
+ name: Cosine Accuracy@3
130
+ - type: cosine_accuracy@5
131
+ value: 0.62
132
+ name: Cosine Accuracy@5
133
+ - type: cosine_accuracy@10
134
+ value: 0.68
135
+ name: Cosine Accuracy@10
136
+ - type: cosine_precision@1
137
+ value: 0.34
138
+ name: Cosine Precision@1
139
+ - type: cosine_precision@3
140
+ value: 0.19333333333333333
141
+ name: Cosine Precision@3
142
+ - type: cosine_precision@5
143
+ value: 0.128
144
+ name: Cosine Precision@5
145
+ - type: cosine_precision@10
146
+ value: 0.07200000000000001
147
+ name: Cosine Precision@10
148
+ - type: cosine_recall@1
149
+ value: 0.31
150
+ name: Cosine Recall@1
151
+ - type: cosine_recall@3
152
+ value: 0.53
153
+ name: Cosine Recall@3
154
+ - type: cosine_recall@5
155
+ value: 0.59
156
+ name: Cosine Recall@5
157
+ - type: cosine_recall@10
158
+ value: 0.66
159
+ name: Cosine Recall@10
160
+ - type: cosine_ndcg@10
161
+ value: 0.4981843146804683
162
+ name: Cosine Ndcg@10
163
+ - type: cosine_mrr@10
164
+ value: 0.46341269841269844
165
+ name: Cosine Mrr@10
166
+ - type: cosine_map@100
167
+ value: 0.4486372793651192
168
+ name: Cosine Map@100
169
+ - task:
170
+ type: nano-beir
171
+ name: Nano BEIR
172
+ dataset:
173
+ name: NanoBEIR mean
174
+ type: NanoBEIR_mean
175
+ metrics:
176
+ - type: cosine_accuracy@1
177
+ value: 0.30000000000000004
178
+ name: Cosine Accuracy@1
179
+ - type: cosine_accuracy@3
180
+ value: 0.56
181
+ name: Cosine Accuracy@3
182
+ - type: cosine_accuracy@5
183
+ value: 0.6599999999999999
184
+ name: Cosine Accuracy@5
185
+ - type: cosine_accuracy@10
186
+ value: 0.73
187
+ name: Cosine Accuracy@10
188
+ - type: cosine_precision@1
189
+ value: 0.30000000000000004
190
+ name: Cosine Precision@1
191
+ - type: cosine_precision@3
192
+ value: 0.19
193
+ name: Cosine Precision@3
194
+ - type: cosine_precision@5
195
+ value: 0.134
196
+ name: Cosine Precision@5
197
+ - type: cosine_precision@10
198
+ value: 0.07500000000000001
199
+ name: Cosine Precision@10
200
+ - type: cosine_recall@1
201
+ value: 0.28500000000000003
202
+ name: Cosine Recall@1
203
+ - type: cosine_recall@3
204
+ value: 0.545
205
+ name: Cosine Recall@3
206
+ - type: cosine_recall@5
207
+ value: 0.645
208
+ name: Cosine Recall@5
209
+ - type: cosine_recall@10
210
+ value: 0.72
211
+ name: Cosine Recall@10
212
+ - type: cosine_ndcg@10
213
+ value: 0.5073950459836256
214
+ name: Cosine Ndcg@10
215
+ - type: cosine_mrr@10
216
+ value: 0.4475634920634921
217
+ name: Cosine Mrr@10
218
+ - type: cosine_map@100
219
+ value: 0.44558968219064016
220
+ name: Cosine Map@100
221
  ---
222
 
223
+ # SentenceTransformer based on thenlper/gte-small
224
 
225
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [thenlper/gte-small](https://huggingface.co/thenlper/gte-small). It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
226
 
227
  ## Model Details
228
 
229
  ### Model Description
230
  - **Model Type:** Sentence Transformer
231
+ - **Base model:** [thenlper/gte-small](https://huggingface.co/thenlper/gte-small) <!-- at revision 17e1f347d17fe144873b1201da91788898c639cd -->
232
  - **Maximum Sequence Length:** 128 tokens
233
+ - **Output Dimensionality:** 384 dimensions
234
  - **Similarity Function:** Cosine Similarity
235
  <!-- - **Training Dataset:** Unknown -->
236
  <!-- - **Language:** Unknown -->
 
247
  ```
248
  SentenceTransformer(
249
  (0): Transformer({'max_seq_length': 128, 'do_lower_case': False, 'architecture': 'BertModel'})
250
+ (1): Pooling({'word_embedding_dimension': 384, '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})
251
+ (2): Normalize()
252
  )
253
  ```
254
 
 
267
  from sentence_transformers import SentenceTransformer
268
 
269
  # Download from the 🤗 Hub
270
+ model = SentenceTransformer("redis/model-a-baseline")
271
  # Run inference
272
  sentences = [
273
+ 'How do you earn money on Quora?',
274
+ 'What is the best way to make money on Quora?',
275
+ 'What are some things new employees should know going into their first day at Maximus?',
276
  ]
277
  embeddings = model.encode(sentences)
278
  print(embeddings.shape)
279
+ # [3, 384]
280
 
281
  # Get the similarity scores for the embeddings
282
  similarities = model.similarity(embeddings, embeddings)
283
  print(similarities)
284
+ # tensor([[1.0000, 0.9939, 0.0183],
285
+ # [0.9939, 1.0001, 0.0223],
286
+ # [0.0183, 0.0223, 1.0000]])
287
  ```
288
 
289
  <!--
 
310
  *List how the model may foreseeably be misused and address what users ought not to do with the model.*
311
  -->
312
 
313
+ ## Evaluation
314
+
315
+ ### Metrics
316
+
317
+ #### Information Retrieval
318
+
319
+ * Datasets: `NanoMSMARCO` and `NanoNQ`
320
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
321
+
322
+ | Metric | NanoMSMARCO | NanoNQ |
323
+ |:--------------------|:------------|:-----------|
324
+ | cosine_accuracy@1 | 0.26 | 0.34 |
325
+ | cosine_accuracy@3 | 0.56 | 0.56 |
326
+ | cosine_accuracy@5 | 0.7 | 0.62 |
327
+ | cosine_accuracy@10 | 0.78 | 0.68 |
328
+ | cosine_precision@1 | 0.26 | 0.34 |
329
+ | cosine_precision@3 | 0.1867 | 0.1933 |
330
+ | cosine_precision@5 | 0.14 | 0.128 |
331
+ | cosine_precision@10 | 0.078 | 0.072 |
332
+ | cosine_recall@1 | 0.26 | 0.31 |
333
+ | cosine_recall@3 | 0.56 | 0.53 |
334
+ | cosine_recall@5 | 0.7 | 0.59 |
335
+ | cosine_recall@10 | 0.78 | 0.66 |
336
+ | **cosine_ndcg@10** | **0.5166** | **0.4982** |
337
+ | cosine_mrr@10 | 0.4317 | 0.4634 |
338
+ | cosine_map@100 | 0.4425 | 0.4486 |
339
+
340
+ #### Nano BEIR
341
+
342
+ * Dataset: `NanoBEIR_mean`
343
+ * Evaluated with [<code>NanoBEIREvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.NanoBEIREvaluator) with these parameters:
344
+ ```json
345
+ {
346
+ "dataset_names": [
347
+ "msmarco",
348
+ "nq"
349
+ ],
350
+ "dataset_id": "lightonai/NanoBEIR-en"
351
+ }
352
+ ```
353
+
354
+ | Metric | Value |
355
+ |:--------------------|:-----------|
356
+ | cosine_accuracy@1 | 0.3 |
357
+ | cosine_accuracy@3 | 0.56 |
358
+ | cosine_accuracy@5 | 0.66 |
359
+ | cosine_accuracy@10 | 0.73 |
360
+ | cosine_precision@1 | 0.3 |
361
+ | cosine_precision@3 | 0.19 |
362
+ | cosine_precision@5 | 0.134 |
363
+ | cosine_precision@10 | 0.075 |
364
+ | cosine_recall@1 | 0.285 |
365
+ | cosine_recall@3 | 0.545 |
366
+ | cosine_recall@5 | 0.645 |
367
+ | cosine_recall@10 | 0.72 |
368
+ | **cosine_ndcg@10** | **0.5074** |
369
+ | cosine_mrr@10 | 0.4476 |
370
+ | cosine_map@100 | 0.4456 |
371
+
372
  <!--
373
  ## Bias, Risks and Limitations
374
 
 
387
 
388
  #### Unnamed Dataset
389
 
390
+ * Size: 359,997 training samples
391
+ * Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
392
+ * Approximate statistics based on the first 1000 samples:
393
+ | | anchor | positive | negative |
394
+ |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|
395
+ | type | string | string | string |
396
+ | details | <ul><li>min: 4 tokens</li><li>mean: 15.46 tokens</li><li>max: 49 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 15.52 tokens</li><li>max: 49 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 16.99 tokens</li><li>max: 128 tokens</li></ul> |
397
+ * Samples:
398
+ | anchor | positive | negative |
399
+ |:--------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------|
400
+ | <code>Shall I upgrade my iPhone 5s to iOS 10 final version?</code> | <code>Should I upgrade an iPhone 5s to iOS 10?</code> | <code>Whether extension of CA-articleship is to be served at same firm/company?</code> |
401
+ | <code>Is Donald Trump really going to be the president of United States?</code> | <code>Do you think Donald Trump could conceivably be the next President of the United States?</code> | <code>Since solid carbon dioxide is dry ice and incredibly cold, why doesn't it have an effect on global warming?</code> |
402
+ | <code>What are real tips to improve work life balance?</code> | <code>What are the best ways to create a work life balance?</code> | <code>How do you open a briefcase combination lock without the combination?</code> |
403
+ * Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
404
+ ```json
405
+ {
406
+ "scale": 7.0,
407
+ "similarity_fct": "cos_sim",
408
+ "gather_across_devices": false
409
+ }
410
+ ```
411
+
412
+ ### Evaluation Dataset
413
+
414
+ #### Unnamed Dataset
415
+
416
+ * Size: 40,000 evaluation samples
417
+ * Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
418
  * Approximate statistics based on the first 1000 samples:
419
+ | | anchor | positive | negative |
420
+ |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
421
+ | type | string | string | string |
422
+ | details | <ul><li>min: 6 tokens</li><li>mean: 15.71 tokens</li><li>max: 65 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 15.79 tokens</li><li>max: 65 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 16.97 tokens</li><li>max: 78 tokens</li></ul> |
423
  * Samples:
424
+ | anchor | positive | negative |
425
+ |:------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------|
426
+ | <code>Why were feathered dinosaur fossils only found in the last 20 years?</code> | <code>Why were feathered dinosaur fossils only found in the last 20 years?</code> | <code>Why are only few people aware that many dinosaurs had feathers?</code> |
427
+ | <code>If FOX News is the conservative news station, which cable news network is for liberals/progressives?</code> | <code>If FOX News is the conservative news station, which cable news network is for liberals/progressives?</code> | <code>How much did Fox News and conservative leaning media networks stoke the anger that contributed to Donald Trump's popularity?</code> |
428
+ | <code>How can guys last longer during sex?</code> | <code>How do I last longer in sex?</code> | <code>What is a permanent solution for rough and puffy hair?</code> |
429
  * Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
430
  ```json
431
  {
432
+ "scale": 7.0,
433
  "similarity_fct": "cos_sim",
434
  "gather_across_devices": false
435
  }
 
438
  ### Training Hyperparameters
439
  #### Non-Default Hyperparameters
440
 
441
+ - `eval_strategy`: steps
442
+ - `per_device_train_batch_size`: 128
443
+ - `per_device_eval_batch_size`: 128
444
+ - `learning_rate`: 2e-05
445
+ - `weight_decay`: 0.0001
446
+ - `max_steps`: 5000
447
+ - `warmup_ratio`: 0.1
448
  - `fp16`: True
449
+ - `dataloader_drop_last`: True
450
+ - `dataloader_num_workers`: 1
451
+ - `dataloader_prefetch_factor`: 1
452
+ - `load_best_model_at_end`: True
453
+ - `optim`: adamw_torch
454
+ - `ddp_find_unused_parameters`: False
455
+ - `push_to_hub`: True
456
+ - `hub_model_id`: redis/model-a-baseline
457
+ - `eval_on_start`: True
458
 
459
  #### All Hyperparameters
460
  <details><summary>Click to expand</summary>
461
 
462
  - `overwrite_output_dir`: False
463
  - `do_predict`: False
464
+ - `eval_strategy`: steps
465
  - `prediction_loss_only`: True
466
+ - `per_device_train_batch_size`: 128
467
+ - `per_device_eval_batch_size`: 128
468
  - `per_gpu_train_batch_size`: None
469
  - `per_gpu_eval_batch_size`: None
470
  - `gradient_accumulation_steps`: 1
471
  - `eval_accumulation_steps`: None
472
  - `torch_empty_cache_steps`: None
473
+ - `learning_rate`: 2e-05
474
+ - `weight_decay`: 0.0001
475
  - `adam_beta1`: 0.9
476
  - `adam_beta2`: 0.999
477
  - `adam_epsilon`: 1e-08
478
+ - `max_grad_norm`: 1.0
479
+ - `num_train_epochs`: 3.0
480
+ - `max_steps`: 5000
481
  - `lr_scheduler_type`: linear
482
  - `lr_scheduler_kwargs`: {}
483
+ - `warmup_ratio`: 0.1
484
  - `warmup_steps`: 0
485
  - `log_level`: passive
486
  - `log_level_replica`: warning
 
508
  - `tpu_num_cores`: None
509
  - `tpu_metrics_debug`: False
510
  - `debug`: []
511
+ - `dataloader_drop_last`: True
512
+ - `dataloader_num_workers`: 1
513
+ - `dataloader_prefetch_factor`: 1
514
  - `past_index`: -1
515
  - `disable_tqdm`: False
516
  - `remove_unused_columns`: True
517
  - `label_names`: None
518
+ - `load_best_model_at_end`: True
519
  - `ignore_data_skip`: False
520
  - `fsdp`: []
521
  - `fsdp_min_num_params`: 0
 
525
  - `parallelism_config`: None
526
  - `deepspeed`: None
527
  - `label_smoothing_factor`: 0.0
528
+ - `optim`: adamw_torch
529
  - `optim_args`: None
530
  - `adafactor`: False
531
  - `group_by_length`: False
532
  - `length_column_name`: length
533
  - `project`: huggingface
534
  - `trackio_space_id`: trackio
535
+ - `ddp_find_unused_parameters`: False
536
  - `ddp_bucket_cap_mb`: None
537
  - `ddp_broadcast_buffers`: False
538
  - `dataloader_pin_memory`: True
539
  - `dataloader_persistent_workers`: False
540
  - `skip_memory_metrics`: True
541
  - `use_legacy_prediction_loop`: False
542
+ - `push_to_hub`: True
543
  - `resume_from_checkpoint`: None
544
+ - `hub_model_id`: redis/model-a-baseline
545
  - `hub_strategy`: every_save
546
  - `hub_private_repo`: None
547
  - `hub_always_push`: False
 
568
  - `neftune_noise_alpha`: None
569
  - `optim_target_modules`: None
570
  - `batch_eval_metrics`: False
571
+ - `eval_on_start`: True
572
  - `use_liger_kernel`: False
573
  - `liger_kernel_config`: None
574
  - `eval_use_gather_object`: False
575
  - `average_tokens_across_devices`: True
576
  - `prompts`: None
577
  - `batch_sampler`: batch_sampler
578
+ - `multi_dataset_batch_sampler`: proportional
579
  - `router_mapping`: {}
580
  - `learning_rate_mapping`: {}
581
 
582
  </details>
583
 
584
  ### Training Logs
585
+ | Epoch | Step | Training Loss | Validation Loss | NanoMSMARCO_cosine_ndcg@10 | NanoNQ_cosine_ndcg@10 | NanoBEIR_mean_cosine_ndcg@10 |
586
+ |:------:|:----:|:-------------:|:---------------:|:--------------------------:|:---------------------:|:----------------------------:|
587
+ | 0 | 0 | - | 3.6640 | 0.6259 | 0.6583 | 0.6421 |
588
+ | 0.0889 | 250 | 2.5091 | 0.4913 | 0.5518 | 0.5570 | 0.5544 |
589
+ | 0.1778 | 500 | 0.6206 | 0.4434 | 0.5891 | 0.5412 | 0.5651 |
590
+ | 0.2667 | 750 | 0.5549 | 0.4244 | 0.5579 | 0.5372 | 0.5475 |
591
+ | 0.3556 | 1000 | 0.5305 | 0.4144 | 0.5611 | 0.5284 | 0.5447 |
592
+ | 0.4445 | 1250 | 0.5155 | 0.4080 | 0.5410 | 0.5196 | 0.5303 |
593
+ | 0.5334 | 1500 | 0.5101 | 0.4031 | 0.5497 | 0.5281 | 0.5389 |
594
+ | 0.6223 | 1750 | 0.5035 | 0.4002 | 0.5329 | 0.5259 | 0.5294 |
595
+ | 0.7112 | 2000 | 0.4955 | 0.3965 | 0.5299 | 0.5412 | 0.5356 |
596
+ | 0.8001 | 2250 | 0.4906 | 0.3941 | 0.5402 | 0.5250 | 0.5326 |
597
+ | 0.8890 | 2500 | 0.4882 | 0.3919 | 0.5323 | 0.5316 | 0.5320 |
598
+ | 0.9780 | 2750 | 0.4845 | 0.3904 | 0.5260 | 0.5121 | 0.5190 |
599
+ | 1.0669 | 3000 | 0.4769 | 0.3885 | 0.5208 | 0.5235 | 0.5221 |
600
+ | 1.1558 | 3250 | 0.4745 | 0.3876 | 0.5216 | 0.5019 | 0.5117 |
601
+ | 1.2447 | 3500 | 0.4718 | 0.3867 | 0.5110 | 0.5030 | 0.5070 |
602
+ | 1.3336 | 3750 | 0.47 | 0.3863 | 0.5122 | 0.5008 | 0.5065 |
603
+ | 1.4225 | 4000 | 0.4681 | 0.3855 | 0.5108 | 0.4988 | 0.5048 |
604
+ | 1.5114 | 4250 | 0.4668 | 0.3846 | 0.5096 | 0.4937 | 0.5016 |
605
+ | 1.6003 | 4500 | 0.4669 | 0.3843 | 0.5082 | 0.4982 | 0.5032 |
606
+ | 1.6892 | 4750 | 0.4661 | 0.3840 | 0.5166 | 0.4982 | 0.5074 |
607
+ | 1.7781 | 5000 | 0.467 | 0.3838 | 0.5166 | 0.4982 | 0.5074 |
608
 
609
 
610
  ### Framework Versions
 
613
  - Transformers: 4.57.3
614
  - PyTorch: 2.9.1+cu128
615
  - Accelerate: 1.12.0
616
+ - Datasets: 2.21.0
617
  - Tokenizers: 0.22.1
618
 
619
  ## Citation
modules.json CHANGED
@@ -10,5 +10,11 @@
10
  "name": "1",
11
  "path": "1_Pooling",
12
  "type": "sentence_transformers.models.Pooling"
 
 
 
 
 
 
13
  }
14
  ]
 
10
  "name": "1",
11
  "path": "1_Pooling",
12
  "type": "sentence_transformers.models.Pooling"
13
+ },
14
+ {
15
+ "idx": 2,
16
+ "name": "2",
17
+ "path": "2_Normalize",
18
+ "type": "sentence_transformers.models.Normalize"
19
  }
20
  ]