zxcvo commited on
Commit
c436abd
·
verified ·
1 Parent(s): 31b0d91

Add new SentenceTransformer model

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
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,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,696 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - sentence-transformers
4
+ - sentence-similarity
5
+ - feature-extraction
6
+ - generated_from_trainer
7
+ - dataset_size:33
8
+ - loss:MatryoshkaLoss
9
+ - loss:MultipleNegativesRankingLoss
10
+ base_model: keepitreal/vietnamese-sbert
11
+ widget:
12
+ - source_sentence: Áo Polo Lacoste với chất liệu Petit Piqué và thiết kế cổ gập kinh
13
+ điển
14
+ sentences:
15
+ - Giày cao gót đẳng cấp
16
+ - Xe điều khiển từ xa
17
+ - Áo polo sang trọng
18
+ - source_sentence: Sony Alpha A7 IV với cảm biến CMOS Exmor R 33MP và khả năng quay
19
+ 4K 60fps
20
+ sentences:
21
+ - Giày cao gót sang trọng
22
+ - Sách văn học tuổi thơ
23
+ - Máy ảnh chuyên nghiệp
24
+ - source_sentence: Laneige Water Bank Cream với công nghệ Hydro Ionized Mineral Water
25
+ và kết cấu gel mỏng nhẹ
26
+ sentences:
27
+ - Điện thoại flagship cao cấp
28
+ - Kem dưỡng ẩm nổi bật
29
+ - Giày tây nam lịch lãm
30
+ - source_sentence: Adidas Ultraboost với công nghệ Boost™ và đế ngoài Continental™
31
+ Rubber
32
+ sentences:
33
+ - Tai nghe chống ồn hàng đầu
34
+ - Quần short kaki trẻ trung
35
+ - Giày chạy bộ hiện đại
36
+ - source_sentence: Áo thun từ cotton mềm mại, kiểu dáng đa dạng phù hợp cho nhiều
37
+ phong cách
38
+ sentences:
39
+ - Máy ảnh vlog chuyên nghiệp
40
+ - Áo thun thoải mái
41
+ - Laptop hiệu năng mạnh mẽ
42
+ pipeline_tag: sentence-similarity
43
+ library_name: sentence-transformers
44
+ metrics:
45
+ - cosine_accuracy@1
46
+ - cosine_accuracy@3
47
+ - cosine_accuracy@5
48
+ - cosine_accuracy@10
49
+ - cosine_precision@1
50
+ - cosine_precision@3
51
+ - cosine_precision@5
52
+ - cosine_precision@10
53
+ - cosine_recall@1
54
+ - cosine_recall@3
55
+ - cosine_recall@5
56
+ - cosine_recall@10
57
+ - cosine_ndcg@10
58
+ - cosine_mrr@10
59
+ - cosine_map@100
60
+ model-index:
61
+ - name: SentenceTransformer based on keepitreal/vietnamese-sbert
62
+ results:
63
+ - task:
64
+ type: information-retrieval
65
+ name: Information Retrieval
66
+ dataset:
67
+ name: dim 768
68
+ type: dim_768
69
+ metrics:
70
+ - type: cosine_accuracy@1
71
+ value: 0.25
72
+ name: Cosine Accuracy@1
73
+ - type: cosine_accuracy@3
74
+ value: 0.75
75
+ name: Cosine Accuracy@3
76
+ - type: cosine_accuracy@5
77
+ value: 0.75
78
+ name: Cosine Accuracy@5
79
+ - type: cosine_accuracy@10
80
+ value: 1.0
81
+ name: Cosine Accuracy@10
82
+ - type: cosine_precision@1
83
+ value: 0.25
84
+ name: Cosine Precision@1
85
+ - type: cosine_precision@3
86
+ value: 0.25
87
+ name: Cosine Precision@3
88
+ - type: cosine_precision@5
89
+ value: 0.15000000000000002
90
+ name: Cosine Precision@5
91
+ - type: cosine_precision@10
92
+ value: 0.1
93
+ name: Cosine Precision@10
94
+ - type: cosine_recall@1
95
+ value: 0.25
96
+ name: Cosine Recall@1
97
+ - type: cosine_recall@3
98
+ value: 0.75
99
+ name: Cosine Recall@3
100
+ - type: cosine_recall@5
101
+ value: 0.75
102
+ name: Cosine Recall@5
103
+ - type: cosine_recall@10
104
+ value: 1.0
105
+ name: Cosine Recall@10
106
+ - type: cosine_ndcg@10
107
+ value: 0.6377310833652008
108
+ name: Cosine Ndcg@10
109
+ - type: cosine_mrr@10
110
+ value: 0.525
111
+ name: Cosine Mrr@10
112
+ - type: cosine_map@100
113
+ value: 0.525
114
+ name: Cosine Map@100
115
+ - task:
116
+ type: information-retrieval
117
+ name: Information Retrieval
118
+ dataset:
119
+ name: dim 512
120
+ type: dim_512
121
+ metrics:
122
+ - type: cosine_accuracy@1
123
+ value: 0.25
124
+ name: Cosine Accuracy@1
125
+ - type: cosine_accuracy@3
126
+ value: 0.75
127
+ name: Cosine Accuracy@3
128
+ - type: cosine_accuracy@5
129
+ value: 0.75
130
+ name: Cosine Accuracy@5
131
+ - type: cosine_accuracy@10
132
+ value: 1.0
133
+ name: Cosine Accuracy@10
134
+ - type: cosine_precision@1
135
+ value: 0.25
136
+ name: Cosine Precision@1
137
+ - type: cosine_precision@3
138
+ value: 0.25
139
+ name: Cosine Precision@3
140
+ - type: cosine_precision@5
141
+ value: 0.15000000000000002
142
+ name: Cosine Precision@5
143
+ - type: cosine_precision@10
144
+ value: 0.1
145
+ name: Cosine Precision@10
146
+ - type: cosine_recall@1
147
+ value: 0.25
148
+ name: Cosine Recall@1
149
+ - type: cosine_recall@3
150
+ value: 0.75
151
+ name: Cosine Recall@3
152
+ - type: cosine_recall@5
153
+ value: 0.75
154
+ name: Cosine Recall@5
155
+ - type: cosine_recall@10
156
+ value: 1.0
157
+ name: Cosine Recall@10
158
+ - type: cosine_ndcg@10
159
+ value: 0.6079899373088598
160
+ name: Cosine Ndcg@10
161
+ - type: cosine_mrr@10
162
+ value: 0.4861111111111111
163
+ name: Cosine Mrr@10
164
+ - type: cosine_map@100
165
+ value: 0.4861111111111111
166
+ name: Cosine Map@100
167
+ - task:
168
+ type: information-retrieval
169
+ name: Information Retrieval
170
+ dataset:
171
+ name: dim 256
172
+ type: dim_256
173
+ metrics:
174
+ - type: cosine_accuracy@1
175
+ value: 0.25
176
+ name: Cosine Accuracy@1
177
+ - type: cosine_accuracy@3
178
+ value: 0.75
179
+ name: Cosine Accuracy@3
180
+ - type: cosine_accuracy@5
181
+ value: 0.75
182
+ name: Cosine Accuracy@5
183
+ - type: cosine_accuracy@10
184
+ value: 0.75
185
+ name: Cosine Accuracy@10
186
+ - type: cosine_precision@1
187
+ value: 0.25
188
+ name: Cosine Precision@1
189
+ - type: cosine_precision@3
190
+ value: 0.25
191
+ name: Cosine Precision@3
192
+ - type: cosine_precision@5
193
+ value: 0.15000000000000002
194
+ name: Cosine Precision@5
195
+ - type: cosine_precision@10
196
+ value: 0.07500000000000001
197
+ name: Cosine Precision@10
198
+ - type: cosine_recall@1
199
+ value: 0.25
200
+ name: Cosine Recall@1
201
+ - type: cosine_recall@3
202
+ value: 0.75
203
+ name: Cosine Recall@3
204
+ - type: cosine_recall@5
205
+ value: 0.75
206
+ name: Cosine Recall@5
207
+ - type: cosine_recall@10
208
+ value: 0.75
209
+ name: Cosine Recall@10
210
+ - type: cosine_ndcg@10
211
+ value: 0.5
212
+ name: Cosine Ndcg@10
213
+ - type: cosine_mrr@10
214
+ value: 0.41666666666666663
215
+ name: Cosine Mrr@10
216
+ - type: cosine_map@100
217
+ value: 0.43749999999999994
218
+ name: Cosine Map@100
219
+ - task:
220
+ type: information-retrieval
221
+ name: Information Retrieval
222
+ dataset:
223
+ name: dim 128
224
+ type: dim_128
225
+ metrics:
226
+ - type: cosine_accuracy@1
227
+ value: 0.5
228
+ name: Cosine Accuracy@1
229
+ - type: cosine_accuracy@3
230
+ value: 0.75
231
+ name: Cosine Accuracy@3
232
+ - type: cosine_accuracy@5
233
+ value: 0.75
234
+ name: Cosine Accuracy@5
235
+ - type: cosine_accuracy@10
236
+ value: 1.0
237
+ name: Cosine Accuracy@10
238
+ - type: cosine_precision@1
239
+ value: 0.5
240
+ name: Cosine Precision@1
241
+ - type: cosine_precision@3
242
+ value: 0.25
243
+ name: Cosine Precision@3
244
+ - type: cosine_precision@5
245
+ value: 0.15000000000000002
246
+ name: Cosine Precision@5
247
+ - type: cosine_precision@10
248
+ value: 0.1
249
+ name: Cosine Precision@10
250
+ - type: cosine_recall@1
251
+ value: 0.5
252
+ name: Cosine Recall@1
253
+ - type: cosine_recall@3
254
+ value: 0.75
255
+ name: Cosine Recall@3
256
+ - type: cosine_recall@5
257
+ value: 0.75
258
+ name: Cosine Recall@5
259
+ - type: cosine_recall@10
260
+ value: 1.0
261
+ name: Cosine Recall@10
262
+ - type: cosine_ndcg@10
263
+ value: 0.7410657717261977
264
+ name: Cosine Ndcg@10
265
+ - type: cosine_mrr@10
266
+ value: 0.6607142857142857
267
+ name: Cosine Mrr@10
268
+ - type: cosine_map@100
269
+ value: 0.6607142857142857
270
+ name: Cosine Map@100
271
+ - task:
272
+ type: information-retrieval
273
+ name: Information Retrieval
274
+ dataset:
275
+ name: dim 64
276
+ type: dim_64
277
+ metrics:
278
+ - type: cosine_accuracy@1
279
+ value: 0.0
280
+ name: Cosine Accuracy@1
281
+ - type: cosine_accuracy@3
282
+ value: 0.5
283
+ name: Cosine Accuracy@3
284
+ - type: cosine_accuracy@5
285
+ value: 0.5
286
+ name: Cosine Accuracy@5
287
+ - type: cosine_accuracy@10
288
+ value: 0.75
289
+ name: Cosine Accuracy@10
290
+ - type: cosine_precision@1
291
+ value: 0.0
292
+ name: Cosine Precision@1
293
+ - type: cosine_precision@3
294
+ value: 0.16666666666666666
295
+ name: Cosine Precision@3
296
+ - type: cosine_precision@5
297
+ value: 0.1
298
+ name: Cosine Precision@5
299
+ - type: cosine_precision@10
300
+ value: 0.07500000000000001
301
+ name: Cosine Precision@10
302
+ - type: cosine_recall@1
303
+ value: 0.0
304
+ name: Cosine Recall@1
305
+ - type: cosine_recall@3
306
+ value: 0.5
307
+ name: Cosine Recall@3
308
+ - type: cosine_recall@5
309
+ value: 0.5
310
+ name: Cosine Recall@5
311
+ - type: cosine_recall@10
312
+ value: 0.75
313
+ name: Cosine Recall@10
314
+ - type: cosine_ndcg@10
315
+ value: 0.4045166735627343
316
+ name: Cosine Ndcg@10
317
+ - type: cosine_mrr@10
318
+ value: 0.29166666666666663
319
+ name: Cosine Mrr@10
320
+ - type: cosine_map@100
321
+ value: 0.30952380952380953
322
+ name: Cosine Map@100
323
+ ---
324
+
325
+ # SentenceTransformer based on keepitreal/vietnamese-sbert
326
+
327
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [keepitreal/vietnamese-sbert](https://huggingface.co/keepitreal/vietnamese-sbert) on the json dataset. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
328
+
329
+ ## Model Details
330
+
331
+ ### Model Description
332
+ - **Model Type:** Sentence Transformer
333
+ - **Base model:** [keepitreal/vietnamese-sbert](https://huggingface.co/keepitreal/vietnamese-sbert) <!-- at revision a9467ef2ef47caa6448edeabfd8e5e5ce0fa2a23 -->
334
+ - **Maximum Sequence Length:** 256 tokens
335
+ - **Output Dimensionality:** 768 dimensions
336
+ - **Similarity Function:** Cosine Similarity
337
+ - **Training Dataset:**
338
+ - json
339
+ <!-- - **Language:** Unknown -->
340
+ <!-- - **License:** Unknown -->
341
+
342
+ ### Model Sources
343
+
344
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
345
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
346
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
347
+
348
+ ### Full Model Architecture
349
+
350
+ ```
351
+ SentenceTransformer(
352
+ (0): Transformer({'max_seq_length': 256, 'do_lower_case': False}) with Transformer model: RobertaModel
353
+ (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})
354
+ )
355
+ ```
356
+
357
+ ## Usage
358
+
359
+ ### Direct Usage (Sentence Transformers)
360
+
361
+ First install the Sentence Transformers library:
362
+
363
+ ```bash
364
+ pip install -U sentence-transformers
365
+ ```
366
+
367
+ Then you can load this model and run inference.
368
+ ```python
369
+ from sentence_transformers import SentenceTransformer
370
+
371
+ # Download from the 🤗 Hub
372
+ model = SentenceTransformer("zxcvo/product-search-model")
373
+ # Run inference
374
+ sentences = [
375
+ 'Áo thun từ cotton mềm mại, kiểu dáng đa dạng phù hợp cho nhiều phong cách',
376
+ 'Áo thun thoải mái',
377
+ 'Laptop hiệu năng mạnh mẽ',
378
+ ]
379
+ embeddings = model.encode(sentences)
380
+ print(embeddings.shape)
381
+ # [3, 768]
382
+
383
+ # Get the similarity scores for the embeddings
384
+ similarities = model.similarity(embeddings, embeddings)
385
+ print(similarities.shape)
386
+ # [3, 3]
387
+ ```
388
+
389
+ <!--
390
+ ### Direct Usage (Transformers)
391
+
392
+ <details><summary>Click to see the direct usage in Transformers</summary>
393
+
394
+ </details>
395
+ -->
396
+
397
+ <!--
398
+ ### Downstream Usage (Sentence Transformers)
399
+
400
+ You can finetune this model on your own dataset.
401
+
402
+ <details><summary>Click to expand</summary>
403
+
404
+ </details>
405
+ -->
406
+
407
+ <!--
408
+ ### Out-of-Scope Use
409
+
410
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
411
+ -->
412
+
413
+ ## Evaluation
414
+
415
+ ### Metrics
416
+
417
+ #### Information Retrieval
418
+
419
+ * Datasets: `dim_768`, `dim_512`, `dim_256`, `dim_128` and `dim_64`
420
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
421
+
422
+ | Metric | dim_768 | dim_512 | dim_256 | dim_128 | dim_64 |
423
+ |:--------------------|:-----------|:----------|:--------|:-----------|:-----------|
424
+ | cosine_accuracy@1 | 0.25 | 0.25 | 0.25 | 0.5 | 0.0 |
425
+ | cosine_accuracy@3 | 0.75 | 0.75 | 0.75 | 0.75 | 0.5 |
426
+ | cosine_accuracy@5 | 0.75 | 0.75 | 0.75 | 0.75 | 0.5 |
427
+ | cosine_accuracy@10 | 1.0 | 1.0 | 0.75 | 1.0 | 0.75 |
428
+ | cosine_precision@1 | 0.25 | 0.25 | 0.25 | 0.5 | 0.0 |
429
+ | cosine_precision@3 | 0.25 | 0.25 | 0.25 | 0.25 | 0.1667 |
430
+ | cosine_precision@5 | 0.15 | 0.15 | 0.15 | 0.15 | 0.1 |
431
+ | cosine_precision@10 | 0.1 | 0.1 | 0.075 | 0.1 | 0.075 |
432
+ | cosine_recall@1 | 0.25 | 0.25 | 0.25 | 0.5 | 0.0 |
433
+ | cosine_recall@3 | 0.75 | 0.75 | 0.75 | 0.75 | 0.5 |
434
+ | cosine_recall@5 | 0.75 | 0.75 | 0.75 | 0.75 | 0.5 |
435
+ | cosine_recall@10 | 1.0 | 1.0 | 0.75 | 1.0 | 0.75 |
436
+ | **cosine_ndcg@10** | **0.6377** | **0.608** | **0.5** | **0.7411** | **0.4045** |
437
+ | cosine_mrr@10 | 0.525 | 0.4861 | 0.4167 | 0.6607 | 0.2917 |
438
+ | cosine_map@100 | 0.525 | 0.4861 | 0.4375 | 0.6607 | 0.3095 |
439
+
440
+ <!--
441
+ ## Bias, Risks and Limitations
442
+
443
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
444
+ -->
445
+
446
+ <!--
447
+ ### Recommendations
448
+
449
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
450
+ -->
451
+
452
+ ## Training Details
453
+
454
+ ### Training Dataset
455
+
456
+ #### json
457
+
458
+ * Dataset: json
459
+ * Size: 33 training samples
460
+ * Columns: <code>positive</code> and <code>anchor</code>
461
+ * Approximate statistics based on the first 33 samples:
462
+ | | positive | anchor |
463
+ |:--------|:-----------------------------------------------------------------------------------|:--------------------------------------------------------------------------------|
464
+ | type | string | string |
465
+ | details | <ul><li>min: 18 tokens</li><li>mean: 22.82 tokens</li><li>max: 34 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 6.97 tokens</li><li>max: 8 tokens</li></ul> |
466
+ * Samples:
467
+ | positive | anchor |
468
+ |:-----------------------------------------------------------------------------------------------|:-----------------------------------------|
469
+ | <code>Áo Sơ Mi Nam Trắng Classic với chất liệu cotton cao cấp, kiểu dáng lịch lãm</code> | <code>Áo sơ mi tinh tế</code> |
470
+ | <code>Đắc Nhân Tâm của Dale Carnegie với những nguyên tắc xây dựng mối quan hệ hiệu quả</code> | <code>Sách kinh điển về giao tiếp</code> |
471
+ | <code>Nike Air Force 1 với thiết kế logo Swoosh và công nghệ Air-Sole</code> | <code>Giày sneaker cổ điển</code> |
472
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
473
+ ```json
474
+ {
475
+ "loss": "MultipleNegativesRankingLoss",
476
+ "matryoshka_dims": [
477
+ 768,
478
+ 512,
479
+ 256,
480
+ 128,
481
+ 64
482
+ ],
483
+ "matryoshka_weights": [
484
+ 1,
485
+ 1,
486
+ 1,
487
+ 1,
488
+ 1
489
+ ],
490
+ "n_dims_per_step": -1
491
+ }
492
+ ```
493
+
494
+ ### Training Hyperparameters
495
+ #### Non-Default Hyperparameters
496
+
497
+ - `eval_strategy`: epoch
498
+ - `per_device_train_batch_size`: 32
499
+ - `gradient_accumulation_steps`: 16
500
+ - `learning_rate`: 2e-05
501
+ - `num_train_epochs`: 4
502
+ - `bf16`: True
503
+ - `load_best_model_at_end`: True
504
+
505
+ #### All Hyperparameters
506
+ <details><summary>Click to expand</summary>
507
+
508
+ - `overwrite_output_dir`: False
509
+ - `do_predict`: False
510
+ - `eval_strategy`: epoch
511
+ - `prediction_loss_only`: True
512
+ - `per_device_train_batch_size`: 32
513
+ - `per_device_eval_batch_size`: 8
514
+ - `per_gpu_train_batch_size`: None
515
+ - `per_gpu_eval_batch_size`: None
516
+ - `gradient_accumulation_steps`: 16
517
+ - `eval_accumulation_steps`: None
518
+ - `learning_rate`: 2e-05
519
+ - `weight_decay`: 0.0
520
+ - `adam_beta1`: 0.9
521
+ - `adam_beta2`: 0.999
522
+ - `adam_epsilon`: 1e-08
523
+ - `max_grad_norm`: 1.0
524
+ - `num_train_epochs`: 4
525
+ - `max_steps`: -1
526
+ - `lr_scheduler_type`: linear
527
+ - `lr_scheduler_kwargs`: {}
528
+ - `warmup_ratio`: 0.0
529
+ - `warmup_steps`: 0
530
+ - `log_level`: passive
531
+ - `log_level_replica`: warning
532
+ - `log_on_each_node`: True
533
+ - `logging_nan_inf_filter`: True
534
+ - `save_safetensors`: True
535
+ - `save_on_each_node`: False
536
+ - `save_only_model`: False
537
+ - `restore_callback_states_from_checkpoint`: False
538
+ - `no_cuda`: False
539
+ - `use_cpu`: False
540
+ - `use_mps_device`: False
541
+ - `seed`: 42
542
+ - `data_seed`: None
543
+ - `jit_mode_eval`: False
544
+ - `use_ipex`: False
545
+ - `bf16`: True
546
+ - `fp16`: False
547
+ - `fp16_opt_level`: O1
548
+ - `half_precision_backend`: auto
549
+ - `bf16_full_eval`: False
550
+ - `fp16_full_eval`: False
551
+ - `tf32`: None
552
+ - `local_rank`: 0
553
+ - `ddp_backend`: None
554
+ - `tpu_num_cores`: None
555
+ - `tpu_metrics_debug`: False
556
+ - `debug`: []
557
+ - `dataloader_drop_last`: False
558
+ - `dataloader_num_workers`: 0
559
+ - `dataloader_prefetch_factor`: None
560
+ - `past_index`: -1
561
+ - `disable_tqdm`: False
562
+ - `remove_unused_columns`: True
563
+ - `label_names`: None
564
+ - `load_best_model_at_end`: True
565
+ - `ignore_data_skip`: False
566
+ - `fsdp`: []
567
+ - `fsdp_min_num_params`: 0
568
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
569
+ - `fsdp_transformer_layer_cls_to_wrap`: None
570
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
571
+ - `deepspeed`: None
572
+ - `label_smoothing_factor`: 0.0
573
+ - `optim`: adamw_torch
574
+ - `optim_args`: None
575
+ - `adafactor`: False
576
+ - `group_by_length`: False
577
+ - `length_column_name`: length
578
+ - `ddp_find_unused_parameters`: None
579
+ - `ddp_bucket_cap_mb`: None
580
+ - `ddp_broadcast_buffers`: False
581
+ - `dataloader_pin_memory`: True
582
+ - `dataloader_persistent_workers`: False
583
+ - `skip_memory_metrics`: True
584
+ - `use_legacy_prediction_loop`: False
585
+ - `push_to_hub`: False
586
+ - `resume_from_checkpoint`: None
587
+ - `hub_model_id`: None
588
+ - `hub_strategy`: every_save
589
+ - `hub_private_repo`: False
590
+ - `hub_always_push`: False
591
+ - `gradient_checkpointing`: False
592
+ - `gradient_checkpointing_kwargs`: None
593
+ - `include_inputs_for_metrics`: False
594
+ - `eval_do_concat_batches`: True
595
+ - `fp16_backend`: auto
596
+ - `push_to_hub_model_id`: None
597
+ - `push_to_hub_organization`: None
598
+ - `mp_parameters`:
599
+ - `auto_find_batch_size`: False
600
+ - `full_determinism`: False
601
+ - `torchdynamo`: None
602
+ - `ray_scope`: last
603
+ - `ddp_timeout`: 1800
604
+ - `torch_compile`: False
605
+ - `torch_compile_backend`: None
606
+ - `torch_compile_mode`: None
607
+ - `dispatch_batches`: None
608
+ - `split_batches`: None
609
+ - `include_tokens_per_second`: False
610
+ - `include_num_input_tokens_seen`: False
611
+ - `neftune_noise_alpha`: None
612
+ - `optim_target_modules`: None
613
+ - `batch_eval_metrics`: False
614
+ - `prompts`: None
615
+ - `batch_sampler`: batch_sampler
616
+ - `multi_dataset_batch_sampler`: proportional
617
+
618
+ </details>
619
+
620
+ ### Training Logs
621
+ | Epoch | Step | dim_768_cosine_ndcg@10 | dim_512_cosine_ndcg@10 | dim_256_cosine_ndcg@10 | dim_128_cosine_ndcg@10 | dim_64_cosine_ndcg@10 |
622
+ |:-------:|:-----:|:----------------------:|:----------------------:|:----------------------:|:----------------------:|:---------------------:|
623
+ | 1.0 | 1 | 0.6050 | 0.6050 | 0.5 | 0.7083 | 0.5767 |
624
+ | **2.0** | **2** | **0.605** | **0.608** | **0.5** | **0.7411** | **0.4045** |
625
+ | 3.0 | 3 | 0.6377 | 0.6080 | 0.5 | 0.6488 | 0.4045 |
626
+ | 4.0 | 4 | 0.6377 | 0.6080 | 0.5 | 0.7411 | 0.4045 |
627
+
628
+ * The bold row denotes the saved checkpoint.
629
+
630
+ ### Framework Versions
631
+ - Python: 3.11.0
632
+ - Sentence Transformers: 3.3.1
633
+ - Transformers: 4.41.2
634
+ - PyTorch: 2.5.1+cu124
635
+ - Accelerate: 1.2.1
636
+ - Datasets: 2.19.1
637
+ - Tokenizers: 0.19.1
638
+
639
+ ## Citation
640
+
641
+ ### BibTeX
642
+
643
+ #### Sentence Transformers
644
+ ```bibtex
645
+ @inproceedings{reimers-2019-sentence-bert,
646
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
647
+ author = "Reimers, Nils and Gurevych, Iryna",
648
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
649
+ month = "11",
650
+ year = "2019",
651
+ publisher = "Association for Computational Linguistics",
652
+ url = "https://arxiv.org/abs/1908.10084",
653
+ }
654
+ ```
655
+
656
+ #### MatryoshkaLoss
657
+ ```bibtex
658
+ @misc{kusupati2024matryoshka,
659
+ title={Matryoshka Representation Learning},
660
+ author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
661
+ year={2024},
662
+ eprint={2205.13147},
663
+ archivePrefix={arXiv},
664
+ primaryClass={cs.LG}
665
+ }
666
+ ```
667
+
668
+ #### MultipleNegativesRankingLoss
669
+ ```bibtex
670
+ @misc{henderson2017efficient,
671
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
672
+ author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
673
+ year={2017},
674
+ eprint={1705.00652},
675
+ archivePrefix={arXiv},
676
+ primaryClass={cs.CL}
677
+ }
678
+ ```
679
+
680
+ <!--
681
+ ## Glossary
682
+
683
+ *Clearly define terms in order to be accessible across audiences.*
684
+ -->
685
+
686
+ <!--
687
+ ## Model Card Authors
688
+
689
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
690
+ -->
691
+
692
+ <!--
693
+ ## Model Card Contact
694
+
695
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
696
+ -->
added_tokens.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "<mask>": 64000
3
+ }
bpe.codes ADDED
The diff for this file is too large to render. See raw diff
 
config.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "keepitreal/vietnamese-sbert",
3
+ "architectures": [
4
+ "RobertaModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": 0,
8
+ "classifier_dropout": null,
9
+ "eos_token_id": 2,
10
+ "gradient_checkpointing": false,
11
+ "hidden_act": "gelu",
12
+ "hidden_dropout_prob": 0.1,
13
+ "hidden_size": 768,
14
+ "initializer_range": 0.02,
15
+ "intermediate_size": 3072,
16
+ "layer_norm_eps": 1e-05,
17
+ "max_position_embeddings": 258,
18
+ "model_type": "roberta",
19
+ "num_attention_heads": 12,
20
+ "num_hidden_layers": 12,
21
+ "pad_token_id": 1,
22
+ "position_embedding_type": "absolute",
23
+ "tokenizer_class": "PhobertTokenizer",
24
+ "torch_dtype": "float32",
25
+ "transformers_version": "4.41.2",
26
+ "type_vocab_size": 1,
27
+ "use_cache": true,
28
+ "vocab_size": 64001
29
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "3.3.1",
4
+ "transformers": "4.41.2",
5
+ "pytorch": "2.5.1+cu124"
6
+ },
7
+ "prompts": {},
8
+ "default_prompt_name": null,
9
+ "similarity_fn_name": "cosine"
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:66058d001189d0a7cf09bac6dd402bab52d327ce78c7801f4228f20c80ba3590
3
+ size 540015464
modules.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_Pooling",
12
+ "type": "sentence_transformers.models.Pooling"
13
+ }
14
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 256,
3
+ "do_lower_case": false
4
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "cls_token": "<s>",
4
+ "eos_token": "</s>",
5
+ "mask_token": "<mask>",
6
+ "pad_token": "<pad>",
7
+ "sep_token": "</s>",
8
+ "unk_token": "<unk>"
9
+ }
tokenizer_config.json ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<s>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "<pad>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "</s>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "<unk>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "64000": {
36
+ "content": "<mask>",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "bos_token": "<s>",
45
+ "clean_up_tokenization_spaces": true,
46
+ "cls_token": "<s>",
47
+ "eos_token": "</s>",
48
+ "mask_token": "<mask>",
49
+ "model_max_length": 256,
50
+ "pad_token": "<pad>",
51
+ "sep_token": "</s>",
52
+ "tokenizer_class": "PhobertTokenizer",
53
+ "unk_token": "<unk>"
54
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff