NghiBuine commited on
Commit
0a1e8b9
·
verified ·
1 Parent(s): 55c10e6

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,691 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - sentence-transformers
4
+ - sentence-similarity
5
+ - feature-extraction
6
+ - generated_from_trainer
7
+ - dataset_size:63
8
+ - loss:MatryoshkaLoss
9
+ - loss:MultipleNegativesRankingLoss
10
+ base_model: keepitreal/vietnamese-sbert
11
+ widget:
12
+ - source_sentence: Samsung Galaxy S22 Ultra
13
+ sentences:
14
+ - Điện thoại camera 108MP
15
+ - Điện thoại RAM 12GB
16
+ - Điện thoại có zoom quang học 10x
17
+ - source_sentence: Google Pixel 8 Pro
18
+ sentences:
19
+ - Điện thoại có jack cắm tai nghe 3.5mm
20
+ - Điện thoại có bộ nhớ trong 256GB
21
+ - Điện thoại chụp ảnh đẹp
22
+ - source_sentence: Google Pixel 8
23
+ sentences:
24
+ - Điện thoại màn hình 120Hz
25
+ - Điện thoại giá rẻ
26
+ - Điện thoại Android mới nhất
27
+ - source_sentence: JBL Reflect Flow Pro
28
+ sentences:
29
+ - iPhone mới nhất
30
+ - Điện thoại màn hình cong
31
+ - Điện thoại có loa Harman Kardon
32
+ - source_sentence: Asus ROG Phone 7
33
+ sentences:
34
+ - Điện thoại có bút
35
+ - Điện thoại chơi game
36
+ - Điện thoại có đèn flash kép
37
+ pipeline_tag: sentence-similarity
38
+ library_name: sentence-transformers
39
+ metrics:
40
+ - cosine_accuracy@1
41
+ - cosine_accuracy@3
42
+ - cosine_accuracy@5
43
+ - cosine_accuracy@10
44
+ - cosine_precision@1
45
+ - cosine_precision@3
46
+ - cosine_precision@5
47
+ - cosine_precision@10
48
+ - cosine_recall@1
49
+ - cosine_recall@3
50
+ - cosine_recall@5
51
+ - cosine_recall@10
52
+ - cosine_ndcg@10
53
+ - cosine_mrr@10
54
+ - cosine_map@100
55
+ model-index:
56
+ - name: SentenceTransformer based on keepitreal/vietnamese-sbert
57
+ results:
58
+ - task:
59
+ type: information-retrieval
60
+ name: Information Retrieval
61
+ dataset:
62
+ name: dim 768
63
+ type: dim_768
64
+ metrics:
65
+ - type: cosine_accuracy@1
66
+ value: 0.0
67
+ name: Cosine Accuracy@1
68
+ - type: cosine_accuracy@3
69
+ value: 0.2857142857142857
70
+ name: Cosine Accuracy@3
71
+ - type: cosine_accuracy@5
72
+ value: 0.2857142857142857
73
+ name: Cosine Accuracy@5
74
+ - type: cosine_accuracy@10
75
+ value: 0.5714285714285714
76
+ name: Cosine Accuracy@10
77
+ - type: cosine_precision@1
78
+ value: 0.0
79
+ name: Cosine Precision@1
80
+ - type: cosine_precision@3
81
+ value: 0.09523809523809523
82
+ name: Cosine Precision@3
83
+ - type: cosine_precision@5
84
+ value: 0.05714285714285715
85
+ name: Cosine Precision@5
86
+ - type: cosine_precision@10
87
+ value: 0.05714285714285715
88
+ name: Cosine Precision@10
89
+ - type: cosine_recall@1
90
+ value: 0.0
91
+ name: Cosine Recall@1
92
+ - type: cosine_recall@3
93
+ value: 0.2857142857142857
94
+ name: Cosine Recall@3
95
+ - type: cosine_recall@5
96
+ value: 0.2857142857142857
97
+ name: Cosine Recall@5
98
+ - type: cosine_recall@10
99
+ value: 0.5714285714285714
100
+ name: Cosine Recall@10
101
+ - type: cosine_ndcg@10
102
+ value: 0.25679948860544627
103
+ name: Cosine Ndcg@10
104
+ - type: cosine_mrr@10
105
+ value: 0.1598639455782313
106
+ name: Cosine Mrr@10
107
+ - type: cosine_map@100
108
+ value: 0.17696777071484332
109
+ name: Cosine Map@100
110
+ - task:
111
+ type: information-retrieval
112
+ name: Information Retrieval
113
+ dataset:
114
+ name: dim 512
115
+ type: dim_512
116
+ metrics:
117
+ - type: cosine_accuracy@1
118
+ value: 0.0
119
+ name: Cosine Accuracy@1
120
+ - type: cosine_accuracy@3
121
+ value: 0.42857142857142855
122
+ name: Cosine Accuracy@3
123
+ - type: cosine_accuracy@5
124
+ value: 0.5714285714285714
125
+ name: Cosine Accuracy@5
126
+ - type: cosine_accuracy@10
127
+ value: 0.7142857142857143
128
+ name: Cosine Accuracy@10
129
+ - type: cosine_precision@1
130
+ value: 0.0
131
+ name: Cosine Precision@1
132
+ - type: cosine_precision@3
133
+ value: 0.14285714285714285
134
+ name: Cosine Precision@3
135
+ - type: cosine_precision@5
136
+ value: 0.1142857142857143
137
+ name: Cosine Precision@5
138
+ - type: cosine_precision@10
139
+ value: 0.07142857142857142
140
+ name: Cosine Precision@10
141
+ - type: cosine_recall@1
142
+ value: 0.0
143
+ name: Cosine Recall@1
144
+ - type: cosine_recall@3
145
+ value: 0.42857142857142855
146
+ name: Cosine Recall@3
147
+ - type: cosine_recall@5
148
+ value: 0.5714285714285714
149
+ name: Cosine Recall@5
150
+ - type: cosine_recall@10
151
+ value: 0.7142857142857143
152
+ name: Cosine Recall@10
153
+ - type: cosine_ndcg@10
154
+ value: 0.3358736991627618
155
+ name: Cosine Ndcg@10
156
+ - type: cosine_mrr@10
157
+ value: 0.21564625850340136
158
+ name: Cosine Mrr@10
159
+ - type: cosine_map@100
160
+ value: 0.22075481533609612
161
+ name: Cosine Map@100
162
+ - task:
163
+ type: information-retrieval
164
+ name: Information Retrieval
165
+ dataset:
166
+ name: dim 256
167
+ type: dim_256
168
+ metrics:
169
+ - type: cosine_accuracy@1
170
+ value: 0.0
171
+ name: Cosine Accuracy@1
172
+ - type: cosine_accuracy@3
173
+ value: 0.0
174
+ name: Cosine Accuracy@3
175
+ - type: cosine_accuracy@5
176
+ value: 0.2857142857142857
177
+ name: Cosine Accuracy@5
178
+ - type: cosine_accuracy@10
179
+ value: 0.5714285714285714
180
+ name: Cosine Accuracy@10
181
+ - type: cosine_precision@1
182
+ value: 0.0
183
+ name: Cosine Precision@1
184
+ - type: cosine_precision@3
185
+ value: 0.0
186
+ name: Cosine Precision@3
187
+ - type: cosine_precision@5
188
+ value: 0.05714285714285715
189
+ name: Cosine Precision@5
190
+ - type: cosine_precision@10
191
+ value: 0.05714285714285715
192
+ name: Cosine Precision@10
193
+ - type: cosine_recall@1
194
+ value: 0.0
195
+ name: Cosine Recall@1
196
+ - type: cosine_recall@3
197
+ value: 0.0
198
+ name: Cosine Recall@3
199
+ - type: cosine_recall@5
200
+ value: 0.2857142857142857
201
+ name: Cosine Recall@5
202
+ - type: cosine_recall@10
203
+ value: 0.5714285714285714
204
+ name: Cosine Recall@10
205
+ - type: cosine_ndcg@10
206
+ value: 0.22155623379830594
207
+ name: Cosine Ndcg@10
208
+ - type: cosine_mrr@10
209
+ value: 0.11564625850340135
210
+ name: Cosine Mrr@10
211
+ - type: cosine_map@100
212
+ value: 0.13073998125841443
213
+ name: Cosine Map@100
214
+ - task:
215
+ type: information-retrieval
216
+ name: Information Retrieval
217
+ dataset:
218
+ name: dim 128
219
+ type: dim_128
220
+ metrics:
221
+ - type: cosine_accuracy@1
222
+ value: 0.0
223
+ name: Cosine Accuracy@1
224
+ - type: cosine_accuracy@3
225
+ value: 0.14285714285714285
226
+ name: Cosine Accuracy@3
227
+ - type: cosine_accuracy@5
228
+ value: 0.2857142857142857
229
+ name: Cosine Accuracy@5
230
+ - type: cosine_accuracy@10
231
+ value: 0.42857142857142855
232
+ name: Cosine Accuracy@10
233
+ - type: cosine_precision@1
234
+ value: 0.0
235
+ name: Cosine Precision@1
236
+ - type: cosine_precision@3
237
+ value: 0.047619047619047616
238
+ name: Cosine Precision@3
239
+ - type: cosine_precision@5
240
+ value: 0.05714285714285715
241
+ name: Cosine Precision@5
242
+ - type: cosine_precision@10
243
+ value: 0.042857142857142864
244
+ name: Cosine Precision@10
245
+ - type: cosine_recall@1
246
+ value: 0.0
247
+ name: Cosine Recall@1
248
+ - type: cosine_recall@3
249
+ value: 0.14285714285714285
250
+ name: Cosine Recall@3
251
+ - type: cosine_recall@5
252
+ value: 0.2857142857142857
253
+ name: Cosine Recall@5
254
+ - type: cosine_recall@10
255
+ value: 0.42857142857142855
256
+ name: Cosine Recall@10
257
+ - type: cosine_ndcg@10
258
+ value: 0.18057284162953233
259
+ name: Cosine Ndcg@10
260
+ - type: cosine_mrr@10
261
+ value: 0.10374149659863945
262
+ name: Cosine Mrr@10
263
+ - type: cosine_map@100
264
+ value: 0.11943368484517551
265
+ name: Cosine Map@100
266
+ - task:
267
+ type: information-retrieval
268
+ name: Information Retrieval
269
+ dataset:
270
+ name: dim 64
271
+ type: dim_64
272
+ metrics:
273
+ - type: cosine_accuracy@1
274
+ value: 0.14285714285714285
275
+ name: Cosine Accuracy@1
276
+ - type: cosine_accuracy@3
277
+ value: 0.2857142857142857
278
+ name: Cosine Accuracy@3
279
+ - type: cosine_accuracy@5
280
+ value: 0.2857142857142857
281
+ name: Cosine Accuracy@5
282
+ - type: cosine_accuracy@10
283
+ value: 0.5714285714285714
284
+ name: Cosine Accuracy@10
285
+ - type: cosine_precision@1
286
+ value: 0.14285714285714285
287
+ name: Cosine Precision@1
288
+ - type: cosine_precision@3
289
+ value: 0.09523809523809523
290
+ name: Cosine Precision@3
291
+ - type: cosine_precision@5
292
+ value: 0.05714285714285715
293
+ name: Cosine Precision@5
294
+ - type: cosine_precision@10
295
+ value: 0.05714285714285715
296
+ name: Cosine Precision@10
297
+ - type: cosine_recall@1
298
+ value: 0.14285714285714285
299
+ name: Cosine Recall@1
300
+ - type: cosine_recall@3
301
+ value: 0.2857142857142857
302
+ name: Cosine Recall@3
303
+ - type: cosine_recall@5
304
+ value: 0.2857142857142857
305
+ name: Cosine Recall@5
306
+ - type: cosine_recall@10
307
+ value: 0.5714285714285714
308
+ name: Cosine Recall@10
309
+ - type: cosine_ndcg@10
310
+ value: 0.32106066086016677
311
+ name: Cosine Ndcg@10
312
+ - type: cosine_mrr@10
313
+ value: 0.24801587301587302
314
+ name: Cosine Mrr@10
315
+ - type: cosine_map@100
316
+ value: 0.2591176744402551
317
+ name: Cosine Map@100
318
+ ---
319
+
320
+ # SentenceTransformer based on keepitreal/vietnamese-sbert
321
+
322
+ 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.
323
+
324
+ ## Model Details
325
+
326
+ ### Model Description
327
+ - **Model Type:** Sentence Transformer
328
+ - **Base model:** [keepitreal/vietnamese-sbert](https://huggingface.co/keepitreal/vietnamese-sbert) <!-- at revision a9467ef2ef47caa6448edeabfd8e5e5ce0fa2a23 -->
329
+ - **Maximum Sequence Length:** 256 tokens
330
+ - **Output Dimensionality:** 768 dimensions
331
+ - **Similarity Function:** Cosine Similarity
332
+ - **Training Dataset:**
333
+ - json
334
+ <!-- - **Language:** Unknown -->
335
+ <!-- - **License:** Unknown -->
336
+
337
+ ### Model Sources
338
+
339
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
340
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
341
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
342
+
343
+ ### Full Model Architecture
344
+
345
+ ```
346
+ SentenceTransformer(
347
+ (0): Transformer({'max_seq_length': 256, 'do_lower_case': False}) with Transformer model: RobertaModel
348
+ (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})
349
+ )
350
+ ```
351
+
352
+ ## Usage
353
+
354
+ ### Direct Usage (Sentence Transformers)
355
+
356
+ First install the Sentence Transformers library:
357
+
358
+ ```bash
359
+ pip install -U sentence-transformers
360
+ ```
361
+
362
+ Then you can load this model and run inference.
363
+ ```python
364
+ from sentence_transformers import SentenceTransformer
365
+
366
+ # Download from the 🤗 Hub
367
+ model = SentenceTransformer("NghiBuine/phone-search-model")
368
+ # Run inference
369
+ sentences = [
370
+ 'Asus ROG Phone 7',
371
+ 'Điện thoại chơi game',
372
+ 'Điện thoại có đèn flash kép',
373
+ ]
374
+ embeddings = model.encode(sentences)
375
+ print(embeddings.shape)
376
+ # [3, 768]
377
+
378
+ # Get the similarity scores for the embeddings
379
+ similarities = model.similarity(embeddings, embeddings)
380
+ print(similarities.shape)
381
+ # [3, 3]
382
+ ```
383
+
384
+ <!--
385
+ ### Direct Usage (Transformers)
386
+
387
+ <details><summary>Click to see the direct usage in Transformers</summary>
388
+
389
+ </details>
390
+ -->
391
+
392
+ <!--
393
+ ### Downstream Usage (Sentence Transformers)
394
+
395
+ You can finetune this model on your own dataset.
396
+
397
+ <details><summary>Click to expand</summary>
398
+
399
+ </details>
400
+ -->
401
+
402
+ <!--
403
+ ### Out-of-Scope Use
404
+
405
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
406
+ -->
407
+
408
+ ## Evaluation
409
+
410
+ ### Metrics
411
+
412
+ #### Information Retrieval
413
+
414
+ * Datasets: `dim_768`, `dim_512`, `dim_256`, `dim_128` and `dim_64`
415
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
416
+
417
+ | Metric | dim_768 | dim_512 | dim_256 | dim_128 | dim_64 |
418
+ |:--------------------|:-----------|:-----------|:-----------|:-----------|:-----------|
419
+ | cosine_accuracy@1 | 0.0 | 0.0 | 0.0 | 0.0 | 0.1429 |
420
+ | cosine_accuracy@3 | 0.2857 | 0.4286 | 0.0 | 0.1429 | 0.2857 |
421
+ | cosine_accuracy@5 | 0.2857 | 0.5714 | 0.2857 | 0.2857 | 0.2857 |
422
+ | cosine_accuracy@10 | 0.5714 | 0.7143 | 0.5714 | 0.4286 | 0.5714 |
423
+ | cosine_precision@1 | 0.0 | 0.0 | 0.0 | 0.0 | 0.1429 |
424
+ | cosine_precision@3 | 0.0952 | 0.1429 | 0.0 | 0.0476 | 0.0952 |
425
+ | cosine_precision@5 | 0.0571 | 0.1143 | 0.0571 | 0.0571 | 0.0571 |
426
+ | cosine_precision@10 | 0.0571 | 0.0714 | 0.0571 | 0.0429 | 0.0571 |
427
+ | cosine_recall@1 | 0.0 | 0.0 | 0.0 | 0.0 | 0.1429 |
428
+ | cosine_recall@3 | 0.2857 | 0.4286 | 0.0 | 0.1429 | 0.2857 |
429
+ | cosine_recall@5 | 0.2857 | 0.5714 | 0.2857 | 0.2857 | 0.2857 |
430
+ | cosine_recall@10 | 0.5714 | 0.7143 | 0.5714 | 0.4286 | 0.5714 |
431
+ | **cosine_ndcg@10** | **0.2568** | **0.3359** | **0.2216** | **0.1806** | **0.3211** |
432
+ | cosine_mrr@10 | 0.1599 | 0.2156 | 0.1156 | 0.1037 | 0.248 |
433
+ | cosine_map@100 | 0.177 | 0.2208 | 0.1307 | 0.1194 | 0.2591 |
434
+
435
+ <!--
436
+ ## Bias, Risks and Limitations
437
+
438
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
439
+ -->
440
+
441
+ <!--
442
+ ### Recommendations
443
+
444
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
445
+ -->
446
+
447
+ ## Training Details
448
+
449
+ ### Training Dataset
450
+
451
+ #### json
452
+
453
+ * Dataset: json
454
+ * Size: 63 training samples
455
+ * Columns: <code>positive</code> and <code>anchor</code>
456
+ * Approximate statistics based on the first 63 samples:
457
+ | | positive | anchor |
458
+ |:--------|:--------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|
459
+ | type | string | string |
460
+ | details | <ul><li>min: 4 tokens</li><li>mean: 6.9 tokens</li><li>max: 15 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 7.86 tokens</li><li>max: 12 tokens</li></ul> |
461
+ * Samples:
462
+ | positive | anchor |
463
+ |:-----------------------------------------------------------|:-----------------------------------------|
464
+ | <code>Google Pixel 8</code> | <code>Điện thoại Android mới nhất</code> |
465
+ | <code>Samsung Galaxy S22 Ultra</code> | <code>Điện thoại có sạc không dây</code> |
466
+ | <code>Samsung Galaxy Note 20 Ultra đi kèm bút S Pen</code> | <code>Điện thoại có bút</code> |
467
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
468
+ ```json
469
+ {
470
+ "loss": "MultipleNegativesRankingLoss",
471
+ "matryoshka_dims": [
472
+ 768,
473
+ 512,
474
+ 256,
475
+ 128,
476
+ 64
477
+ ],
478
+ "matryoshka_weights": [
479
+ 1,
480
+ 1,
481
+ 1,
482
+ 1,
483
+ 1
484
+ ],
485
+ "n_dims_per_step": -1
486
+ }
487
+ ```
488
+
489
+ ### Training Hyperparameters
490
+ #### Non-Default Hyperparameters
491
+
492
+ - `eval_strategy`: epoch
493
+ - `per_device_train_batch_size`: 32
494
+ - `gradient_accumulation_steps`: 16
495
+ - `learning_rate`: 2e-05
496
+ - `num_train_epochs`: 4
497
+ - `bf16`: True
498
+ - `load_best_model_at_end`: True
499
+
500
+ #### All Hyperparameters
501
+ <details><summary>Click to expand</summary>
502
+
503
+ - `overwrite_output_dir`: False
504
+ - `do_predict`: False
505
+ - `eval_strategy`: epoch
506
+ - `prediction_loss_only`: True
507
+ - `per_device_train_batch_size`: 32
508
+ - `per_device_eval_batch_size`: 8
509
+ - `per_gpu_train_batch_size`: None
510
+ - `per_gpu_eval_batch_size`: None
511
+ - `gradient_accumulation_steps`: 16
512
+ - `eval_accumulation_steps`: None
513
+ - `learning_rate`: 2e-05
514
+ - `weight_decay`: 0.0
515
+ - `adam_beta1`: 0.9
516
+ - `adam_beta2`: 0.999
517
+ - `adam_epsilon`: 1e-08
518
+ - `max_grad_norm`: 1.0
519
+ - `num_train_epochs`: 4
520
+ - `max_steps`: -1
521
+ - `lr_scheduler_type`: linear
522
+ - `lr_scheduler_kwargs`: {}
523
+ - `warmup_ratio`: 0.0
524
+ - `warmup_steps`: 0
525
+ - `log_level`: passive
526
+ - `log_level_replica`: warning
527
+ - `log_on_each_node`: True
528
+ - `logging_nan_inf_filter`: True
529
+ - `save_safetensors`: True
530
+ - `save_on_each_node`: False
531
+ - `save_only_model`: False
532
+ - `restore_callback_states_from_checkpoint`: False
533
+ - `no_cuda`: False
534
+ - `use_cpu`: False
535
+ - `use_mps_device`: False
536
+ - `seed`: 42
537
+ - `data_seed`: None
538
+ - `jit_mode_eval`: False
539
+ - `use_ipex`: False
540
+ - `bf16`: True
541
+ - `fp16`: False
542
+ - `fp16_opt_level`: O1
543
+ - `half_precision_backend`: auto
544
+ - `bf16_full_eval`: False
545
+ - `fp16_full_eval`: False
546
+ - `tf32`: None
547
+ - `local_rank`: 0
548
+ - `ddp_backend`: None
549
+ - `tpu_num_cores`: None
550
+ - `tpu_metrics_debug`: False
551
+ - `debug`: []
552
+ - `dataloader_drop_last`: False
553
+ - `dataloader_num_workers`: 0
554
+ - `dataloader_prefetch_factor`: None
555
+ - `past_index`: -1
556
+ - `disable_tqdm`: False
557
+ - `remove_unused_columns`: True
558
+ - `label_names`: None
559
+ - `load_best_model_at_end`: True
560
+ - `ignore_data_skip`: False
561
+ - `fsdp`: []
562
+ - `fsdp_min_num_params`: 0
563
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
564
+ - `fsdp_transformer_layer_cls_to_wrap`: None
565
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
566
+ - `deepspeed`: None
567
+ - `label_smoothing_factor`: 0.0
568
+ - `optim`: adamw_torch
569
+ - `optim_args`: None
570
+ - `adafactor`: False
571
+ - `group_by_length`: False
572
+ - `length_column_name`: length
573
+ - `ddp_find_unused_parameters`: None
574
+ - `ddp_bucket_cap_mb`: None
575
+ - `ddp_broadcast_buffers`: False
576
+ - `dataloader_pin_memory`: True
577
+ - `dataloader_persistent_workers`: False
578
+ - `skip_memory_metrics`: True
579
+ - `use_legacy_prediction_loop`: False
580
+ - `push_to_hub`: False
581
+ - `resume_from_checkpoint`: None
582
+ - `hub_model_id`: None
583
+ - `hub_strategy`: every_save
584
+ - `hub_private_repo`: False
585
+ - `hub_always_push`: False
586
+ - `gradient_checkpointing`: False
587
+ - `gradient_checkpointing_kwargs`: None
588
+ - `include_inputs_for_metrics`: False
589
+ - `eval_do_concat_batches`: True
590
+ - `fp16_backend`: auto
591
+ - `push_to_hub_model_id`: None
592
+ - `push_to_hub_organization`: None
593
+ - `mp_parameters`:
594
+ - `auto_find_batch_size`: False
595
+ - `full_determinism`: False
596
+ - `torchdynamo`: None
597
+ - `ray_scope`: last
598
+ - `ddp_timeout`: 1800
599
+ - `torch_compile`: False
600
+ - `torch_compile_backend`: None
601
+ - `torch_compile_mode`: None
602
+ - `dispatch_batches`: None
603
+ - `split_batches`: None
604
+ - `include_tokens_per_second`: False
605
+ - `include_num_input_tokens_seen`: False
606
+ - `neftune_noise_alpha`: None
607
+ - `optim_target_modules`: None
608
+ - `batch_eval_metrics`: False
609
+ - `prompts`: None
610
+ - `batch_sampler`: batch_sampler
611
+ - `multi_dataset_batch_sampler`: proportional
612
+
613
+ </details>
614
+
615
+ ### Training Logs
616
+ | 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 |
617
+ |:-------:|:-----:|:----------------------:|:----------------------:|:----------------------:|:----------------------:|:---------------------:|
618
+ | **1.0** | **1** | **0.3188** | **0.3971** | **0.3073** | **0.1945** | **0.2442** |
619
+ | 2.0 | 2 | 0.3209 | 0.3886 | 0.2545 | 0.1838 | 0.3194 |
620
+ | 3.0 | 3 | 0.2542 | 0.3359 | 0.2391 | 0.1838 | 0.3211 |
621
+ | 4.0 | 4 | 0.2568 | 0.3359 | 0.2216 | 0.1806 | 0.3211 |
622
+
623
+ * The bold row denotes the saved checkpoint.
624
+
625
+ ### Framework Versions
626
+ - Python: 3.11.0
627
+ - Sentence Transformers: 3.3.1
628
+ - Transformers: 4.41.2
629
+ - PyTorch: 2.5.1+cu124
630
+ - Accelerate: 1.1.1
631
+ - Datasets: 2.19.1
632
+ - Tokenizers: 0.19.1
633
+
634
+ ## Citation
635
+
636
+ ### BibTeX
637
+
638
+ #### Sentence Transformers
639
+ ```bibtex
640
+ @inproceedings{reimers-2019-sentence-bert,
641
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
642
+ author = "Reimers, Nils and Gurevych, Iryna",
643
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
644
+ month = "11",
645
+ year = "2019",
646
+ publisher = "Association for Computational Linguistics",
647
+ url = "https://arxiv.org/abs/1908.10084",
648
+ }
649
+ ```
650
+
651
+ #### MatryoshkaLoss
652
+ ```bibtex
653
+ @misc{kusupati2024matryoshka,
654
+ title={Matryoshka Representation Learning},
655
+ 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},
656
+ year={2024},
657
+ eprint={2205.13147},
658
+ archivePrefix={arXiv},
659
+ primaryClass={cs.LG}
660
+ }
661
+ ```
662
+
663
+ #### MultipleNegativesRankingLoss
664
+ ```bibtex
665
+ @misc{henderson2017efficient,
666
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
667
+ 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},
668
+ year={2017},
669
+ eprint={1705.00652},
670
+ archivePrefix={arXiv},
671
+ primaryClass={cs.CL}
672
+ }
673
+ ```
674
+
675
+ <!--
676
+ ## Glossary
677
+
678
+ *Clearly define terms in order to be accessible across audiences.*
679
+ -->
680
+
681
+ <!--
682
+ ## Model Card Authors
683
+
684
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
685
+ -->
686
+
687
+ <!--
688
+ ## Model Card Contact
689
+
690
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
691
+ -->
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:e173812ff9d883f3b25efe8a56d63606f450e97c4307c7b56bb36ea0d593b65c
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