Omartificial-Intelligence-Space
commited on
Commit
•
04069f6
1
Parent(s):
aa5a81e
Add new SentenceTransformer model.
Browse files- 1_Pooling/config.json +10 -0
- README.md +753 -0
- config.json +32 -0
- config_sentence_transformers.json +10 -0
- model.safetensors +3 -0
- modules.json +14 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +57 -0
- vocab.txt +0 -0
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: UBC-NLP/MARBERTv2
|
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 UBC-NLP/MARBERTv2
|
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.611168498883907
|
68 |
+
name: Pearson Cosine
|
69 |
+
- type: spearman_cosine
|
70 |
+
value: 0.6116733587939157
|
71 |
+
name: Spearman Cosine
|
72 |
+
- type: pearson_manhattan
|
73 |
+
value: 0.6443687886661206
|
74 |
+
name: Pearson Manhattan
|
75 |
+
- type: spearman_manhattan
|
76 |
+
value: 0.6358107360369792
|
77 |
+
name: Spearman Manhattan
|
78 |
+
- type: pearson_euclidean
|
79 |
+
value: 0.644404066642609
|
80 |
+
name: Pearson Euclidean
|
81 |
+
- type: spearman_euclidean
|
82 |
+
value: 0.6345893921062774
|
83 |
+
name: Spearman Euclidean
|
84 |
+
- type: pearson_dot
|
85 |
+
value: 0.4723643245352202
|
86 |
+
name: Pearson Dot
|
87 |
+
- type: spearman_dot
|
88 |
+
value: 0.44844519905410135
|
89 |
+
name: Spearman Dot
|
90 |
+
- type: pearson_max
|
91 |
+
value: 0.644404066642609
|
92 |
+
name: Pearson Max
|
93 |
+
- type: spearman_max
|
94 |
+
value: 0.6358107360369792
|
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.6664570291720014
|
105 |
+
name: Pearson Cosine
|
106 |
+
- type: spearman_cosine
|
107 |
+
value: 0.6647687532159875
|
108 |
+
name: Spearman Cosine
|
109 |
+
- type: pearson_manhattan
|
110 |
+
value: 0.6429976947418544
|
111 |
+
name: Pearson Manhattan
|
112 |
+
- type: spearman_manhattan
|
113 |
+
value: 0.6334753432753939
|
114 |
+
name: Spearman Manhattan
|
115 |
+
- type: pearson_euclidean
|
116 |
+
value: 0.6466249455585532
|
117 |
+
name: Pearson Euclidean
|
118 |
+
- type: spearman_euclidean
|
119 |
+
value: 0.6373181315122213
|
120 |
+
name: Spearman Euclidean
|
121 |
+
- type: pearson_dot
|
122 |
+
value: 0.5370129457359227
|
123 |
+
name: Pearson Dot
|
124 |
+
- type: spearman_dot
|
125 |
+
value: 0.5241649973373772
|
126 |
+
name: Spearman Dot
|
127 |
+
- type: pearson_max
|
128 |
+
value: 0.6664570291720014
|
129 |
+
name: Pearson Max
|
130 |
+
- type: spearman_max
|
131 |
+
value: 0.6647687532159875
|
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.6601248277308522
|
142 |
+
name: Pearson Cosine
|
143 |
+
- type: spearman_cosine
|
144 |
+
value: 0.6592739654246011
|
145 |
+
name: Spearman Cosine
|
146 |
+
- type: pearson_manhattan
|
147 |
+
value: 0.6361644543165994
|
148 |
+
name: Pearson Manhattan
|
149 |
+
- type: spearman_manhattan
|
150 |
+
value: 0.6250621947417249
|
151 |
+
name: Spearman Manhattan
|
152 |
+
- type: pearson_euclidean
|
153 |
+
value: 0.6408426652431157
|
154 |
+
name: Pearson Euclidean
|
155 |
+
- type: spearman_euclidean
|
156 |
+
value: 0.6300109524350457
|
157 |
+
name: Spearman Euclidean
|
158 |
+
- type: pearson_dot
|
159 |
+
value: 0.5250513197384045
|
160 |
+
name: Pearson Dot
|
161 |
+
- type: spearman_dot
|
162 |
+
value: 0.5154779060125071
|
163 |
+
name: Spearman Dot
|
164 |
+
- type: pearson_max
|
165 |
+
value: 0.6601248277308522
|
166 |
+
name: Pearson Max
|
167 |
+
- type: spearman_max
|
168 |
+
value: 0.6592739654246011
|
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.6549481034721005
|
179 |
+
name: Pearson Cosine
|
180 |
+
- type: spearman_cosine
|
181 |
+
value: 0.6523201621940143
|
182 |
+
name: Spearman Cosine
|
183 |
+
- type: pearson_manhattan
|
184 |
+
value: 0.6342700090917214
|
185 |
+
name: Pearson Manhattan
|
186 |
+
- type: spearman_manhattan
|
187 |
+
value: 0.6226791710099966
|
188 |
+
name: Spearman Manhattan
|
189 |
+
- type: pearson_euclidean
|
190 |
+
value: 0.6397224689512541
|
191 |
+
name: Pearson Euclidean
|
192 |
+
- type: spearman_euclidean
|
193 |
+
value: 0.6280973341704362
|
194 |
+
name: Spearman Euclidean
|
195 |
+
- type: pearson_dot
|
196 |
+
value: 0.47240889358810917
|
197 |
+
name: Pearson Dot
|
198 |
+
- type: spearman_dot
|
199 |
+
value: 0.4633669926372942
|
200 |
+
name: Spearman Dot
|
201 |
+
- type: pearson_max
|
202 |
+
value: 0.6549481034721005
|
203 |
+
name: Pearson Max
|
204 |
+
- type: spearman_max
|
205 |
+
value: 0.6523201621940143
|
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.6367217585211098
|
216 |
+
name: Pearson Cosine
|
217 |
+
- type: spearman_cosine
|
218 |
+
value: 0.6370191671711296
|
219 |
+
name: Spearman Cosine
|
220 |
+
- type: pearson_manhattan
|
221 |
+
value: 0.6263730801254332
|
222 |
+
name: Pearson Manhattan
|
223 |
+
- type: spearman_manhattan
|
224 |
+
value: 0.6118927366012856
|
225 |
+
name: Spearman Manhattan
|
226 |
+
- type: pearson_euclidean
|
227 |
+
value: 0.6327699647617465
|
228 |
+
name: Pearson Euclidean
|
229 |
+
- type: spearman_euclidean
|
230 |
+
value: 0.6180184829867724
|
231 |
+
name: Spearman Euclidean
|
232 |
+
- type: pearson_dot
|
233 |
+
value: 0.41169381399943167
|
234 |
+
name: Pearson Dot
|
235 |
+
- type: spearman_dot
|
236 |
+
value: 0.40444222536491986
|
237 |
+
name: Spearman Dot
|
238 |
+
- type: pearson_max
|
239 |
+
value: 0.6367217585211098
|
240 |
+
name: Pearson Max
|
241 |
+
- type: spearman_max
|
242 |
+
value: 0.6370191671711296
|
243 |
+
name: Spearman Max
|
244 |
+
---
|
245 |
+
|
246 |
+
# SentenceTransformer based on UBC-NLP/MARBERTv2
|
247 |
+
|
248 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [UBC-NLP/MARBERTv2](https://huggingface.co/UBC-NLP/MARBERTv2) 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:** [UBC-NLP/MARBERTv2](https://huggingface.co/UBC-NLP/MARBERTv2) <!-- at revision fe88db9db8ccdb0c4e1627495f405c44a5f89066 -->
|
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/Marbert-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.6112 |
|
345 |
+
| **spearman_cosine** | **0.6117** |
|
346 |
+
| pearson_manhattan | 0.6444 |
|
347 |
+
| spearman_manhattan | 0.6358 |
|
348 |
+
| pearson_euclidean | 0.6444 |
|
349 |
+
| spearman_euclidean | 0.6346 |
|
350 |
+
| pearson_dot | 0.4724 |
|
351 |
+
| spearman_dot | 0.4484 |
|
352 |
+
| pearson_max | 0.6444 |
|
353 |
+
| spearman_max | 0.6358 |
|
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.6665 |
|
362 |
+
| **spearman_cosine** | **0.6648** |
|
363 |
+
| pearson_manhattan | 0.643 |
|
364 |
+
| spearman_manhattan | 0.6335 |
|
365 |
+
| pearson_euclidean | 0.6466 |
|
366 |
+
| spearman_euclidean | 0.6373 |
|
367 |
+
| pearson_dot | 0.537 |
|
368 |
+
| spearman_dot | 0.5242 |
|
369 |
+
| pearson_max | 0.6665 |
|
370 |
+
| spearman_max | 0.6648 |
|
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.6601 |
|
379 |
+
| **spearman_cosine** | **0.6593** |
|
380 |
+
| pearson_manhattan | 0.6362 |
|
381 |
+
| spearman_manhattan | 0.6251 |
|
382 |
+
| pearson_euclidean | 0.6408 |
|
383 |
+
| spearman_euclidean | 0.63 |
|
384 |
+
| pearson_dot | 0.5251 |
|
385 |
+
| spearman_dot | 0.5155 |
|
386 |
+
| pearson_max | 0.6601 |
|
387 |
+
| spearman_max | 0.6593 |
|
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.6549 |
|
396 |
+
| **spearman_cosine** | **0.6523** |
|
397 |
+
| pearson_manhattan | 0.6343 |
|
398 |
+
| spearman_manhattan | 0.6227 |
|
399 |
+
| pearson_euclidean | 0.6397 |
|
400 |
+
| spearman_euclidean | 0.6281 |
|
401 |
+
| pearson_dot | 0.4724 |
|
402 |
+
| spearman_dot | 0.4634 |
|
403 |
+
| pearson_max | 0.6549 |
|
404 |
+
| spearman_max | 0.6523 |
|
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.6367 |
|
413 |
+
| **spearman_cosine** | **0.637** |
|
414 |
+
| pearson_manhattan | 0.6264 |
|
415 |
+
| spearman_manhattan | 0.6119 |
|
416 |
+
| pearson_euclidean | 0.6328 |
|
417 |
+
| spearman_euclidean | 0.618 |
|
418 |
+
| pearson_dot | 0.4117 |
|
419 |
+
| spearman_dot | 0.4044 |
|
420 |
+
| pearson_max | 0.6367 |
|
421 |
+
| spearman_max | 0.637 |
|
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: 7.68 tokens</li><li>max: 43 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 9.66 tokens</li><li>max: 35 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 10.47 tokens</li><li>max: 40 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.78 tokens</li><li>max: 70 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 7.41 tokens</li><li>max: 29 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 7.95 tokens</li><li>max: 21 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 | 25.0771 | - | - | - | - | - |
|
642 |
+
| 0.0459 | 400 | 9.1435 | - | - | - | - | - |
|
643 |
+
| 0.0688 | 600 | 8.0492 | - | - | - | - | - |
|
644 |
+
| 0.0918 | 800 | 7.1378 | - | - | - | - | - |
|
645 |
+
| 0.1147 | 1000 | 7.6249 | - | - | - | - | - |
|
646 |
+
| 0.1377 | 1200 | 7.3604 | - | - | - | - | - |
|
647 |
+
| 0.1606 | 1400 | 6.5783 | - | - | - | - | - |
|
648 |
+
| 0.1835 | 1600 | 6.4145 | - | - | - | - | - |
|
649 |
+
| 0.2065 | 1800 | 6.1781 | - | - | - | - | - |
|
650 |
+
| 0.2294 | 2000 | 6.2375 | - | - | - | - | - |
|
651 |
+
| 0.2524 | 2200 | 6.2587 | - | - | - | - | - |
|
652 |
+
| 0.2753 | 2400 | 6.0826 | - | - | - | - | - |
|
653 |
+
| 0.2983 | 2600 | 6.1514 | - | - | - | - | - |
|
654 |
+
| 0.3212 | 2800 | 5.6949 | - | - | - | - | - |
|
655 |
+
| 0.3442 | 3000 | 6.0062 | - | - | - | - | - |
|
656 |
+
| 0.3671 | 3200 | 5.7551 | - | - | - | - | - |
|
657 |
+
| 0.3900 | 3400 | 5.658 | - | - | - | - | - |
|
658 |
+
| 0.4130 | 3600 | 5.7135 | - | - | - | - | - |
|
659 |
+
| 0.4359 | 3800 | 5.3909 | - | - | - | - | - |
|
660 |
+
| 0.4589 | 4000 | 5.5068 | - | - | - | - | - |
|
661 |
+
| 0.4818 | 4200 | 5.2261 | - | - | - | - | - |
|
662 |
+
| 0.5048 | 4400 | 5.1674 | - | - | - | - | - |
|
663 |
+
| 0.5277 | 4600 | 5.0427 | - | - | - | - | - |
|
664 |
+
| 0.5506 | 4800 | 5.3824 | - | - | - | - | - |
|
665 |
+
| 0.5736 | 5000 | 5.3063 | - | - | - | - | - |
|
666 |
+
| 0.5965 | 5200 | 5.2174 | - | - | - | - | - |
|
667 |
+
| 0.6195 | 5400 | 5.2116 | - | - | - | - | - |
|
668 |
+
| 0.6424 | 5600 | 5.2226 | - | - | - | - | - |
|
669 |
+
| 0.6654 | 5800 | 5.2051 | - | - | - | - | - |
|
670 |
+
| 0.6883 | 6000 | 5.204 | - | - | - | - | - |
|
671 |
+
| 0.7113 | 6200 | 5.154 | - | - | - | - | - |
|
672 |
+
| 0.7342 | 6400 | 5.0236 | - | - | - | - | - |
|
673 |
+
| 0.7571 | 6600 | 4.9476 | - | - | - | - | - |
|
674 |
+
| 0.7801 | 6800 | 4.0164 | - | - | - | - | - |
|
675 |
+
| 0.8030 | 7000 | 3.5707 | - | - | - | - | - |
|
676 |
+
| 0.8260 | 7200 | 3.3586 | - | - | - | - | - |
|
677 |
+
| 0.8489 | 7400 | 3.2376 | - | - | - | - | - |
|
678 |
+
| 0.8719 | 7600 | 3.0282 | - | - | - | - | - |
|
679 |
+
| 0.8948 | 7800 | 2.901 | - | - | - | - | - |
|
680 |
+
| 0.9177 | 8000 | 2.9371 | - | - | - | - | - |
|
681 |
+
| 0.9407 | 8200 | 2.8362 | - | - | - | - | - |
|
682 |
+
| 0.9636 | 8400 | 2.8121 | - | - | - | - | - |
|
683 |
+
| 0.9866 | 8600 | 2.7105 | - | - | - | - | - |
|
684 |
+
| 1.0 | 8717 | - | 0.6523 | 0.6593 | 0.6648 | 0.6370 | 0.6117 |
|
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,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "UBC-NLP/MARBERTv2",
|
3 |
+
"architectures": [
|
4 |
+
"BertModel"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"classifier_dropout": null,
|
8 |
+
"directionality": "bidi",
|
9 |
+
"gradient_checkpointing": false,
|
10 |
+
"hidden_act": "gelu",
|
11 |
+
"hidden_dropout_prob": 0.1,
|
12 |
+
"hidden_size": 768,
|
13 |
+
"initializer_range": 0.02,
|
14 |
+
"intermediate_size": 3072,
|
15 |
+
"layer_norm_eps": 1e-12,
|
16 |
+
"max_position_embeddings": 512,
|
17 |
+
"model_type": "bert",
|
18 |
+
"num_attention_heads": 12,
|
19 |
+
"num_hidden_layers": 12,
|
20 |
+
"pad_token_id": 0,
|
21 |
+
"pooler_fc_size": 768,
|
22 |
+
"pooler_num_attention_heads": 12,
|
23 |
+
"pooler_num_fc_layers": 3,
|
24 |
+
"pooler_size_per_head": 128,
|
25 |
+
"pooler_type": "first_token_transform",
|
26 |
+
"position_embedding_type": "absolute",
|
27 |
+
"torch_dtype": "float32",
|
28 |
+
"transformers_version": "4.40.0",
|
29 |
+
"type_vocab_size": 2,
|
30 |
+
"use_cache": true,
|
31 |
+
"vocab_size": 100000
|
32 |
+
}
|
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:ac940b9ab9d5485266ba50d751eac2866fbd83a04405a3be723d22a441b8cfce
|
3 |
+
size 651387752
|
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,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": "[CLS]",
|
3 |
+
"mask_token": "[MASK]",
|
4 |
+
"pad_token": "[PAD]",
|
5 |
+
"sep_token": "[SEP]",
|
6 |
+
"unk_token": "[UNK]"
|
7 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
},
|
44 |
+
"clean_up_tokenization_spaces": true,
|
45 |
+
"cls_token": "[CLS]",
|
46 |
+
"do_basic_tokenize": true,
|
47 |
+
"do_lower_case": true,
|
48 |
+
"mask_token": "[MASK]",
|
49 |
+
"model_max_length": 1000000000000000019884624838656,
|
50 |
+
"never_split": null,
|
51 |
+
"pad_token": "[PAD]",
|
52 |
+
"sep_token": "[SEP]",
|
53 |
+
"strip_accents": null,
|
54 |
+
"tokenize_chinese_chars": true,
|
55 |
+
"tokenizer_class": "BertTokenizer",
|
56 |
+
"unk_token": "[UNK]"
|
57 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|