NghiBuine commited on
Commit
ba4169d
·
verified ·
1 Parent(s): 7dc3438

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,809 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - sentence-transformers
4
+ - sentence-similarity
5
+ - feature-extraction
6
+ - generated_from_trainer
7
+ - dataset_size:333
8
+ - loss:MatryoshkaLoss
9
+ - loss:MultipleNegativesRankingLoss
10
+ base_model: keepitreal/vietnamese-sbert
11
+ widget:
12
+ - source_sentence: Tôi Thấy Hoa Vàng Trên Cỏ Xanh
13
+ sentences:
14
+ - mềm mại, thoáng khí và bền đẹp
15
+ - Nike Air Force 1 phong cách không lỗi mốt
16
+ - Tôi Thấy Hoa Vàng Trên Cỏ Xanh thông điệp trân trọng tuổi thơ và cuộc sống bình
17
+ dị
18
+ - source_sentence: iPhone 16
19
+ sentences:
20
+ - Cà Phê Cùng Tony kết hợp giải trí và giáo dục
21
+ - iPhone 16 Pro RAM 12GB đa nhiệm mạnh mẽ
22
+ - Loafer Gucci size từ 38 đến 45
23
+ - source_sentence: Áo Thun
24
+ sentences:
25
+ - phù hợp trong thời tiết nóng bức
26
+ - thấm hút mồ hôi, nhẹ và thoáng khí
27
+ - Giày chạy đường dài bền nhẹ
28
+ - source_sentence: Son Môi MAC Matte Lipstick - Ruby Woo
29
+ sentences:
30
+ - bảo quản dễ dàng bằng cách lộn trái khi giặt, tránh chất tẩy mạnh và phơi nơi
31
+ thoáng mát
32
+ - chất son lì mịn, bám màu 6-8 giờ
33
+ - tác phẩm kinh điển về tâm linh và triết học
34
+ - source_sentence: LEGO City Police Station
35
+ sentences:
36
+ - mô hình đẹp mắt để trưng bày
37
+ - dễ dàng phối đồ từ áo thun, sơ mi đến blazer
38
+ - chỉ số SPF 50+ PA+++ bảo vệ tối ưu khỏi tia UV
39
+ pipeline_tag: sentence-similarity
40
+ library_name: sentence-transformers
41
+ metrics:
42
+ - cosine_accuracy@1
43
+ - cosine_accuracy@3
44
+ - cosine_accuracy@5
45
+ - cosine_accuracy@10
46
+ - cosine_precision@1
47
+ - cosine_precision@3
48
+ - cosine_precision@5
49
+ - cosine_precision@10
50
+ - cosine_recall@1
51
+ - cosine_recall@3
52
+ - cosine_recall@5
53
+ - cosine_recall@10
54
+ - cosine_ndcg@10
55
+ - cosine_mrr@10
56
+ - cosine_map@100
57
+ model-index:
58
+ - name: SentenceTransformer based on keepitreal/vietnamese-sbert
59
+ results:
60
+ - task:
61
+ type: information-retrieval
62
+ name: Information Retrieval
63
+ dataset:
64
+ name: dim 768
65
+ type: dim_768
66
+ metrics:
67
+ - type: cosine_accuracy@1
68
+ value: 0.0
69
+ name: Cosine Accuracy@1
70
+ - type: cosine_accuracy@3
71
+ value: 0.0
72
+ name: Cosine Accuracy@3
73
+ - type: cosine_accuracy@5
74
+ value: 0.02702702702702703
75
+ name: Cosine Accuracy@5
76
+ - type: cosine_accuracy@10
77
+ value: 0.5675675675675675
78
+ name: Cosine Accuracy@10
79
+ - type: cosine_precision@1
80
+ value: 0.0
81
+ name: Cosine Precision@1
82
+ - type: cosine_precision@3
83
+ value: 0.0
84
+ name: Cosine Precision@3
85
+ - type: cosine_precision@5
86
+ value: 0.005405405405405406
87
+ name: Cosine Precision@5
88
+ - type: cosine_precision@10
89
+ value: 0.056756756756756774
90
+ name: Cosine Precision@10
91
+ - type: cosine_recall@1
92
+ value: 0.0
93
+ name: Cosine Recall@1
94
+ - type: cosine_recall@3
95
+ value: 0.0
96
+ name: Cosine Recall@3
97
+ - type: cosine_recall@5
98
+ value: 0.02702702702702703
99
+ name: Cosine Recall@5
100
+ - type: cosine_recall@10
101
+ value: 0.5675675675675675
102
+ name: Cosine Recall@10
103
+ - type: cosine_ndcg@10
104
+ value: 0.1783581729179075
105
+ name: Cosine Ndcg@10
106
+ - type: cosine_mrr@10
107
+ value: 0.07062419562419564
108
+ name: Cosine Mrr@10
109
+ - type: cosine_map@100
110
+ value: 0.07973358512714
111
+ name: Cosine Map@100
112
+ - task:
113
+ type: information-retrieval
114
+ name: Information Retrieval
115
+ dataset:
116
+ name: dim 512
117
+ type: dim_512
118
+ metrics:
119
+ - type: cosine_accuracy@1
120
+ value: 0.0
121
+ name: Cosine Accuracy@1
122
+ - type: cosine_accuracy@3
123
+ value: 0.0
124
+ name: Cosine Accuracy@3
125
+ - type: cosine_accuracy@5
126
+ value: 0.0
127
+ name: Cosine Accuracy@5
128
+ - type: cosine_accuracy@10
129
+ value: 0.5405405405405406
130
+ name: Cosine Accuracy@10
131
+ - type: cosine_precision@1
132
+ value: 0.0
133
+ name: Cosine Precision@1
134
+ - type: cosine_precision@3
135
+ value: 0.0
136
+ name: Cosine Precision@3
137
+ - type: cosine_precision@5
138
+ value: 0.0
139
+ name: Cosine Precision@5
140
+ - type: cosine_precision@10
141
+ value: 0.054054054054054064
142
+ name: Cosine Precision@10
143
+ - type: cosine_recall@1
144
+ value: 0.0
145
+ name: Cosine Recall@1
146
+ - type: cosine_recall@3
147
+ value: 0.0
148
+ name: Cosine Recall@3
149
+ - type: cosine_recall@5
150
+ value: 0.0
151
+ name: Cosine Recall@5
152
+ - type: cosine_recall@10
153
+ value: 0.5405405405405406
154
+ name: Cosine Recall@10
155
+ - type: cosine_ndcg@10
156
+ value: 0.1701742309301506
157
+ name: Cosine Ndcg@10
158
+ - type: cosine_mrr@10
159
+ value: 0.06747104247104248
160
+ name: Cosine Mrr@10
161
+ - type: cosine_map@100
162
+ value: 0.0782135520060237
163
+ name: Cosine Map@100
164
+ - task:
165
+ type: information-retrieval
166
+ name: Information Retrieval
167
+ dataset:
168
+ name: dim 256
169
+ type: dim_256
170
+ metrics:
171
+ - type: cosine_accuracy@1
172
+ value: 0.0
173
+ name: Cosine Accuracy@1
174
+ - type: cosine_accuracy@3
175
+ value: 0.0
176
+ name: Cosine Accuracy@3
177
+ - type: cosine_accuracy@5
178
+ value: 0.0
179
+ name: Cosine Accuracy@5
180
+ - type: cosine_accuracy@10
181
+ value: 0.5405405405405406
182
+ name: Cosine Accuracy@10
183
+ - type: cosine_precision@1
184
+ value: 0.0
185
+ name: Cosine Precision@1
186
+ - type: cosine_precision@3
187
+ value: 0.0
188
+ name: Cosine Precision@3
189
+ - type: cosine_precision@5
190
+ value: 0.0
191
+ name: Cosine Precision@5
192
+ - type: cosine_precision@10
193
+ value: 0.054054054054054064
194
+ name: Cosine Precision@10
195
+ - type: cosine_recall@1
196
+ value: 0.0
197
+ name: Cosine Recall@1
198
+ - type: cosine_recall@3
199
+ value: 0.0
200
+ name: Cosine Recall@3
201
+ - type: cosine_recall@5
202
+ value: 0.0
203
+ name: Cosine Recall@5
204
+ - type: cosine_recall@10
205
+ value: 0.5405405405405406
206
+ name: Cosine Recall@10
207
+ - type: cosine_ndcg@10
208
+ value: 0.17224374024595593
209
+ name: Cosine Ndcg@10
210
+ - type: cosine_mrr@10
211
+ value: 0.06948734448734449
212
+ name: Cosine Mrr@10
213
+ - type: cosine_map@100
214
+ value: 0.07938312163919391
215
+ name: Cosine Map@100
216
+ - task:
217
+ type: information-retrieval
218
+ name: Information Retrieval
219
+ dataset:
220
+ name: dim 128
221
+ type: dim_128
222
+ metrics:
223
+ - type: cosine_accuracy@1
224
+ value: 0.0
225
+ name: Cosine Accuracy@1
226
+ - type: cosine_accuracy@3
227
+ value: 0.0
228
+ name: Cosine Accuracy@3
229
+ - type: cosine_accuracy@5
230
+ value: 0.0
231
+ name: Cosine Accuracy@5
232
+ - type: cosine_accuracy@10
233
+ value: 0.5405405405405406
234
+ name: Cosine Accuracy@10
235
+ - type: cosine_precision@1
236
+ value: 0.0
237
+ name: Cosine Precision@1
238
+ - type: cosine_precision@3
239
+ value: 0.0
240
+ name: Cosine Precision@3
241
+ - type: cosine_precision@5
242
+ value: 0.0
243
+ name: Cosine Precision@5
244
+ - type: cosine_precision@10
245
+ value: 0.054054054054054064
246
+ name: Cosine Precision@10
247
+ - type: cosine_recall@1
248
+ value: 0.0
249
+ name: Cosine Recall@1
250
+ - type: cosine_recall@3
251
+ value: 0.0
252
+ name: Cosine Recall@3
253
+ - type: cosine_recall@5
254
+ value: 0.0
255
+ name: Cosine Recall@5
256
+ - type: cosine_recall@10
257
+ value: 0.5405405405405406
258
+ name: Cosine Recall@10
259
+ - type: cosine_ndcg@10
260
+ value: 0.1706353981690823
261
+ name: Cosine Ndcg@10
262
+ - type: cosine_mrr@10
263
+ value: 0.06785714285714285
264
+ name: Cosine Mrr@10
265
+ - type: cosine_map@100
266
+ value: 0.07606072355570134
267
+ name: Cosine Map@100
268
+ - task:
269
+ type: information-retrieval
270
+ name: Information Retrieval
271
+ dataset:
272
+ name: dim 64
273
+ type: dim_64
274
+ metrics:
275
+ - type: cosine_accuracy@1
276
+ value: 0.0
277
+ name: Cosine Accuracy@1
278
+ - type: cosine_accuracy@3
279
+ value: 0.0
280
+ name: Cosine Accuracy@3
281
+ - type: cosine_accuracy@5
282
+ value: 0.02702702702702703
283
+ name: Cosine Accuracy@5
284
+ - type: cosine_accuracy@10
285
+ value: 0.5135135135135135
286
+ name: Cosine Accuracy@10
287
+ - type: cosine_precision@1
288
+ value: 0.0
289
+ name: Cosine Precision@1
290
+ - type: cosine_precision@3
291
+ value: 0.0
292
+ name: Cosine Precision@3
293
+ - type: cosine_precision@5
294
+ value: 0.005405405405405406
295
+ name: Cosine Precision@5
296
+ - type: cosine_precision@10
297
+ value: 0.05135135135135136
298
+ name: Cosine Precision@10
299
+ - type: cosine_recall@1
300
+ value: 0.0
301
+ name: Cosine Recall@1
302
+ - type: cosine_recall@3
303
+ value: 0.0
304
+ name: Cosine Recall@3
305
+ - type: cosine_recall@5
306
+ value: 0.02702702702702703
307
+ name: Cosine Recall@5
308
+ - type: cosine_recall@10
309
+ value: 0.5135135135135135
310
+ name: Cosine Recall@10
311
+ - type: cosine_ndcg@10
312
+ value: 0.16481648451068456
313
+ name: Cosine Ndcg@10
314
+ - type: cosine_mrr@10
315
+ value: 0.06733161733161734
316
+ name: Cosine Mrr@10
317
+ - type: cosine_map@100
318
+ value: 0.07793528025726168
319
+ name: Cosine Map@100
320
+ ---
321
+
322
+ # SentenceTransformer based on keepitreal/vietnamese-sbert
323
+
324
+ 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.
325
+
326
+ ## Model Details
327
+
328
+ ### Model Description
329
+ - **Model Type:** Sentence Transformer
330
+ - **Base model:** [keepitreal/vietnamese-sbert](https://huggingface.co/keepitreal/vietnamese-sbert) <!-- at revision a9467ef2ef47caa6448edeabfd8e5e5ce0fa2a23 -->
331
+ - **Maximum Sequence Length:** 256 tokens
332
+ - **Output Dimensionality:** 768 dimensions
333
+ - **Similarity Function:** Cosine Similarity
334
+ - **Training Dataset:**
335
+ - json
336
+ <!-- - **Language:** Unknown -->
337
+ <!-- - **License:** Unknown -->
338
+
339
+ ### Model Sources
340
+
341
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
342
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
343
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
344
+
345
+ ### Full Model Architecture
346
+
347
+ ```
348
+ SentenceTransformer(
349
+ (0): Transformer({'max_seq_length': 256, 'do_lower_case': False}) with Transformer model: RobertaModel
350
+ (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})
351
+ )
352
+ ```
353
+
354
+ ## Usage
355
+
356
+ ### Direct Usage (Sentence Transformers)
357
+
358
+ First install the Sentence Transformers library:
359
+
360
+ ```bash
361
+ pip install -U sentence-transformers
362
+ ```
363
+
364
+ Then you can load this model and run inference.
365
+ ```python
366
+ from sentence_transformers import SentenceTransformer
367
+
368
+ # Download from the 🤗 Hub
369
+ model = SentenceTransformer("NghiBuine/ecommerce-product-search-model")
370
+ # Run inference
371
+ sentences = [
372
+ 'LEGO City Police Station',
373
+ 'mô hình đẹp mắt để trưng bày',
374
+ 'dễ dàng phối đồ từ áo thun, sơ mi đến blazer',
375
+ ]
376
+ embeddings = model.encode(sentences)
377
+ print(embeddings.shape)
378
+ # [3, 768]
379
+
380
+ # Get the similarity scores for the embeddings
381
+ similarities = model.similarity(embeddings, embeddings)
382
+ print(similarities.shape)
383
+ # [3, 3]
384
+ ```
385
+
386
+ <!--
387
+ ### Direct Usage (Transformers)
388
+
389
+ <details><summary>Click to see the direct usage in Transformers</summary>
390
+
391
+ </details>
392
+ -->
393
+
394
+ <!--
395
+ ### Downstream Usage (Sentence Transformers)
396
+
397
+ You can finetune this model on your own dataset.
398
+
399
+ <details><summary>Click to expand</summary>
400
+
401
+ </details>
402
+ -->
403
+
404
+ <!--
405
+ ### Out-of-Scope Use
406
+
407
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
408
+ -->
409
+
410
+ ## Evaluation
411
+
412
+ ### Metrics
413
+
414
+ #### Information Retrieval
415
+
416
+ * Dataset: `dim_768`
417
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator) with these parameters:
418
+ ```json
419
+ {
420
+ "truncate_dim": 768
421
+ }
422
+ ```
423
+
424
+ | Metric | Value |
425
+ |:--------------------|:-----------|
426
+ | cosine_accuracy@1 | 0.0 |
427
+ | cosine_accuracy@3 | 0.0 |
428
+ | cosine_accuracy@5 | 0.027 |
429
+ | cosine_accuracy@10 | 0.5676 |
430
+ | cosine_precision@1 | 0.0 |
431
+ | cosine_precision@3 | 0.0 |
432
+ | cosine_precision@5 | 0.0054 |
433
+ | cosine_precision@10 | 0.0568 |
434
+ | cosine_recall@1 | 0.0 |
435
+ | cosine_recall@3 | 0.0 |
436
+ | cosine_recall@5 | 0.027 |
437
+ | cosine_recall@10 | 0.5676 |
438
+ | **cosine_ndcg@10** | **0.1784** |
439
+ | cosine_mrr@10 | 0.0706 |
440
+ | cosine_map@100 | 0.0797 |
441
+
442
+ #### Information Retrieval
443
+
444
+ * Dataset: `dim_512`
445
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator) with these parameters:
446
+ ```json
447
+ {
448
+ "truncate_dim": 512
449
+ }
450
+ ```
451
+
452
+ | Metric | Value |
453
+ |:--------------------|:-----------|
454
+ | cosine_accuracy@1 | 0.0 |
455
+ | cosine_accuracy@3 | 0.0 |
456
+ | cosine_accuracy@5 | 0.0 |
457
+ | cosine_accuracy@10 | 0.5405 |
458
+ | cosine_precision@1 | 0.0 |
459
+ | cosine_precision@3 | 0.0 |
460
+ | cosine_precision@5 | 0.0 |
461
+ | cosine_precision@10 | 0.0541 |
462
+ | cosine_recall@1 | 0.0 |
463
+ | cosine_recall@3 | 0.0 |
464
+ | cosine_recall@5 | 0.0 |
465
+ | cosine_recall@10 | 0.5405 |
466
+ | **cosine_ndcg@10** | **0.1702** |
467
+ | cosine_mrr@10 | 0.0675 |
468
+ | cosine_map@100 | 0.0782 |
469
+
470
+ #### Information Retrieval
471
+
472
+ * Dataset: `dim_256`
473
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator) with these parameters:
474
+ ```json
475
+ {
476
+ "truncate_dim": 256
477
+ }
478
+ ```
479
+
480
+ | Metric | Value |
481
+ |:--------------------|:-----------|
482
+ | cosine_accuracy@1 | 0.0 |
483
+ | cosine_accuracy@3 | 0.0 |
484
+ | cosine_accuracy@5 | 0.0 |
485
+ | cosine_accuracy@10 | 0.5405 |
486
+ | cosine_precision@1 | 0.0 |
487
+ | cosine_precision@3 | 0.0 |
488
+ | cosine_precision@5 | 0.0 |
489
+ | cosine_precision@10 | 0.0541 |
490
+ | cosine_recall@1 | 0.0 |
491
+ | cosine_recall@3 | 0.0 |
492
+ | cosine_recall@5 | 0.0 |
493
+ | cosine_recall@10 | 0.5405 |
494
+ | **cosine_ndcg@10** | **0.1722** |
495
+ | cosine_mrr@10 | 0.0695 |
496
+ | cosine_map@100 | 0.0794 |
497
+
498
+ #### Information Retrieval
499
+
500
+ * Dataset: `dim_128`
501
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator) with these parameters:
502
+ ```json
503
+ {
504
+ "truncate_dim": 128
505
+ }
506
+ ```
507
+
508
+ | Metric | Value |
509
+ |:--------------------|:-----------|
510
+ | cosine_accuracy@1 | 0.0 |
511
+ | cosine_accuracy@3 | 0.0 |
512
+ | cosine_accuracy@5 | 0.0 |
513
+ | cosine_accuracy@10 | 0.5405 |
514
+ | cosine_precision@1 | 0.0 |
515
+ | cosine_precision@3 | 0.0 |
516
+ | cosine_precision@5 | 0.0 |
517
+ | cosine_precision@10 | 0.0541 |
518
+ | cosine_recall@1 | 0.0 |
519
+ | cosine_recall@3 | 0.0 |
520
+ | cosine_recall@5 | 0.0 |
521
+ | cosine_recall@10 | 0.5405 |
522
+ | **cosine_ndcg@10** | **0.1706** |
523
+ | cosine_mrr@10 | 0.0679 |
524
+ | cosine_map@100 | 0.0761 |
525
+
526
+ #### Information Retrieval
527
+
528
+ * Dataset: `dim_64`
529
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator) with these parameters:
530
+ ```json
531
+ {
532
+ "truncate_dim": 64
533
+ }
534
+ ```
535
+
536
+ | Metric | Value |
537
+ |:--------------------|:-----------|
538
+ | cosine_accuracy@1 | 0.0 |
539
+ | cosine_accuracy@3 | 0.0 |
540
+ | cosine_accuracy@5 | 0.027 |
541
+ | cosine_accuracy@10 | 0.5135 |
542
+ | cosine_precision@1 | 0.0 |
543
+ | cosine_precision@3 | 0.0 |
544
+ | cosine_precision@5 | 0.0054 |
545
+ | cosine_precision@10 | 0.0514 |
546
+ | cosine_recall@1 | 0.0 |
547
+ | cosine_recall@3 | 0.0 |
548
+ | cosine_recall@5 | 0.027 |
549
+ | cosine_recall@10 | 0.5135 |
550
+ | **cosine_ndcg@10** | **0.1648** |
551
+ | cosine_mrr@10 | 0.0673 |
552
+ | cosine_map@100 | 0.0779 |
553
+
554
+ <!--
555
+ ## Bias, Risks and Limitations
556
+
557
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
558
+ -->
559
+
560
+ <!--
561
+ ### Recommendations
562
+
563
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
564
+ -->
565
+
566
+ ## Training Details
567
+
568
+ ### Training Dataset
569
+
570
+ #### json
571
+
572
+ * Dataset: json
573
+ * Size: 333 training samples
574
+ * Columns: <code>positive</code> and <code>anchor</code>
575
+ * Approximate statistics based on the first 333 samples:
576
+ | | positive | anchor |
577
+ |:--------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
578
+ | type | string | string |
579
+ | details | <ul><li>min: 4 tokens</li><li>mean: 9.73 tokens</li><li>max: 37 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 13.71 tokens</li><li>max: 41 tokens</li></ul> |
580
+ * Samples:
581
+ | positive | anchor |
582
+ |:--------------------------------------------|:-----------------------------------------------------------------------------------|
583
+ | <code>Giày Chạy Bộ Adidas Ultraboost</code> | <code>Ultraboost đế continental chống trượt</code> |
584
+ | <code>Cà Phê Cùng Tony</code> | <code>Cà Phê Cùng Tony chia sẻ bài học phát triển bản thân và sống tích cực</code> |
585
+ | <code>Đắc Nhân Tâm</code> | <code>phát triển kỹ năng thuyết phục và giao tiếp tự nhiên</code> |
586
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
587
+ ```json
588
+ {
589
+ "loss": "MultipleNegativesRankingLoss",
590
+ "matryoshka_dims": [
591
+ 768,
592
+ 512,
593
+ 256,
594
+ 128,
595
+ 64
596
+ ],
597
+ "matryoshka_weights": [
598
+ 1,
599
+ 1,
600
+ 1,
601
+ 1,
602
+ 1
603
+ ],
604
+ "n_dims_per_step": -1
605
+ }
606
+ ```
607
+
608
+ ### Training Hyperparameters
609
+ #### Non-Default Hyperparameters
610
+
611
+ - `eval_strategy`: epoch
612
+ - `per_device_train_batch_size`: 32
613
+ - `gradient_accumulation_steps`: 16
614
+ - `learning_rate`: 2e-05
615
+ - `num_train_epochs`: 4
616
+ - `bf16`: True
617
+ - `load_best_model_at_end`: True
618
+
619
+ #### All Hyperparameters
620
+ <details><summary>Click to expand</summary>
621
+
622
+ - `overwrite_output_dir`: False
623
+ - `do_predict`: False
624
+ - `eval_strategy`: epoch
625
+ - `prediction_loss_only`: True
626
+ - `per_device_train_batch_size`: 32
627
+ - `per_device_eval_batch_size`: 8
628
+ - `per_gpu_train_batch_size`: None
629
+ - `per_gpu_eval_batch_size`: None
630
+ - `gradient_accumulation_steps`: 16
631
+ - `eval_accumulation_steps`: None
632
+ - `learning_rate`: 2e-05
633
+ - `weight_decay`: 0.0
634
+ - `adam_beta1`: 0.9
635
+ - `adam_beta2`: 0.999
636
+ - `adam_epsilon`: 1e-08
637
+ - `max_grad_norm`: 1.0
638
+ - `num_train_epochs`: 4
639
+ - `max_steps`: -1
640
+ - `lr_scheduler_type`: linear
641
+ - `lr_scheduler_kwargs`: {}
642
+ - `warmup_ratio`: 0.0
643
+ - `warmup_steps`: 0
644
+ - `log_level`: passive
645
+ - `log_level_replica`: warning
646
+ - `log_on_each_node`: True
647
+ - `logging_nan_inf_filter`: True
648
+ - `save_safetensors`: True
649
+ - `save_on_each_node`: False
650
+ - `save_only_model`: False
651
+ - `restore_callback_states_from_checkpoint`: False
652
+ - `no_cuda`: False
653
+ - `use_cpu`: False
654
+ - `use_mps_device`: False
655
+ - `seed`: 42
656
+ - `data_seed`: None
657
+ - `jit_mode_eval`: False
658
+ - `use_ipex`: False
659
+ - `bf16`: True
660
+ - `fp16`: False
661
+ - `fp16_opt_level`: O1
662
+ - `half_precision_backend`: auto
663
+ - `bf16_full_eval`: False
664
+ - `fp16_full_eval`: False
665
+ - `tf32`: None
666
+ - `local_rank`: 0
667
+ - `ddp_backend`: None
668
+ - `tpu_num_cores`: None
669
+ - `tpu_metrics_debug`: False
670
+ - `debug`: []
671
+ - `dataloader_drop_last`: False
672
+ - `dataloader_num_workers`: 0
673
+ - `dataloader_prefetch_factor`: None
674
+ - `past_index`: -1
675
+ - `disable_tqdm`: False
676
+ - `remove_unused_columns`: True
677
+ - `label_names`: None
678
+ - `load_best_model_at_end`: True
679
+ - `ignore_data_skip`: False
680
+ - `fsdp`: []
681
+ - `fsdp_min_num_params`: 0
682
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
683
+ - `fsdp_transformer_layer_cls_to_wrap`: None
684
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
685
+ - `deepspeed`: None
686
+ - `label_smoothing_factor`: 0.0
687
+ - `optim`: adamw_torch
688
+ - `optim_args`: None
689
+ - `adafactor`: False
690
+ - `group_by_length`: False
691
+ - `length_column_name`: length
692
+ - `ddp_find_unused_parameters`: None
693
+ - `ddp_bucket_cap_mb`: None
694
+ - `ddp_broadcast_buffers`: False
695
+ - `dataloader_pin_memory`: True
696
+ - `dataloader_persistent_workers`: False
697
+ - `skip_memory_metrics`: True
698
+ - `use_legacy_prediction_loop`: False
699
+ - `push_to_hub`: False
700
+ - `resume_from_checkpoint`: None
701
+ - `hub_model_id`: None
702
+ - `hub_strategy`: every_save
703
+ - `hub_private_repo`: False
704
+ - `hub_always_push`: False
705
+ - `gradient_checkpointing`: False
706
+ - `gradient_checkpointing_kwargs`: None
707
+ - `include_inputs_for_metrics`: False
708
+ - `eval_do_concat_batches`: True
709
+ - `fp16_backend`: auto
710
+ - `push_to_hub_model_id`: None
711
+ - `push_to_hub_organization`: None
712
+ - `mp_parameters`:
713
+ - `auto_find_batch_size`: False
714
+ - `full_determinism`: False
715
+ - `torchdynamo`: None
716
+ - `ray_scope`: last
717
+ - `ddp_timeout`: 1800
718
+ - `torch_compile`: False
719
+ - `torch_compile_backend`: None
720
+ - `torch_compile_mode`: None
721
+ - `dispatch_batches`: None
722
+ - `split_batches`: None
723
+ - `include_tokens_per_second`: False
724
+ - `include_num_input_tokens_seen`: False
725
+ - `neftune_noise_alpha`: None
726
+ - `optim_target_modules`: None
727
+ - `batch_eval_metrics`: False
728
+ - `prompts`: None
729
+ - `batch_sampler`: batch_sampler
730
+ - `multi_dataset_batch_sampler`: proportional
731
+
732
+ </details>
733
+
734
+ ### Training Logs
735
+ | 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 |
736
+ |:-------:|:-----:|:----------------------:|:----------------------:|:----------------------:|:----------------------:|:---------------------:|
737
+ | 1.0 | 1 | 0.1716 | 0.1897 | 0.1450 | 0.1699 | 0.1542 |
738
+ | **2.0** | **3** | **0.179** | **0.171** | **0.1722** | **0.1719** | **0.1644** |
739
+ | 2.9091 | 4 | 0.1784 | 0.1702 | 0.1722 | 0.1706 | 0.1648 |
740
+
741
+ * The bold row denotes the saved checkpoint.
742
+
743
+ ### Framework Versions
744
+ - Python: 3.11.9
745
+ - Sentence Transformers: 4.1.0
746
+ - Transformers: 4.41.2
747
+ - PyTorch: 2.6.0+cu124
748
+ - Accelerate: 1.7.0
749
+ - Datasets: 2.19.1
750
+ - Tokenizers: 0.19.1
751
+
752
+ ## Citation
753
+
754
+ ### BibTeX
755
+
756
+ #### Sentence Transformers
757
+ ```bibtex
758
+ @inproceedings{reimers-2019-sentence-bert,
759
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
760
+ author = "Reimers, Nils and Gurevych, Iryna",
761
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
762
+ month = "11",
763
+ year = "2019",
764
+ publisher = "Association for Computational Linguistics",
765
+ url = "https://arxiv.org/abs/1908.10084",
766
+ }
767
+ ```
768
+
769
+ #### MatryoshkaLoss
770
+ ```bibtex
771
+ @misc{kusupati2024matryoshka,
772
+ title={Matryoshka Representation Learning},
773
+ 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},
774
+ year={2024},
775
+ eprint={2205.13147},
776
+ archivePrefix={arXiv},
777
+ primaryClass={cs.LG}
778
+ }
779
+ ```
780
+
781
+ #### MultipleNegativesRankingLoss
782
+ ```bibtex
783
+ @misc{henderson2017efficient,
784
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
785
+ 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},
786
+ year={2017},
787
+ eprint={1705.00652},
788
+ archivePrefix={arXiv},
789
+ primaryClass={cs.CL}
790
+ }
791
+ ```
792
+
793
+ <!--
794
+ ## Glossary
795
+
796
+ *Clearly define terms in order to be accessible across audiences.*
797
+ -->
798
+
799
+ <!--
800
+ ## Model Card Authors
801
+
802
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
803
+ -->
804
+
805
+ <!--
806
+ ## Model Card Contact
807
+
808
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
809
+ -->
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": "4.1.0",
4
+ "transformers": "4.41.2",
5
+ "pytorch": "2.6.0+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:da9a89e5cf5bf2354d3a29a11f225c3de72fe6a7e7591027fad355fb2ef486b2
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