Omartificial-Intelligence-Space commited on
Commit
d260201
·
verified ·
1 Parent(s): 83b9f0d

Add new SentenceTransformer model.

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
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,714 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: sentence-transformers/paraphrase-multilingual-mpnet-base-v2
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 sentence-transformers/paraphrase-multilingual-mpnet-base-v2
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.8538831619509135
68
+ name: Pearson Cosine
69
+ - type: spearman_cosine
70
+ value: 0.861625750018802
71
+ name: Spearman Cosine
72
+ - type: pearson_manhattan
73
+ value: 0.8496745674597512
74
+ name: Pearson Manhattan
75
+ - type: spearman_manhattan
76
+ value: 0.8513333417508545
77
+ name: Spearman Manhattan
78
+ - type: pearson_euclidean
79
+ value: 0.8516261261374778
80
+ name: Pearson Euclidean
81
+ - type: spearman_euclidean
82
+ value: 0.8540549341060195
83
+ name: Spearman Euclidean
84
+ - type: pearson_dot
85
+ value: 0.7281308266536204
86
+ name: Pearson Dot
87
+ - type: spearman_dot
88
+ value: 0.7230282720855726
89
+ name: Spearman Dot
90
+ - type: pearson_max
91
+ value: 0.8538831619509135
92
+ name: Pearson Max
93
+ - type: spearman_max
94
+ value: 0.861625750018802
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.8542379189261009
105
+ name: Pearson Cosine
106
+ - type: spearman_cosine
107
+ value: 0.8609329396560859
108
+ name: Spearman Cosine
109
+ - type: pearson_manhattan
110
+ value: 0.8486657899695456
111
+ name: Pearson Manhattan
112
+ - type: spearman_manhattan
113
+ value: 0.8512120732504748
114
+ name: Spearman Manhattan
115
+ - type: pearson_euclidean
116
+ value: 0.8505249483849495
117
+ name: Pearson Euclidean
118
+ - type: spearman_euclidean
119
+ value: 0.8538738365440234
120
+ name: Spearman Euclidean
121
+ - type: pearson_dot
122
+ value: 0.7075618032859148
123
+ name: Pearson Dot
124
+ - type: spearman_dot
125
+ value: 0.7028728329509918
126
+ name: Spearman Dot
127
+ - type: pearson_max
128
+ value: 0.8542379189261009
129
+ name: Pearson Max
130
+ - type: spearman_max
131
+ value: 0.8609329396560859
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.8486308733045101
142
+ name: Pearson Cosine
143
+ - type: spearman_cosine
144
+ value: 0.8578681811996274
145
+ name: Spearman Cosine
146
+ - type: pearson_manhattan
147
+ value: 0.8404506123980291
148
+ name: Pearson Manhattan
149
+ - type: spearman_manhattan
150
+ value: 0.845565163232125
151
+ name: Spearman Manhattan
152
+ - type: pearson_euclidean
153
+ value: 0.8414758099131773
154
+ name: Pearson Euclidean
155
+ - type: spearman_euclidean
156
+ value: 0.8471566121478254
157
+ name: Spearman Euclidean
158
+ - type: pearson_dot
159
+ value: 0.6668664182302968
160
+ name: Pearson Dot
161
+ - type: spearman_dot
162
+ value: 0.6651222481800894
163
+ name: Spearman Dot
164
+ - type: pearson_max
165
+ value: 0.8486308733045101
166
+ name: Pearson Max
167
+ - type: spearman_max
168
+ value: 0.8578681811996274
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.8389761445410956
179
+ name: Pearson Cosine
180
+ - type: spearman_cosine
181
+ value: 0.8499312736457453
182
+ name: Spearman Cosine
183
+ - type: pearson_manhattan
184
+ value: 0.8287388421834582
185
+ name: Pearson Manhattan
186
+ - type: spearman_manhattan
187
+ value: 0.8353046807483782
188
+ name: Spearman Manhattan
189
+ - type: pearson_euclidean
190
+ value: 0.8297699263897746
191
+ name: Pearson Euclidean
192
+ - type: spearman_euclidean
193
+ value: 0.8371843253238523
194
+ name: Spearman Euclidean
195
+ - type: pearson_dot
196
+ value: 0.5855876200722326
197
+ name: Pearson Dot
198
+ - type: spearman_dot
199
+ value: 0.5834920267418124
200
+ name: Spearman Dot
201
+ - type: pearson_max
202
+ value: 0.8389761445410956
203
+ name: Pearson Max
204
+ - type: spearman_max
205
+ value: 0.8499312736457453
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.8290685425698586
216
+ name: Pearson Cosine
217
+ - type: spearman_cosine
218
+ value: 0.8429054799136109
219
+ name: Spearman Cosine
220
+ - type: pearson_manhattan
221
+ value: 0.8100968316314205
222
+ name: Pearson Manhattan
223
+ - type: spearman_manhattan
224
+ value: 0.8221121550434057
225
+ name: Spearman Manhattan
226
+ - type: pearson_euclidean
227
+ value: 0.8129044863346081
228
+ name: Pearson Euclidean
229
+ - type: spearman_euclidean
230
+ value: 0.8255133471709527
231
+ name: Spearman Euclidean
232
+ - type: pearson_dot
233
+ value: 0.5067257944655903
234
+ name: Pearson Dot
235
+ - type: spearman_dot
236
+ value: 0.5109761436588146
237
+ name: Spearman Dot
238
+ - type: pearson_max
239
+ value: 0.8290685425698586
240
+ name: Pearson Max
241
+ - type: spearman_max
242
+ value: 0.8429054799136109
243
+ name: Spearman Max
244
+ ---
245
+
246
+ # SentenceTransformer based on sentence-transformers/paraphrase-multilingual-mpnet-base-v2
247
+
248
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/paraphrase-multilingual-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-multilingual-mpnet-base-v2) 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:** [sentence-transformers/paraphrase-multilingual-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-multilingual-mpnet-base-v2) <!-- at revision 79f2382ceacceacdf38563d7c5d16b9ff8d725d6 -->
255
+ - **Maximum Sequence Length:** 128 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': 128, 'do_lower_case': False}) with Transformer model: XLMRobertaModel
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/paraphrase-multilingual-mpnet-base-v2-Arabic-nli-matryoshka")
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.8539 |
345
+ | **spearman_cosine** | **0.8616** |
346
+ | pearson_manhattan | 0.8497 |
347
+ | spearman_manhattan | 0.8513 |
348
+ | pearson_euclidean | 0.8516 |
349
+ | spearman_euclidean | 0.8541 |
350
+ | pearson_dot | 0.7281 |
351
+ | spearman_dot | 0.723 |
352
+ | pearson_max | 0.8539 |
353
+ | spearman_max | 0.8616 |
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.8542 |
362
+ | **spearman_cosine** | **0.8609** |
363
+ | pearson_manhattan | 0.8487 |
364
+ | spearman_manhattan | 0.8512 |
365
+ | pearson_euclidean | 0.8505 |
366
+ | spearman_euclidean | 0.8539 |
367
+ | pearson_dot | 0.7076 |
368
+ | spearman_dot | 0.7029 |
369
+ | pearson_max | 0.8542 |
370
+ | spearman_max | 0.8609 |
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.8486 |
379
+ | **spearman_cosine** | **0.8579** |
380
+ | pearson_manhattan | 0.8405 |
381
+ | spearman_manhattan | 0.8456 |
382
+ | pearson_euclidean | 0.8415 |
383
+ | spearman_euclidean | 0.8472 |
384
+ | pearson_dot | 0.6669 |
385
+ | spearman_dot | 0.6651 |
386
+ | pearson_max | 0.8486 |
387
+ | spearman_max | 0.8579 |
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.839 |
396
+ | **spearman_cosine** | **0.8499** |
397
+ | pearson_manhattan | 0.8287 |
398
+ | spearman_manhattan | 0.8353 |
399
+ | pearson_euclidean | 0.8298 |
400
+ | spearman_euclidean | 0.8372 |
401
+ | pearson_dot | 0.5856 |
402
+ | spearman_dot | 0.5835 |
403
+ | pearson_max | 0.839 |
404
+ | spearman_max | 0.8499 |
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.8291 |
413
+ | **spearman_cosine** | **0.8429** |
414
+ | pearson_manhattan | 0.8101 |
415
+ | spearman_manhattan | 0.8221 |
416
+ | pearson_euclidean | 0.8129 |
417
+ | spearman_euclidean | 0.8255 |
418
+ | pearson_dot | 0.5067 |
419
+ | spearman_dot | 0.511 |
420
+ | pearson_max | 0.8291 |
421
+ | spearman_max | 0.8429 |
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: 5 tokens</li><li>mean: 10.33 tokens</li><li>max: 52 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 13.21 tokens</li><li>max: 49 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 15.32 tokens</li><li>max: 53 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: 5 tokens</li><li>mean: 21.86 tokens</li><li>max: 105 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 10.22 tokens</li><li>max: 49 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 11.2 tokens</li><li>max: 33 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`: 256
521
+ - `per_device_eval_batch_size`: 256
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`: 256
534
+ - `per_device_eval_batch_size`: 256
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.2294 | 500 | 10.1279 | - | - | - | - | - |
642
+ | 0.4587 | 1000 | 8.0384 | - | - | - | - | - |
643
+ | 0.6881 | 1500 | 7.3484 | - | - | - | - | - |
644
+ | 0.9174 | 2000 | 4.2216 | - | - | - | - | - |
645
+ | 1.0 | 2180 | - | 0.8499 | 0.8579 | 0.8609 | 0.8429 | 0.8616 |
646
+
647
+
648
+ ### Framework Versions
649
+ - Python: 3.9.18
650
+ - Sentence Transformers: 3.0.1
651
+ - Transformers: 4.40.0
652
+ - PyTorch: 2.2.2+cu121
653
+ - Accelerate: 0.26.1
654
+ - Datasets: 2.19.0
655
+ - Tokenizers: 0.19.1
656
+
657
+ ## Citation
658
+
659
+ ### BibTeX
660
+
661
+ #### Sentence Transformers
662
+ ```bibtex
663
+ @inproceedings{reimers-2019-sentence-bert,
664
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
665
+ author = "Reimers, Nils and Gurevych, Iryna",
666
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
667
+ month = "11",
668
+ year = "2019",
669
+ publisher = "Association for Computational Linguistics",
670
+ url = "https://arxiv.org/abs/1908.10084",
671
+ }
672
+ ```
673
+
674
+ #### MatryoshkaLoss
675
+ ```bibtex
676
+ @misc{kusupati2024matryoshka,
677
+ title={Matryoshka Representation Learning},
678
+ 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},
679
+ year={2024},
680
+ eprint={2205.13147},
681
+ archivePrefix={arXiv},
682
+ primaryClass={cs.LG}
683
+ }
684
+ ```
685
+
686
+ #### MultipleNegativesRankingLoss
687
+ ```bibtex
688
+ @misc{henderson2017efficient,
689
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
690
+ 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},
691
+ year={2017},
692
+ eprint={1705.00652},
693
+ archivePrefix={arXiv},
694
+ primaryClass={cs.CL}
695
+ }
696
+ ```
697
+
698
+ <!--
699
+ ## Glossary
700
+
701
+ *Clearly define terms in order to be accessible across audiences.*
702
+ -->
703
+
704
+ <!--
705
+ ## Model Card Authors
706
+
707
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
708
+ -->
709
+
710
+ <!--
711
+ ## Model Card Contact
712
+
713
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
714
+ -->
config.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "sentence-transformers/paraphrase-multilingual-mpnet-base-v2",
3
+ "architectures": [
4
+ "XLMRobertaModel"
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": 514,
18
+ "model_type": "xlm-roberta",
19
+ "num_attention_heads": 12,
20
+ "num_hidden_layers": 12,
21
+ "output_past": true,
22
+ "pad_token_id": 1,
23
+ "position_embedding_type": "absolute",
24
+ "torch_dtype": "float32",
25
+ "transformers_version": "4.40.0",
26
+ "type_vocab_size": 1,
27
+ "use_cache": true,
28
+ "vocab_size": 250002
29
+ }
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": null
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:94499f2ede1a5584f59396bc6865f0b8a2ecfcb7ecc6e27c8b1ebe8005e5cff4
3
+ size 1112197096
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": 128,
3
+ "do_lower_case": false
4
+ }
sentencepiece.bpe.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
3
+ size 5069051
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "<s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "</s>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "<mask>",
25
+ "lstrip": true,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "<pad>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "sep_token": {
38
+ "content": "</s>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false
43
+ },
44
+ "unk_token": {
45
+ "content": "<unk>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cad551d5600a84242d0973327029452a1e3672ba6313c2a3c3d69c4310e12719
3
+ size 17082987
tokenizer_config.json ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "250001": {
36
+ "content": "<mask>",
37
+ "lstrip": true,
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
+ "max_length": 128,
50
+ "model_max_length": 128,
51
+ "pad_to_multiple_of": null,
52
+ "pad_token": "<pad>",
53
+ "pad_token_type_id": 0,
54
+ "padding_side": "right",
55
+ "sep_token": "</s>",
56
+ "stride": 0,
57
+ "tokenizer_class": "XLMRobertaTokenizer",
58
+ "truncation_side": "right",
59
+ "truncation_strategy": "longest_first",
60
+ "unk_token": "<unk>"
61
+ }