Commit
ebb9baa
1 Parent(s): 6a0f1bc

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,753 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: []
3
+ library_name: sentence-transformers
4
+ tags:
5
+ - sentence-transformers
6
+ - sentence-similarity
7
+ - feature-extraction
8
+ - generated_from_trainer
9
+ - dataset_size:557850
10
+ - loss:MatryoshkaLoss
11
+ - loss:MultipleNegativesRankingLoss
12
+ base_model: aubmindlab/bert-base-arabertv02
13
+ datasets: []
14
+ metrics:
15
+ - pearson_cosine
16
+ - spearman_cosine
17
+ - pearson_manhattan
18
+ - spearman_manhattan
19
+ - pearson_euclidean
20
+ - spearman_euclidean
21
+ - pearson_dot
22
+ - spearman_dot
23
+ - pearson_max
24
+ - spearman_max
25
+ widget:
26
+ - source_sentence: ذكر متوازن بعناية يقف على قدم واحدة بالقرب من منطقة شاطئ المحيط
27
+ النظيفة
28
+ sentences:
29
+ - رجل يقدم عرضاً
30
+ - هناك رجل بالخارج قرب الشاطئ
31
+ - رجل يجلس على أريكه
32
+ - source_sentence: رجل يقفز إلى سريره القذر
33
+ sentences:
34
+ - السرير قذر.
35
+ - رجل يضحك أثناء غسيل الملابس
36
+ - الرجل على القمر
37
+ - source_sentence: الفتيات بالخارج
38
+ sentences:
39
+ - امرأة تلف الخيط إلى كرات بجانب كومة من الكرات
40
+ - فتيان يركبان في جولة متعة
41
+ - ثلاث فتيات يقفون سوية في غرفة واحدة تستمع وواحدة تكتب على الحائط والثالثة تتحدث
42
+ إليهن
43
+ - source_sentence: الرجل يرتدي قميصاً أزرق.
44
+ sentences:
45
+ - رجل يرتدي قميصاً أزرق يميل إلى الجدار بجانب الطريق مع شاحنة زرقاء وسيارة حمراء
46
+ مع الماء في الخلفية.
47
+ - كتاب القصص مفتوح
48
+ - رجل يرتدي قميص أسود يعزف على الجيتار.
49
+ - source_sentence: يجلس شاب ذو شعر أشقر على الحائط يقرأ جريدة بينما تمر امرأة وفتاة
50
+ شابة.
51
+ sentences:
52
+ - ذكر شاب ينظر إلى جريدة بينما تمر إمرأتان بجانبه
53
+ - رجل يستلقي على وجهه على مقعد في الحديقة.
54
+ - الشاب نائم بينما الأم تقود ابنتها إلى الحديقة
55
+ pipeline_tag: sentence-similarity
56
+ model-index:
57
+ - name: SentenceTransformer based on aubmindlab/bert-base-arabertv02
58
+ results:
59
+ - task:
60
+ type: semantic-similarity
61
+ name: Semantic Similarity
62
+ dataset:
63
+ name: sts test 768
64
+ type: sts-test-768
65
+ metrics:
66
+ - type: pearson_cosine
67
+ value: 0.5949906740977448
68
+ name: Pearson Cosine
69
+ - type: spearman_cosine
70
+ value: 0.6159750250469712
71
+ name: Spearman Cosine
72
+ - type: pearson_manhattan
73
+ value: 0.6295622269205102
74
+ name: Pearson Manhattan
75
+ - type: spearman_manhattan
76
+ value: 0.6269654283099967
77
+ name: Spearman Manhattan
78
+ - type: pearson_euclidean
79
+ value: 0.6326526932327604
80
+ name: Pearson Euclidean
81
+ - type: spearman_euclidean
82
+ value: 0.6317081341785673
83
+ name: Spearman Euclidean
84
+ - type: pearson_dot
85
+ value: 0.42816790752358297
86
+ name: Pearson Dot
87
+ - type: spearman_dot
88
+ value: 0.4295282086669423
89
+ name: Spearman Dot
90
+ - type: pearson_max
91
+ value: 0.6326526932327604
92
+ name: Pearson Max
93
+ - type: spearman_max
94
+ value: 0.6317081341785673
95
+ name: Spearman Max
96
+ - task:
97
+ type: semantic-similarity
98
+ name: Semantic Similarity
99
+ dataset:
100
+ name: sts test 512
101
+ type: sts-test-512
102
+ metrics:
103
+ - type: pearson_cosine
104
+ value: 0.5846223235167534
105
+ name: Pearson Cosine
106
+ - type: spearman_cosine
107
+ value: 0.6064092420664184
108
+ name: Spearman Cosine
109
+ - type: pearson_manhattan
110
+ value: 0.6287774004727389
111
+ name: Pearson Manhattan
112
+ - type: spearman_manhattan
113
+ value: 0.6263546541183983
114
+ name: Spearman Manhattan
115
+ - type: pearson_euclidean
116
+ value: 0.631267664308041
117
+ name: Pearson Euclidean
118
+ - type: spearman_euclidean
119
+ value: 0.6301778108727977
120
+ name: Spearman Euclidean
121
+ - type: pearson_dot
122
+ value: 0.3788565672017437
123
+ name: Pearson Dot
124
+ - type: spearman_dot
125
+ value: 0.37680551461721923
126
+ name: Spearman Dot
127
+ - type: pearson_max
128
+ value: 0.631267664308041
129
+ name: Pearson Max
130
+ - type: spearman_max
131
+ value: 0.6301778108727977
132
+ name: Spearman Max
133
+ - task:
134
+ type: semantic-similarity
135
+ name: Semantic Similarity
136
+ dataset:
137
+ name: sts test 256
138
+ type: sts-test-256
139
+ metrics:
140
+ - type: pearson_cosine
141
+ value: 0.5778623383989389
142
+ name: Pearson Cosine
143
+ - type: spearman_cosine
144
+ value: 0.5959667709300495
145
+ name: Spearman Cosine
146
+ - type: pearson_manhattan
147
+ value: 0.6242980982402613
148
+ name: Pearson Manhattan
149
+ - type: spearman_manhattan
150
+ value: 0.6217473192873829
151
+ name: Spearman Manhattan
152
+ - type: pearson_euclidean
153
+ value: 0.6237908608463304
154
+ name: Pearson Euclidean
155
+ - type: spearman_euclidean
156
+ value: 0.6215304658549996
157
+ name: Spearman Euclidean
158
+ - type: pearson_dot
159
+ value: 0.35968442092444003
160
+ name: Pearson Dot
161
+ - type: spearman_dot
162
+ value: 0.35304547874806785
163
+ name: Spearman Dot
164
+ - type: pearson_max
165
+ value: 0.6242980982402613
166
+ name: Pearson Max
167
+ - type: spearman_max
168
+ value: 0.6217473192873829
169
+ name: Spearman Max
170
+ - task:
171
+ type: semantic-similarity
172
+ name: Semantic Similarity
173
+ dataset:
174
+ name: sts test 128
175
+ type: sts-test-128
176
+ metrics:
177
+ - type: pearson_cosine
178
+ value: 0.5830782075122916
179
+ name: Pearson Cosine
180
+ - type: spearman_cosine
181
+ value: 0.6022044167653756
182
+ name: Spearman Cosine
183
+ - type: pearson_manhattan
184
+ value: 0.6151866925343435
185
+ name: Pearson Manhattan
186
+ - type: spearman_manhattan
187
+ value: 0.6121950064533626
188
+ name: Spearman Manhattan
189
+ - type: pearson_euclidean
190
+ value: 0.6162225316000448
191
+ name: Pearson Euclidean
192
+ - type: spearman_euclidean
193
+ value: 0.615301209345362
194
+ name: Spearman Euclidean
195
+ - type: pearson_dot
196
+ value: 0.40438461342780957
197
+ name: Pearson Dot
198
+ - type: spearman_dot
199
+ value: 0.40153111017443666
200
+ name: Spearman Dot
201
+ - type: pearson_max
202
+ value: 0.6162225316000448
203
+ name: Pearson Max
204
+ - type: spearman_max
205
+ value: 0.615301209345362
206
+ name: Spearman Max
207
+ - task:
208
+ type: semantic-similarity
209
+ name: Semantic Similarity
210
+ dataset:
211
+ name: sts test 64
212
+ type: sts-test-64
213
+ metrics:
214
+ - type: pearson_cosine
215
+ value: 0.5724838823862283
216
+ name: Pearson Cosine
217
+ - type: spearman_cosine
218
+ value: 0.5914127847098
219
+ name: Spearman Cosine
220
+ - type: pearson_manhattan
221
+ value: 0.6023812283389073
222
+ name: Pearson Manhattan
223
+ - type: spearman_manhattan
224
+ value: 0.5967205030284914
225
+ name: Spearman Manhattan
226
+ - type: pearson_euclidean
227
+ value: 0.6069294574719372
228
+ name: Pearson Euclidean
229
+ - type: spearman_euclidean
230
+ value: 0.6041440553344074
231
+ name: Spearman Euclidean
232
+ - type: pearson_dot
233
+ value: 0.36315938245739166
234
+ name: Pearson Dot
235
+ - type: spearman_dot
236
+ value: 0.358512645020771
237
+ name: Spearman Dot
238
+ - type: pearson_max
239
+ value: 0.6069294574719372
240
+ name: Pearson Max
241
+ - type: spearman_max
242
+ value: 0.6041440553344074
243
+ name: Spearman Max
244
+ ---
245
+
246
+ # SentenceTransformer based on aubmindlab/bert-base-arabertv02
247
+
248
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [aubmindlab/bert-base-arabertv02](https://huggingface.co/aubmindlab/bert-base-arabertv02) on the Omartificial-Intelligence-Space/arabic-n_li-triplet 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.
249
+
250
+ ## Model Details
251
+
252
+ ### Model Description
253
+ - **Model Type:** Sentence Transformer
254
+ - **Base model:** [aubmindlab/bert-base-arabertv02](https://huggingface.co/aubmindlab/bert-base-arabertv02) <!-- at revision 016fb9d6768f522a59c6e0d2d5d5d43a4e1bff60 -->
255
+ - **Maximum Sequence Length:** 512 tokens
256
+ - **Output Dimensionality:** 768 tokens
257
+ - **Similarity Function:** Cosine Similarity
258
+ - **Training Dataset:**
259
+ - Omartificial-Intelligence-Space/arabic-n_li-triplet
260
+ <!-- - **Language:** Unknown -->
261
+ <!-- - **License:** Unknown -->
262
+
263
+ ### Model Sources
264
+
265
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
266
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
267
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
268
+
269
+ ### Full Model Architecture
270
+
271
+ ```
272
+ SentenceTransformer(
273
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
274
+ (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})
275
+ )
276
+ ```
277
+
278
+ ## Usage
279
+
280
+ ### Direct Usage (Sentence Transformers)
281
+
282
+ First install the Sentence Transformers library:
283
+
284
+ ```bash
285
+ pip install -U sentence-transformers
286
+ ```
287
+
288
+ Then you can load this model and run inference.
289
+ ```python
290
+ from sentence_transformers import SentenceTransformer
291
+
292
+ # Download from the 🤗 Hub
293
+ model = SentenceTransformer("Omartificial-Intelligence-Space/Arabic-arabert-all-nli-triplet")
294
+ # Run inference
295
+ sentences = [
296
+ 'يجلس شاب ذو شعر أشقر على الحائط يقرأ جريدة بينما تمر امرأة وفتاة شابة.',
297
+ 'ذكر شاب ينظر إلى جريدة بينما تمر إمرأتان بجانبه',
298
+ 'الشاب نائم بينما الأم تقود ابنتها إلى الحديقة',
299
+ ]
300
+ embeddings = model.encode(sentences)
301
+ print(embeddings.shape)
302
+ # [3, 768]
303
+
304
+ # Get the similarity scores for the embeddings
305
+ similarities = model.similarity(embeddings, embeddings)
306
+ print(similarities.shape)
307
+ # [3, 3]
308
+ ```
309
+
310
+ <!--
311
+ ### Direct Usage (Transformers)
312
+
313
+ <details><summary>Click to see the direct usage in Transformers</summary>
314
+
315
+ </details>
316
+ -->
317
+
318
+ <!--
319
+ ### Downstream Usage (Sentence Transformers)
320
+
321
+ You can finetune this model on your own dataset.
322
+
323
+ <details><summary>Click to expand</summary>
324
+
325
+ </details>
326
+ -->
327
+
328
+ <!--
329
+ ### Out-of-Scope Use
330
+
331
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
332
+ -->
333
+
334
+ ## Evaluation
335
+
336
+ ### Metrics
337
+
338
+ #### Semantic Similarity
339
+ * Dataset: `sts-test-768`
340
+ * Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
341
+
342
+ | Metric | Value |
343
+ |:--------------------|:----------|
344
+ | pearson_cosine | 0.595 |
345
+ | **spearman_cosine** | **0.616** |
346
+ | pearson_manhattan | 0.6296 |
347
+ | spearman_manhattan | 0.627 |
348
+ | pearson_euclidean | 0.6327 |
349
+ | spearman_euclidean | 0.6317 |
350
+ | pearson_dot | 0.4282 |
351
+ | spearman_dot | 0.4295 |
352
+ | pearson_max | 0.6327 |
353
+ | spearman_max | 0.6317 |
354
+
355
+ #### Semantic Similarity
356
+ * Dataset: `sts-test-512`
357
+ * Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
358
+
359
+ | Metric | Value |
360
+ |:--------------------|:-----------|
361
+ | pearson_cosine | 0.5846 |
362
+ | **spearman_cosine** | **0.6064** |
363
+ | pearson_manhattan | 0.6288 |
364
+ | spearman_manhattan | 0.6264 |
365
+ | pearson_euclidean | 0.6313 |
366
+ | spearman_euclidean | 0.6302 |
367
+ | pearson_dot | 0.3789 |
368
+ | spearman_dot | 0.3768 |
369
+ | pearson_max | 0.6313 |
370
+ | spearman_max | 0.6302 |
371
+
372
+ #### Semantic Similarity
373
+ * Dataset: `sts-test-256`
374
+ * Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
375
+
376
+ | Metric | Value |
377
+ |:--------------------|:----------|
378
+ | pearson_cosine | 0.5779 |
379
+ | **spearman_cosine** | **0.596** |
380
+ | pearson_manhattan | 0.6243 |
381
+ | spearman_manhattan | 0.6217 |
382
+ | pearson_euclidean | 0.6238 |
383
+ | spearman_euclidean | 0.6215 |
384
+ | pearson_dot | 0.3597 |
385
+ | spearman_dot | 0.353 |
386
+ | pearson_max | 0.6243 |
387
+ | spearman_max | 0.6217 |
388
+
389
+ #### Semantic Similarity
390
+ * Dataset: `sts-test-128`
391
+ * Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
392
+
393
+ | Metric | Value |
394
+ |:--------------------|:-----------|
395
+ | pearson_cosine | 0.5831 |
396
+ | **spearman_cosine** | **0.6022** |
397
+ | pearson_manhattan | 0.6152 |
398
+ | spearman_manhattan | 0.6122 |
399
+ | pearson_euclidean | 0.6162 |
400
+ | spearman_euclidean | 0.6153 |
401
+ | pearson_dot | 0.4044 |
402
+ | spearman_dot | 0.4015 |
403
+ | pearson_max | 0.6162 |
404
+ | spearman_max | 0.6153 |
405
+
406
+ #### Semantic Similarity
407
+ * Dataset: `sts-test-64`
408
+ * Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
409
+
410
+ | Metric | Value |
411
+ |:--------------------|:-----------|
412
+ | pearson_cosine | 0.5725 |
413
+ | **spearman_cosine** | **0.5914** |
414
+ | pearson_manhattan | 0.6024 |
415
+ | spearman_manhattan | 0.5967 |
416
+ | pearson_euclidean | 0.6069 |
417
+ | spearman_euclidean | 0.6041 |
418
+ | pearson_dot | 0.3632 |
419
+ | spearman_dot | 0.3585 |
420
+ | pearson_max | 0.6069 |
421
+ | spearman_max | 0.6041 |
422
+
423
+ <!--
424
+ ## Bias, Risks and Limitations
425
+
426
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
427
+ -->
428
+
429
+ <!--
430
+ ### Recommendations
431
+
432
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
433
+ -->
434
+
435
+ ## Training Details
436
+
437
+ ### Training Dataset
438
+
439
+ #### Omartificial-Intelligence-Space/arabic-n_li-triplet
440
+
441
+ * Dataset: Omartificial-Intelligence-Space/arabic-n_li-triplet
442
+ * Size: 557,850 training samples
443
+ * Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
444
+ * Approximate statistics based on the first 1000 samples:
445
+ | | anchor | positive | negative |
446
+ |:--------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
447
+ | type | string | string | string |
448
+ | details | <ul><li>min: 4 tokens</li><li>mean: 8.02 tokens</li><li>max: 41 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 10.03 tokens</li><li>max: 34 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 10.72 tokens</li><li>max: 38 tokens</li></ul> |
449
+ * Samples:
450
+ | anchor | positive | negative |
451
+ |:------------------------------------------------------------|:--------------------------------------------|:------------------------------------|
452
+ | <code>شخص على حصان يقفز فوق طائرة معطلة</code> | <code>شخص في الهواء الطلق، على حصان.</code> | <code>شخص في مطعم، يطلب عجة.</code> |
453
+ | <code>أطفال يبتسمون و يلوحون للكاميرا</code> | <code>هناك أطفال حاضرون</code> | <code>الاطفال يتجهمون</code> |
454
+ | <code>صبي يقفز على لوح التزلج في منتصف الجسر الأحمر.</code> | <code>الفتى يقوم بخدعة التزلج</code> | <code>الصبي يتزلج على الرصيف</code> |
455
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
456
+ ```json
457
+ {
458
+ "loss": "MultipleNegativesRankingLoss",
459
+ "matryoshka_dims": [
460
+ 768,
461
+ 512,
462
+ 256,
463
+ 128,
464
+ 64
465
+ ],
466
+ "matryoshka_weights": [
467
+ 1,
468
+ 1,
469
+ 1,
470
+ 1,
471
+ 1
472
+ ],
473
+ "n_dims_per_step": -1
474
+ }
475
+ ```
476
+
477
+ ### Evaluation Dataset
478
+
479
+ #### Omartificial-Intelligence-Space/arabic-n_li-triplet
480
+
481
+ * Dataset: Omartificial-Intelligence-Space/arabic-n_li-triplet
482
+ * Size: 6,584 evaluation samples
483
+ * Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
484
+ * Approximate statistics based on the first 1000 samples:
485
+ | | anchor | positive | negative |
486
+ |:--------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|
487
+ | type | string | string | string |
488
+ | details | <ul><li>min: 4 tokens</li><li>mean: 14.87 tokens</li><li>max: 70 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 7.54 tokens</li><li>max: 26 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 8.14 tokens</li><li>max: 23 tokens</li></ul> |
489
+ * Samples:
490
+ | anchor | positive | negative |
491
+ |:-----------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------|:---------------------------------------------------|
492
+ | <code>امرأتان يتعانقان بينما يحملان حزمة</code> | <code>إمرأتان يحملان حزمة</code> | <code>الرجال يتشاجرون خارج مطعم</code> |
493
+ | <code>طفلين صغيرين يرتديان قميصاً أزرق، أحدهما يرتدي الرقم 9 والآخر يرتدي الرقم 2 يقفان على خطوات خشبية في الحمام ويغسلان أيديهما في المغسلة.</code> | <code>طفلين يرتديان قميصاً مرقماً يغسلون أيديهم</code> | <code>طفلين يرتديان سترة يذهبان إلى المدرسة</code> |
494
+ | <code>رجل يبيع الدونات لعميل خلال معرض عالمي أقيم في مدينة أنجليس</code> | <code>رجل يبيع الدونات لعميل</code> | <code>امرأة تشرب قهوتها في مقهى صغير</code> |
495
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
496
+ ```json
497
+ {
498
+ "loss": "MultipleNegativesRankingLoss",
499
+ "matryoshka_dims": [
500
+ 768,
501
+ 512,
502
+ 256,
503
+ 128,
504
+ 64
505
+ ],
506
+ "matryoshka_weights": [
507
+ 1,
508
+ 1,
509
+ 1,
510
+ 1,
511
+ 1
512
+ ],
513
+ "n_dims_per_step": -1
514
+ }
515
+ ```
516
+
517
+ ### Training Hyperparameters
518
+ #### Non-Default Hyperparameters
519
+
520
+ - `per_device_train_batch_size`: 64
521
+ - `per_device_eval_batch_size`: 64
522
+ - `num_train_epochs`: 1
523
+ - `warmup_ratio`: 0.1
524
+ - `fp16`: True
525
+ - `batch_sampler`: no_duplicates
526
+
527
+ #### All Hyperparameters
528
+ <details><summary>Click to expand</summary>
529
+
530
+ - `overwrite_output_dir`: False
531
+ - `do_predict`: False
532
+ - `prediction_loss_only`: True
533
+ - `per_device_train_batch_size`: 64
534
+ - `per_device_eval_batch_size`: 64
535
+ - `per_gpu_train_batch_size`: None
536
+ - `per_gpu_eval_batch_size`: None
537
+ - `gradient_accumulation_steps`: 1
538
+ - `eval_accumulation_steps`: None
539
+ - `learning_rate`: 5e-05
540
+ - `weight_decay`: 0.0
541
+ - `adam_beta1`: 0.9
542
+ - `adam_beta2`: 0.999
543
+ - `adam_epsilon`: 1e-08
544
+ - `max_grad_norm`: 1.0
545
+ - `num_train_epochs`: 1
546
+ - `max_steps`: -1
547
+ - `lr_scheduler_type`: linear
548
+ - `lr_scheduler_kwargs`: {}
549
+ - `warmup_ratio`: 0.1
550
+ - `warmup_steps`: 0
551
+ - `log_level`: passive
552
+ - `log_level_replica`: warning
553
+ - `log_on_each_node`: True
554
+ - `logging_nan_inf_filter`: True
555
+ - `save_safetensors`: True
556
+ - `save_on_each_node`: False
557
+ - `save_only_model`: False
558
+ - `no_cuda`: False
559
+ - `use_cpu`: False
560
+ - `use_mps_device`: False
561
+ - `seed`: 42
562
+ - `data_seed`: None
563
+ - `jit_mode_eval`: False
564
+ - `use_ipex`: False
565
+ - `bf16`: False
566
+ - `fp16`: True
567
+ - `fp16_opt_level`: O1
568
+ - `half_precision_backend`: auto
569
+ - `bf16_full_eval`: False
570
+ - `fp16_full_eval`: False
571
+ - `tf32`: None
572
+ - `local_rank`: 0
573
+ - `ddp_backend`: None
574
+ - `tpu_num_cores`: None
575
+ - `tpu_metrics_debug`: False
576
+ - `debug`: []
577
+ - `dataloader_drop_last`: False
578
+ - `dataloader_num_workers`: 0
579
+ - `dataloader_prefetch_factor`: None
580
+ - `past_index`: -1
581
+ - `disable_tqdm`: False
582
+ - `remove_unused_columns`: True
583
+ - `label_names`: None
584
+ - `load_best_model_at_end`: False
585
+ - `ignore_data_skip`: False
586
+ - `fsdp`: []
587
+ - `fsdp_min_num_params`: 0
588
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
589
+ - `fsdp_transformer_layer_cls_to_wrap`: None
590
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'gradient_accumulation_kwargs': None}
591
+ - `deepspeed`: None
592
+ - `label_smoothing_factor`: 0.0
593
+ - `optim`: adamw_torch
594
+ - `optim_args`: None
595
+ - `adafactor`: False
596
+ - `group_by_length`: False
597
+ - `length_column_name`: length
598
+ - `ddp_find_unused_parameters`: None
599
+ - `ddp_bucket_cap_mb`: None
600
+ - `ddp_broadcast_buffers`: False
601
+ - `dataloader_pin_memory`: True
602
+ - `dataloader_persistent_workers`: False
603
+ - `skip_memory_metrics`: True
604
+ - `use_legacy_prediction_loop`: False
605
+ - `push_to_hub`: False
606
+ - `resume_from_checkpoint`: None
607
+ - `hub_model_id`: None
608
+ - `hub_strategy`: every_save
609
+ - `hub_private_repo`: False
610
+ - `hub_always_push`: False
611
+ - `gradient_checkpointing`: False
612
+ - `gradient_checkpointing_kwargs`: None
613
+ - `include_inputs_for_metrics`: False
614
+ - `eval_do_concat_batches`: True
615
+ - `fp16_backend`: auto
616
+ - `push_to_hub_model_id`: None
617
+ - `push_to_hub_organization`: None
618
+ - `mp_parameters`:
619
+ - `auto_find_batch_size`: False
620
+ - `full_determinism`: False
621
+ - `torchdynamo`: None
622
+ - `ray_scope`: last
623
+ - `ddp_timeout`: 1800
624
+ - `torch_compile`: False
625
+ - `torch_compile_backend`: None
626
+ - `torch_compile_mode`: None
627
+ - `dispatch_batches`: None
628
+ - `split_batches`: None
629
+ - `include_tokens_per_second`: False
630
+ - `include_num_input_tokens_seen`: False
631
+ - `neftune_noise_alpha`: None
632
+ - `optim_target_modules`: None
633
+ - `batch_sampler`: no_duplicates
634
+ - `multi_dataset_batch_sampler`: proportional
635
+
636
+ </details>
637
+
638
+ ### Training Logs
639
+ | Epoch | Step | Training Loss | sts-test-128_spearman_cosine | sts-test-256_spearman_cosine | sts-test-512_spearman_cosine | sts-test-64_spearman_cosine | sts-test-768_spearman_cosine |
640
+ |:------:|:----:|:-------------:|:----------------------------:|:----------------------------:|:----------------------------:|:---------------------------:|:----------------------------:|
641
+ | 0.0229 | 200 | 14.4811 | - | - | - | - | - |
642
+ | 0.0459 | 400 | 9.0389 | - | - | - | - | - |
643
+ | 0.0688 | 600 | 8.1478 | - | - | - | - | - |
644
+ | 0.0918 | 800 | 7.168 | - | - | - | - | - |
645
+ | 0.1147 | 1000 | 7.1998 | - | - | - | - | - |
646
+ | 0.1377 | 1200 | 6.7985 | - | - | - | - | - |
647
+ | 0.1606 | 1400 | 6.3754 | - | - | - | - | - |
648
+ | 0.1835 | 1600 | 6.3202 | - | - | - | - | - |
649
+ | 0.2065 | 1800 | 5.9186 | - | - | - | - | - |
650
+ | 0.2294 | 2000 | 5.9594 | - | - | - | - | - |
651
+ | 0.2524 | 2200 | 6.0211 | - | - | - | - | - |
652
+ | 0.2753 | 2400 | 5.9984 | - | - | - | - | - |
653
+ | 0.2983 | 2600 | 5.8321 | - | - | - | - | - |
654
+ | 0.3212 | 2800 | 5.621 | - | - | - | - | - |
655
+ | 0.3442 | 3000 | 5.9004 | - | - | - | - | - |
656
+ | 0.3671 | 3200 | 5.562 | - | - | - | - | - |
657
+ | 0.3900 | 3400 | 5.5125 | - | - | - | - | - |
658
+ | 0.4130 | 3600 | 5.4922 | - | - | - | - | - |
659
+ | 0.4359 | 3800 | 5.3023 | - | - | - | - | - |
660
+ | 0.4589 | 4000 | 5.4376 | - | - | - | - | - |
661
+ | 0.4818 | 4200 | 5.1048 | - | - | - | - | - |
662
+ | 0.5048 | 4400 | 5.0605 | - | - | - | - | - |
663
+ | 0.5277 | 4600 | 4.9985 | - | - | - | - | - |
664
+ | 0.5506 | 4800 | 5.2594 | - | - | - | - | - |
665
+ | 0.5736 | 5000 | 5.2183 | - | - | - | - | - |
666
+ | 0.5965 | 5200 | 5.1621 | - | - | - | - | - |
667
+ | 0.6195 | 5400 | 5.166 | - | - | - | - | - |
668
+ | 0.6424 | 5600 | 5.2241 | - | - | - | - | - |
669
+ | 0.6654 | 5800 | 5.1342 | - | - | - | - | - |
670
+ | 0.6883 | 6000 | 5.2267 | - | - | - | - | - |
671
+ | 0.7113 | 6200 | 5.1083 | - | - | - | - | - |
672
+ | 0.7342 | 6400 | 5.0119 | - | - | - | - | - |
673
+ | 0.7571 | 6600 | 4.6471 | - | - | - | - | - |
674
+ | 0.7801 | 6800 | 3.6699 | - | - | - | - | - |
675
+ | 0.8030 | 7000 | 3.2954 | - | - | - | - | - |
676
+ | 0.8260 | 7200 | 3.1039 | - | - | - | - | - |
677
+ | 0.8489 | 7400 | 3.001 | - | - | - | - | - |
678
+ | 0.8719 | 7600 | 2.8992 | - | - | - | - | - |
679
+ | 0.8948 | 7800 | 2.7504 | - | - | - | - | - |
680
+ | 0.9177 | 8000 | 2.7891 | - | - | - | - | - |
681
+ | 0.9407 | 8200 | 2.7157 | - | - | - | - | - |
682
+ | 0.9636 | 8400 | 2.6795 | - | - | - | - | - |
683
+ | 0.9866 | 8600 | 2.6278 | - | - | - | - | - |
684
+ | 1.0 | 8717 | - | 0.6022 | 0.5960 | 0.6064 | 0.5914 | 0.6160 |
685
+
686
+
687
+ ### Framework Versions
688
+ - Python: 3.9.18
689
+ - Sentence Transformers: 3.0.1
690
+ - Transformers: 4.40.0
691
+ - PyTorch: 2.2.2+cu121
692
+ - Accelerate: 0.26.1
693
+ - Datasets: 2.19.0
694
+ - Tokenizers: 0.19.1
695
+
696
+ ## Citation
697
+
698
+ ### BibTeX
699
+
700
+ #### Sentence Transformers
701
+ ```bibtex
702
+ @inproceedings{reimers-2019-sentence-bert,
703
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
704
+ author = "Reimers, Nils and Gurevych, Iryna",
705
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
706
+ month = "11",
707
+ year = "2019",
708
+ publisher = "Association for Computational Linguistics",
709
+ url = "https://arxiv.org/abs/1908.10084",
710
+ }
711
+ ```
712
+
713
+ #### MatryoshkaLoss
714
+ ```bibtex
715
+ @misc{kusupati2024matryoshka,
716
+ title={Matryoshka Representation Learning},
717
+ 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},
718
+ year={2024},
719
+ eprint={2205.13147},
720
+ archivePrefix={arXiv},
721
+ primaryClass={cs.LG}
722
+ }
723
+ ```
724
+
725
+ #### MultipleNegativesRankingLoss
726
+ ```bibtex
727
+ @misc{henderson2017efficient,
728
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
729
+ 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},
730
+ year={2017},
731
+ eprint={1705.00652},
732
+ archivePrefix={arXiv},
733
+ primaryClass={cs.CL}
734
+ }
735
+ ```
736
+
737
+ <!--
738
+ ## Glossary
739
+
740
+ *Clearly define terms in order to be accessible across audiences.*
741
+ -->
742
+
743
+ <!--
744
+ ## Model Card Authors
745
+
746
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
747
+ -->
748
+
749
+ <!--
750
+ ## Model Card Contact
751
+
752
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
753
+ -->
config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "aubmindlab/bert-base-arabertv02",
3
+ "architectures": [
4
+ "BertModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 768,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 3072,
13
+ "layer_norm_eps": 1e-12,
14
+ "max_position_embeddings": 512,
15
+ "model_type": "bert",
16
+ "num_attention_heads": 12,
17
+ "num_hidden_layers": 12,
18
+ "pad_token_id": 0,
19
+ "position_embedding_type": "absolute",
20
+ "torch_dtype": "float32",
21
+ "transformers_version": "4.40.0",
22
+ "type_vocab_size": 2,
23
+ "use_cache": true,
24
+ "vocab_size": 64000
25
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "3.0.1",
4
+ "transformers": "4.40.0",
5
+ "pytorch": "2.2.2+cu121"
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:218d000a60a6df54bb6288ab75ad73f7502c7973585343b88f8913b2ec7080cc
3
+ size 540795752
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": 512,
3
+ "do_lower_case": false
4
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "4": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ },
43
+ "5": {
44
+ "content": "[رابط]",
45
+ "lstrip": false,
46
+ "normalized": true,
47
+ "rstrip": false,
48
+ "single_word": true,
49
+ "special": true
50
+ },
51
+ "6": {
52
+ "content": "[بريد]",
53
+ "lstrip": false,
54
+ "normalized": true,
55
+ "rstrip": false,
56
+ "single_word": true,
57
+ "special": true
58
+ },
59
+ "7": {
60
+ "content": "[مستخدم]",
61
+ "lstrip": false,
62
+ "normalized": true,
63
+ "rstrip": false,
64
+ "single_word": true,
65
+ "special": true
66
+ }
67
+ },
68
+ "clean_up_tokenization_spaces": true,
69
+ "cls_token": "[CLS]",
70
+ "do_basic_tokenize": true,
71
+ "do_lower_case": false,
72
+ "mask_token": "[MASK]",
73
+ "max_len": 512,
74
+ "model_max_length": 512,
75
+ "never_split": [
76
+ "[بريد]",
77
+ "[مستخدم]",
78
+ "[رابط]"
79
+ ],
80
+ "pad_token": "[PAD]",
81
+ "sep_token": "[SEP]",
82
+ "strip_accents": null,
83
+ "tokenize_chinese_chars": true,
84
+ "tokenizer_class": "BertTokenizer",
85
+ "unk_token": "[UNK]"
86
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff