adriansanz commited on
Commit
cdab7fe
1 Parent(s): a685ed5

Add new SentenceTransformer model.

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 384,
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,804 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: cross-encoder/ms-marco-MiniLM-L-4-v2
3
+ datasets: []
4
+ language: []
5
+ library_name: sentence-transformers
6
+ metrics:
7
+ - cosine_accuracy@1
8
+ - cosine_accuracy@3
9
+ - cosine_accuracy@5
10
+ - cosine_accuracy@10
11
+ - cosine_precision@1
12
+ - cosine_precision@3
13
+ - cosine_precision@5
14
+ - cosine_precision@10
15
+ - cosine_recall@1
16
+ - cosine_recall@3
17
+ - cosine_recall@5
18
+ - cosine_recall@10
19
+ - cosine_ndcg@10
20
+ - cosine_mrr@10
21
+ - cosine_map@100
22
+ pipeline_tag: sentence-similarity
23
+ tags:
24
+ - sentence-transformers
25
+ - sentence-similarity
26
+ - feature-extraction
27
+ - generated_from_trainer
28
+ - dataset_size:4173
29
+ - loss:MatryoshkaLoss
30
+ - loss:MultipleNegativesRankingLoss
31
+ widget:
32
+ - source_sentence: 'Aquelles persones (físiques o jurídiques) que es disposin a exercir
33
+ una de les següents activitats: ... Han de comunicar-ho a l''Ajuntament prèviament
34
+ a la data prevista de la seva obertura.'
35
+ sentences:
36
+ - Quin és el benefici que es pretén obtenir amb aquests ajuts econòmics per a les
37
+ empreses d'hostaleria i restauració?
38
+ - Quin és el benefici del sistema de teleassistència per a les persones que viuen
39
+ amb altres persones amb discapacitat?
40
+ - Quin és el propòsit de la comunicació prèvia d'una activitat recreativa o un espectacle
41
+ públic?
42
+ - source_sentence: Les persones titulars d’activitats que generin residus comercials
43
+ o industrials assimilables als municipals, vindran obligats a acreditar davant
44
+ l’Ajuntament que tenen contractat un gestor autoritzat per la recollida, tractament
45
+ i eliminació dels residus que produeixi l’activitat corresponent.
46
+ sentences:
47
+ - Quin és el paper de l'Ajuntament en l'acreditació de recollida de residus?
48
+ - Quin és el benefici de les activitats d'animació socio-cultural?
49
+ - Quin és el benefici de l'ajut per a la creació de noves empreses?
50
+ - source_sentence: Modificació de sol·licitud de permís d'ocupació de la via pública
51
+ per filmacions, rodatges o sessions fotogràfiques.
52
+ sentences:
53
+ - Quin és el grau de discapacitat mínim per a rebre l'ajut de 300€ anuals?
54
+ - Quin és el requisit per a la constitució o modificació del règim de propietat
55
+ horitzontal?
56
+ - Quin és el tipus de permís que es modifica?
57
+ - source_sentence: El beneficiari és l'encarregat de complir les condicions de la
58
+ subvenció i de presentar els informes de seguiment del projecte.
59
+ sentences:
60
+ - Quin és el paper del beneficiari en el procés de subvencions?
61
+ - Quin és el càlcul dels interessos de demora en el fraccionament i l'ajornament?
62
+ - Quin és el període de temps en què es poden efectuar les despeses mèdiques per
63
+ a rebre l'ajuda?
64
+ - source_sentence: Aquest tràmit permet sol·licitar la llicència per a realitzar obres
65
+ d'excavació a la via pública per a la instal·lació o reparació d'infraestructures
66
+ de serveis i subministraments.
67
+ sentences:
68
+ - Quin és el paper de la via pública en aquest tràmit?
69
+ - Quin és el requisit principal per obtenir el certificat?
70
+ - Quin és l'objectiu de presentar una denúncia per presumpta infracció urbanística?
71
+ model-index:
72
+ - name: SentenceTransformer based on cross-encoder/ms-marco-MiniLM-L-4-v2
73
+ results:
74
+ - task:
75
+ type: information-retrieval
76
+ name: Information Retrieval
77
+ dataset:
78
+ name: dim 768
79
+ type: dim_768
80
+ metrics:
81
+ - type: cosine_accuracy@1
82
+ value: 0.03879310344827586
83
+ name: Cosine Accuracy@1
84
+ - type: cosine_accuracy@3
85
+ value: 0.08836206896551724
86
+ name: Cosine Accuracy@3
87
+ - type: cosine_accuracy@5
88
+ value: 0.12284482758620689
89
+ name: Cosine Accuracy@5
90
+ - type: cosine_accuracy@10
91
+ value: 0.1875
92
+ name: Cosine Accuracy@10
93
+ - type: cosine_precision@1
94
+ value: 0.03879310344827586
95
+ name: Cosine Precision@1
96
+ - type: cosine_precision@3
97
+ value: 0.029454022988505746
98
+ name: Cosine Precision@3
99
+ - type: cosine_precision@5
100
+ value: 0.024568965517241383
101
+ name: Cosine Precision@5
102
+ - type: cosine_precision@10
103
+ value: 0.01875
104
+ name: Cosine Precision@10
105
+ - type: cosine_recall@1
106
+ value: 0.03879310344827586
107
+ name: Cosine Recall@1
108
+ - type: cosine_recall@3
109
+ value: 0.08836206896551724
110
+ name: Cosine Recall@3
111
+ - type: cosine_recall@5
112
+ value: 0.12284482758620689
113
+ name: Cosine Recall@5
114
+ - type: cosine_recall@10
115
+ value: 0.1875
116
+ name: Cosine Recall@10
117
+ - type: cosine_ndcg@10
118
+ value: 0.10242929123982092
119
+ name: Cosine Ndcg@10
120
+ - type: cosine_mrr@10
121
+ value: 0.0765787493158183
122
+ name: Cosine Mrr@10
123
+ - type: cosine_map@100
124
+ value: 0.09057915519577017
125
+ name: Cosine Map@100
126
+ - task:
127
+ type: information-retrieval
128
+ name: Information Retrieval
129
+ dataset:
130
+ name: dim 512
131
+ type: dim_512
132
+ metrics:
133
+ - type: cosine_accuracy@1
134
+ value: 0.03879310344827586
135
+ name: Cosine Accuracy@1
136
+ - type: cosine_accuracy@3
137
+ value: 0.08836206896551724
138
+ name: Cosine Accuracy@3
139
+ - type: cosine_accuracy@5
140
+ value: 0.12284482758620689
141
+ name: Cosine Accuracy@5
142
+ - type: cosine_accuracy@10
143
+ value: 0.1875
144
+ name: Cosine Accuracy@10
145
+ - type: cosine_precision@1
146
+ value: 0.03879310344827586
147
+ name: Cosine Precision@1
148
+ - type: cosine_precision@3
149
+ value: 0.029454022988505746
150
+ name: Cosine Precision@3
151
+ - type: cosine_precision@5
152
+ value: 0.024568965517241383
153
+ name: Cosine Precision@5
154
+ - type: cosine_precision@10
155
+ value: 0.01875
156
+ name: Cosine Precision@10
157
+ - type: cosine_recall@1
158
+ value: 0.03879310344827586
159
+ name: Cosine Recall@1
160
+ - type: cosine_recall@3
161
+ value: 0.08836206896551724
162
+ name: Cosine Recall@3
163
+ - type: cosine_recall@5
164
+ value: 0.12284482758620689
165
+ name: Cosine Recall@5
166
+ - type: cosine_recall@10
167
+ value: 0.1875
168
+ name: Cosine Recall@10
169
+ - type: cosine_ndcg@10
170
+ value: 0.10242929123982092
171
+ name: Cosine Ndcg@10
172
+ - type: cosine_mrr@10
173
+ value: 0.0765787493158183
174
+ name: Cosine Mrr@10
175
+ - type: cosine_map@100
176
+ value: 0.09057915519577017
177
+ name: Cosine Map@100
178
+ - task:
179
+ type: information-retrieval
180
+ name: Information Retrieval
181
+ dataset:
182
+ name: dim 256
183
+ type: dim_256
184
+ metrics:
185
+ - type: cosine_accuracy@1
186
+ value: 0.03879310344827586
187
+ name: Cosine Accuracy@1
188
+ - type: cosine_accuracy@3
189
+ value: 0.08405172413793104
190
+ name: Cosine Accuracy@3
191
+ - type: cosine_accuracy@5
192
+ value: 0.12931034482758622
193
+ name: Cosine Accuracy@5
194
+ - type: cosine_accuracy@10
195
+ value: 0.1853448275862069
196
+ name: Cosine Accuracy@10
197
+ - type: cosine_precision@1
198
+ value: 0.03879310344827586
199
+ name: Cosine Precision@1
200
+ - type: cosine_precision@3
201
+ value: 0.028017241379310345
202
+ name: Cosine Precision@3
203
+ - type: cosine_precision@5
204
+ value: 0.02586206896551724
205
+ name: Cosine Precision@5
206
+ - type: cosine_precision@10
207
+ value: 0.01853448275862069
208
+ name: Cosine Precision@10
209
+ - type: cosine_recall@1
210
+ value: 0.03879310344827586
211
+ name: Cosine Recall@1
212
+ - type: cosine_recall@3
213
+ value: 0.08405172413793104
214
+ name: Cosine Recall@3
215
+ - type: cosine_recall@5
216
+ value: 0.12931034482758622
217
+ name: Cosine Recall@5
218
+ - type: cosine_recall@10
219
+ value: 0.1853448275862069
220
+ name: Cosine Recall@10
221
+ - type: cosine_ndcg@10
222
+ value: 0.10210354316803219
223
+ name: Cosine Ndcg@10
224
+ - type: cosine_mrr@10
225
+ value: 0.07668821839080461
226
+ name: Cosine Mrr@10
227
+ - type: cosine_map@100
228
+ value: 0.08986051867751395
229
+ name: Cosine Map@100
230
+ - task:
231
+ type: information-retrieval
232
+ name: Information Retrieval
233
+ dataset:
234
+ name: dim 128
235
+ type: dim_128
236
+ metrics:
237
+ - type: cosine_accuracy@1
238
+ value: 0.034482758620689655
239
+ name: Cosine Accuracy@1
240
+ - type: cosine_accuracy@3
241
+ value: 0.09482758620689655
242
+ name: Cosine Accuracy@3
243
+ - type: cosine_accuracy@5
244
+ value: 0.1271551724137931
245
+ name: Cosine Accuracy@5
246
+ - type: cosine_accuracy@10
247
+ value: 0.1853448275862069
248
+ name: Cosine Accuracy@10
249
+ - type: cosine_precision@1
250
+ value: 0.034482758620689655
251
+ name: Cosine Precision@1
252
+ - type: cosine_precision@3
253
+ value: 0.03160919540229885
254
+ name: Cosine Precision@3
255
+ - type: cosine_precision@5
256
+ value: 0.025431034482758623
257
+ name: Cosine Precision@5
258
+ - type: cosine_precision@10
259
+ value: 0.018534482758620692
260
+ name: Cosine Precision@10
261
+ - type: cosine_recall@1
262
+ value: 0.034482758620689655
263
+ name: Cosine Recall@1
264
+ - type: cosine_recall@3
265
+ value: 0.09482758620689655
266
+ name: Cosine Recall@3
267
+ - type: cosine_recall@5
268
+ value: 0.1271551724137931
269
+ name: Cosine Recall@5
270
+ - type: cosine_recall@10
271
+ value: 0.1853448275862069
272
+ name: Cosine Recall@10
273
+ - type: cosine_ndcg@10
274
+ value: 0.10100148719550092
275
+ name: Cosine Ndcg@10
276
+ - type: cosine_mrr@10
277
+ value: 0.07532755199781063
278
+ name: Cosine Mrr@10
279
+ - type: cosine_map@100
280
+ value: 0.08992740582596234
281
+ name: Cosine Map@100
282
+ - task:
283
+ type: information-retrieval
284
+ name: Information Retrieval
285
+ dataset:
286
+ name: dim 64
287
+ type: dim_64
288
+ metrics:
289
+ - type: cosine_accuracy@1
290
+ value: 0.034482758620689655
291
+ name: Cosine Accuracy@1
292
+ - type: cosine_accuracy@3
293
+ value: 0.08405172413793104
294
+ name: Cosine Accuracy@3
295
+ - type: cosine_accuracy@5
296
+ value: 0.10344827586206896
297
+ name: Cosine Accuracy@5
298
+ - type: cosine_accuracy@10
299
+ value: 0.17025862068965517
300
+ name: Cosine Accuracy@10
301
+ - type: cosine_precision@1
302
+ value: 0.034482758620689655
303
+ name: Cosine Precision@1
304
+ - type: cosine_precision@3
305
+ value: 0.028017241379310345
306
+ name: Cosine Precision@3
307
+ - type: cosine_precision@5
308
+ value: 0.020689655172413796
309
+ name: Cosine Precision@5
310
+ - type: cosine_precision@10
311
+ value: 0.017025862068965517
312
+ name: Cosine Precision@10
313
+ - type: cosine_recall@1
314
+ value: 0.034482758620689655
315
+ name: Cosine Recall@1
316
+ - type: cosine_recall@3
317
+ value: 0.08405172413793104
318
+ name: Cosine Recall@3
319
+ - type: cosine_recall@5
320
+ value: 0.10344827586206896
321
+ name: Cosine Recall@5
322
+ - type: cosine_recall@10
323
+ value: 0.17025862068965517
324
+ name: Cosine Recall@10
325
+ - type: cosine_ndcg@10
326
+ value: 0.09332320019708457
327
+ name: Cosine Ndcg@10
328
+ - type: cosine_mrr@10
329
+ value: 0.0700302750410509
330
+ name: Cosine Mrr@10
331
+ - type: cosine_map@100
332
+ value: 0.08369264546406543
333
+ name: Cosine Map@100
334
+ ---
335
+
336
+ # SentenceTransformer based on cross-encoder/ms-marco-MiniLM-L-4-v2
337
+
338
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [cross-encoder/ms-marco-MiniLM-L-4-v2](https://huggingface.co/cross-encoder/ms-marco-MiniLM-L-4-v2). It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
339
+
340
+ ## Model Details
341
+
342
+ ### Model Description
343
+ - **Model Type:** Sentence Transformer
344
+ - **Base model:** [cross-encoder/ms-marco-MiniLM-L-4-v2](https://huggingface.co/cross-encoder/ms-marco-MiniLM-L-4-v2) <!-- at revision 1f1ab0943a42a52afd702e7e8337bec985c189ea -->
345
+ - **Maximum Sequence Length:** 512 tokens
346
+ - **Output Dimensionality:** 384 tokens
347
+ - **Similarity Function:** Cosine Similarity
348
+ <!-- - **Training Dataset:** Unknown -->
349
+ <!-- - **Language:** Unknown -->
350
+ <!-- - **License:** Unknown -->
351
+
352
+ ### Model Sources
353
+
354
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
355
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
356
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
357
+
358
+ ### Full Model Architecture
359
+
360
+ ```
361
+ SentenceTransformer(
362
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
363
+ (1): Pooling({'word_embedding_dimension': 384, '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})
364
+ )
365
+ ```
366
+
367
+ ## Usage
368
+
369
+ ### Direct Usage (Sentence Transformers)
370
+
371
+ First install the Sentence Transformers library:
372
+
373
+ ```bash
374
+ pip install -U sentence-transformers
375
+ ```
376
+
377
+ Then you can load this model and run inference.
378
+ ```python
379
+ from sentence_transformers import SentenceTransformer
380
+
381
+ # Download from the 🤗 Hub
382
+ model = SentenceTransformer("adriansanz/sitges10242608-4ep-rerankv2")
383
+ # Run inference
384
+ sentences = [
385
+ "Aquest tràmit permet sol·licitar la llicència per a realitzar obres d'excavació a la via pública per a la instal·lació o reparació d'infraestructures de serveis i subministraments.",
386
+ 'Quin és el paper de la via pública en aquest tràmit?',
387
+ "Quin és l'objectiu de presentar una denúncia per presumpta infracció urbanística?",
388
+ ]
389
+ embeddings = model.encode(sentences)
390
+ print(embeddings.shape)
391
+ # [3, 384]
392
+
393
+ # Get the similarity scores for the embeddings
394
+ similarities = model.similarity(embeddings, embeddings)
395
+ print(similarities.shape)
396
+ # [3, 3]
397
+ ```
398
+
399
+ <!--
400
+ ### Direct Usage (Transformers)
401
+
402
+ <details><summary>Click to see the direct usage in Transformers</summary>
403
+
404
+ </details>
405
+ -->
406
+
407
+ <!--
408
+ ### Downstream Usage (Sentence Transformers)
409
+
410
+ You can finetune this model on your own dataset.
411
+
412
+ <details><summary>Click to expand</summary>
413
+
414
+ </details>
415
+ -->
416
+
417
+ <!--
418
+ ### Out-of-Scope Use
419
+
420
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
421
+ -->
422
+
423
+ ## Evaluation
424
+
425
+ ### Metrics
426
+
427
+ #### Information Retrieval
428
+ * Dataset: `dim_768`
429
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
430
+
431
+ | Metric | Value |
432
+ |:--------------------|:-----------|
433
+ | cosine_accuracy@1 | 0.0388 |
434
+ | cosine_accuracy@3 | 0.0884 |
435
+ | cosine_accuracy@5 | 0.1228 |
436
+ | cosine_accuracy@10 | 0.1875 |
437
+ | cosine_precision@1 | 0.0388 |
438
+ | cosine_precision@3 | 0.0295 |
439
+ | cosine_precision@5 | 0.0246 |
440
+ | cosine_precision@10 | 0.0187 |
441
+ | cosine_recall@1 | 0.0388 |
442
+ | cosine_recall@3 | 0.0884 |
443
+ | cosine_recall@5 | 0.1228 |
444
+ | cosine_recall@10 | 0.1875 |
445
+ | cosine_ndcg@10 | 0.1024 |
446
+ | cosine_mrr@10 | 0.0766 |
447
+ | **cosine_map@100** | **0.0906** |
448
+
449
+ #### Information Retrieval
450
+ * Dataset: `dim_512`
451
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
452
+
453
+ | Metric | Value |
454
+ |:--------------------|:-----------|
455
+ | cosine_accuracy@1 | 0.0388 |
456
+ | cosine_accuracy@3 | 0.0884 |
457
+ | cosine_accuracy@5 | 0.1228 |
458
+ | cosine_accuracy@10 | 0.1875 |
459
+ | cosine_precision@1 | 0.0388 |
460
+ | cosine_precision@3 | 0.0295 |
461
+ | cosine_precision@5 | 0.0246 |
462
+ | cosine_precision@10 | 0.0187 |
463
+ | cosine_recall@1 | 0.0388 |
464
+ | cosine_recall@3 | 0.0884 |
465
+ | cosine_recall@5 | 0.1228 |
466
+ | cosine_recall@10 | 0.1875 |
467
+ | cosine_ndcg@10 | 0.1024 |
468
+ | cosine_mrr@10 | 0.0766 |
469
+ | **cosine_map@100** | **0.0906** |
470
+
471
+ #### Information Retrieval
472
+ * Dataset: `dim_256`
473
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
474
+
475
+ | Metric | Value |
476
+ |:--------------------|:-----------|
477
+ | cosine_accuracy@1 | 0.0388 |
478
+ | cosine_accuracy@3 | 0.0841 |
479
+ | cosine_accuracy@5 | 0.1293 |
480
+ | cosine_accuracy@10 | 0.1853 |
481
+ | cosine_precision@1 | 0.0388 |
482
+ | cosine_precision@3 | 0.028 |
483
+ | cosine_precision@5 | 0.0259 |
484
+ | cosine_precision@10 | 0.0185 |
485
+ | cosine_recall@1 | 0.0388 |
486
+ | cosine_recall@3 | 0.0841 |
487
+ | cosine_recall@5 | 0.1293 |
488
+ | cosine_recall@10 | 0.1853 |
489
+ | cosine_ndcg@10 | 0.1021 |
490
+ | cosine_mrr@10 | 0.0767 |
491
+ | **cosine_map@100** | **0.0899** |
492
+
493
+ #### Information Retrieval
494
+ * Dataset: `dim_128`
495
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
496
+
497
+ | Metric | Value |
498
+ |:--------------------|:-----------|
499
+ | cosine_accuracy@1 | 0.0345 |
500
+ | cosine_accuracy@3 | 0.0948 |
501
+ | cosine_accuracy@5 | 0.1272 |
502
+ | cosine_accuracy@10 | 0.1853 |
503
+ | cosine_precision@1 | 0.0345 |
504
+ | cosine_precision@3 | 0.0316 |
505
+ | cosine_precision@5 | 0.0254 |
506
+ | cosine_precision@10 | 0.0185 |
507
+ | cosine_recall@1 | 0.0345 |
508
+ | cosine_recall@3 | 0.0948 |
509
+ | cosine_recall@5 | 0.1272 |
510
+ | cosine_recall@10 | 0.1853 |
511
+ | cosine_ndcg@10 | 0.101 |
512
+ | cosine_mrr@10 | 0.0753 |
513
+ | **cosine_map@100** | **0.0899** |
514
+
515
+ #### Information Retrieval
516
+ * Dataset: `dim_64`
517
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
518
+
519
+ | Metric | Value |
520
+ |:--------------------|:-----------|
521
+ | cosine_accuracy@1 | 0.0345 |
522
+ | cosine_accuracy@3 | 0.0841 |
523
+ | cosine_accuracy@5 | 0.1034 |
524
+ | cosine_accuracy@10 | 0.1703 |
525
+ | cosine_precision@1 | 0.0345 |
526
+ | cosine_precision@3 | 0.028 |
527
+ | cosine_precision@5 | 0.0207 |
528
+ | cosine_precision@10 | 0.017 |
529
+ | cosine_recall@1 | 0.0345 |
530
+ | cosine_recall@3 | 0.0841 |
531
+ | cosine_recall@5 | 0.1034 |
532
+ | cosine_recall@10 | 0.1703 |
533
+ | cosine_ndcg@10 | 0.0933 |
534
+ | cosine_mrr@10 | 0.07 |
535
+ | **cosine_map@100** | **0.0837** |
536
+
537
+ <!--
538
+ ## Bias, Risks and Limitations
539
+
540
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
541
+ -->
542
+
543
+ <!--
544
+ ### Recommendations
545
+
546
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
547
+ -->
548
+
549
+ ## Training Details
550
+
551
+ ### Training Dataset
552
+
553
+ #### Unnamed Dataset
554
+
555
+
556
+ * Size: 4,173 training samples
557
+ * Columns: <code>positive</code> and <code>anchor</code>
558
+ * Approximate statistics based on the first 1000 samples:
559
+ | | positive | anchor |
560
+ |:--------|:------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
561
+ | type | string | string |
562
+ | details | <ul><li>min: 10 tokens</li><li>mean: 67.49 tokens</li><li>max: 214 tokens</li></ul> | <ul><li>min: 11 tokens</li><li>mean: 28.0 tokens</li><li>max: 61 tokens</li></ul> |
563
+ * Samples:
564
+ | positive | anchor |
565
+ |:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------|
566
+ | <code>Havent-se d'acreditar la matriculació i inscripció en el respectiu centre públic o concertat, així com el cost de les llars d'infants, de l'educació especialitzada per les discapacitats físiques, psíquiques i sensorials en centres públics, concertats o privats.</code> | <code>Quin és el requisit per acreditar la llar d'infants?</code> |
567
+ | <code>El volant històric de convivència és el document que informa de la residencia en el municipi de Sitges, així com altres fets relatius a l'empadronament d'una persona, i detalla tots els domicilis, la data inicial i final en els que ha estat empadronada en cadascun d'ells, i les persones amb les què constava inscrites, segons les dades que consten al Padró Municipal d'Habitants fins a la data d'expedició.</code> | <code>Quin és el propòsit del volant històric de convivència?</code> |
568
+ | <code>Instal·lació de tanques sense obra.</code> | <code>Quins són els exemples d'instal·lacions que es poden comunicar amb aquest tràmit?</code> |
569
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
570
+ ```json
571
+ {
572
+ "loss": "MultipleNegativesRankingLoss",
573
+ "matryoshka_dims": [
574
+ 384,
575
+ 256,
576
+ 128,
577
+ 64
578
+ ],
579
+ "matryoshka_weights": [
580
+ 1,
581
+ 1,
582
+ 1,
583
+ 1
584
+ ],
585
+ "n_dims_per_step": -1
586
+ }
587
+ ```
588
+
589
+ ### Training Hyperparameters
590
+ #### Non-Default Hyperparameters
591
+
592
+ - `eval_strategy`: epoch
593
+ - `per_device_train_batch_size`: 16
594
+ - `per_device_eval_batch_size`: 16
595
+ - `gradient_accumulation_steps`: 16
596
+ - `num_train_epochs`: 5
597
+ - `lr_scheduler_type`: cosine
598
+ - `warmup_ratio`: 0.2
599
+ - `bf16`: True
600
+ - `tf32`: False
601
+ - `load_best_model_at_end`: True
602
+ - `optim`: adamw_torch_fused
603
+ - `batch_sampler`: no_duplicates
604
+
605
+ #### All Hyperparameters
606
+ <details><summary>Click to expand</summary>
607
+
608
+ - `overwrite_output_dir`: False
609
+ - `do_predict`: False
610
+ - `eval_strategy`: epoch
611
+ - `prediction_loss_only`: True
612
+ - `per_device_train_batch_size`: 16
613
+ - `per_device_eval_batch_size`: 16
614
+ - `per_gpu_train_batch_size`: None
615
+ - `per_gpu_eval_batch_size`: None
616
+ - `gradient_accumulation_steps`: 16
617
+ - `eval_accumulation_steps`: None
618
+ - `learning_rate`: 5e-05
619
+ - `weight_decay`: 0.0
620
+ - `adam_beta1`: 0.9
621
+ - `adam_beta2`: 0.999
622
+ - `adam_epsilon`: 1e-08
623
+ - `max_grad_norm`: 1.0
624
+ - `num_train_epochs`: 5
625
+ - `max_steps`: -1
626
+ - `lr_scheduler_type`: cosine
627
+ - `lr_scheduler_kwargs`: {}
628
+ - `warmup_ratio`: 0.2
629
+ - `warmup_steps`: 0
630
+ - `log_level`: passive
631
+ - `log_level_replica`: warning
632
+ - `log_on_each_node`: True
633
+ - `logging_nan_inf_filter`: True
634
+ - `save_safetensors`: True
635
+ - `save_on_each_node`: False
636
+ - `save_only_model`: False
637
+ - `restore_callback_states_from_checkpoint`: False
638
+ - `no_cuda`: False
639
+ - `use_cpu`: False
640
+ - `use_mps_device`: False
641
+ - `seed`: 42
642
+ - `data_seed`: None
643
+ - `jit_mode_eval`: False
644
+ - `use_ipex`: False
645
+ - `bf16`: True
646
+ - `fp16`: False
647
+ - `fp16_opt_level`: O1
648
+ - `half_precision_backend`: auto
649
+ - `bf16_full_eval`: False
650
+ - `fp16_full_eval`: False
651
+ - `tf32`: False
652
+ - `local_rank`: 0
653
+ - `ddp_backend`: None
654
+ - `tpu_num_cores`: None
655
+ - `tpu_metrics_debug`: False
656
+ - `debug`: []
657
+ - `dataloader_drop_last`: False
658
+ - `dataloader_num_workers`: 0
659
+ - `dataloader_prefetch_factor`: None
660
+ - `past_index`: -1
661
+ - `disable_tqdm`: False
662
+ - `remove_unused_columns`: True
663
+ - `label_names`: None
664
+ - `load_best_model_at_end`: True
665
+ - `ignore_data_skip`: False
666
+ - `fsdp`: []
667
+ - `fsdp_min_num_params`: 0
668
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
669
+ - `fsdp_transformer_layer_cls_to_wrap`: None
670
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
671
+ - `deepspeed`: None
672
+ - `label_smoothing_factor`: 0.0
673
+ - `optim`: adamw_torch_fused
674
+ - `optim_args`: None
675
+ - `adafactor`: False
676
+ - `group_by_length`: False
677
+ - `length_column_name`: length
678
+ - `ddp_find_unused_parameters`: None
679
+ - `ddp_bucket_cap_mb`: None
680
+ - `ddp_broadcast_buffers`: False
681
+ - `dataloader_pin_memory`: True
682
+ - `dataloader_persistent_workers`: False
683
+ - `skip_memory_metrics`: True
684
+ - `use_legacy_prediction_loop`: False
685
+ - `push_to_hub`: False
686
+ - `resume_from_checkpoint`: None
687
+ - `hub_model_id`: None
688
+ - `hub_strategy`: every_save
689
+ - `hub_private_repo`: False
690
+ - `hub_always_push`: False
691
+ - `gradient_checkpointing`: False
692
+ - `gradient_checkpointing_kwargs`: None
693
+ - `include_inputs_for_metrics`: False
694
+ - `eval_do_concat_batches`: True
695
+ - `fp16_backend`: auto
696
+ - `push_to_hub_model_id`: None
697
+ - `push_to_hub_organization`: None
698
+ - `mp_parameters`:
699
+ - `auto_find_batch_size`: False
700
+ - `full_determinism`: False
701
+ - `torchdynamo`: None
702
+ - `ray_scope`: last
703
+ - `ddp_timeout`: 1800
704
+ - `torch_compile`: False
705
+ - `torch_compile_backend`: None
706
+ - `torch_compile_mode`: None
707
+ - `dispatch_batches`: None
708
+ - `split_batches`: None
709
+ - `include_tokens_per_second`: False
710
+ - `include_num_input_tokens_seen`: False
711
+ - `neftune_noise_alpha`: None
712
+ - `optim_target_modules`: None
713
+ - `batch_eval_metrics`: False
714
+ - `eval_on_start`: False
715
+ - `batch_sampler`: no_duplicates
716
+ - `multi_dataset_batch_sampler`: proportional
717
+
718
+ </details>
719
+
720
+ ### Training Logs
721
+ | Epoch | Step | Training Loss | dim_128_cosine_map@100 | dim_256_cosine_map@100 | dim_512_cosine_map@100 | dim_64_cosine_map@100 | dim_768_cosine_map@100 |
722
+ |:----------:|:------:|:-------------:|:----------------------:|:----------------------:|:----------------------:|:---------------------:|:----------------------:|
723
+ | 0.6130 | 10 | 11.3695 | - | - | - | - | - |
724
+ | 0.9808 | 16 | - | 0.0214 | 0.0243 | 0.0234 | 0.0199 | 0.0234 |
725
+ | 1.2261 | 20 | 10.653 | - | - | - | - | - |
726
+ | 1.8391 | 30 | 9.0745 | - | - | - | - | - |
727
+ | 1.9617 | 32 | - | 0.0495 | 0.0517 | 0.0589 | 0.0481 | 0.0589 |
728
+ | 2.4521 | 40 | 7.3468 | - | - | - | - | - |
729
+ | 2.9425 | 48 | - | 0.0764 | 0.0734 | 0.0811 | 0.0709 | 0.0811 |
730
+ | 3.0651 | 50 | 5.887 | - | - | - | - | - |
731
+ | 3.6782 | 60 | 5.3568 | - | - | - | - | - |
732
+ | **3.9847** | **65** | **-** | **0.0922** | **0.0857** | **0.0896** | **0.0808** | **0.0896** |
733
+ | 4.2912 | 70 | 4.8338 | - | - | - | - | - |
734
+ | 4.9042 | 80 | 4.9251 | 0.0899 | 0.0899 | 0.0906 | 0.0837 | 0.0906 |
735
+
736
+ * The bold row denotes the saved checkpoint.
737
+
738
+ ### Framework Versions
739
+ - Python: 3.10.12
740
+ - Sentence Transformers: 3.0.1
741
+ - Transformers: 4.42.4
742
+ - PyTorch: 2.4.0+cu121
743
+ - Accelerate: 0.34.0.dev0
744
+ - Datasets: 2.21.0
745
+ - Tokenizers: 0.19.1
746
+
747
+ ## Citation
748
+
749
+ ### BibTeX
750
+
751
+ #### Sentence Transformers
752
+ ```bibtex
753
+ @inproceedings{reimers-2019-sentence-bert,
754
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
755
+ author = "Reimers, Nils and Gurevych, Iryna",
756
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
757
+ month = "11",
758
+ year = "2019",
759
+ publisher = "Association for Computational Linguistics",
760
+ url = "https://arxiv.org/abs/1908.10084",
761
+ }
762
+ ```
763
+
764
+ #### MatryoshkaLoss
765
+ ```bibtex
766
+ @misc{kusupati2024matryoshka,
767
+ title={Matryoshka Representation Learning},
768
+ 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},
769
+ year={2024},
770
+ eprint={2205.13147},
771
+ archivePrefix={arXiv},
772
+ primaryClass={cs.LG}
773
+ }
774
+ ```
775
+
776
+ #### MultipleNegativesRankingLoss
777
+ ```bibtex
778
+ @misc{henderson2017efficient,
779
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
780
+ 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},
781
+ year={2017},
782
+ eprint={1705.00652},
783
+ archivePrefix={arXiv},
784
+ primaryClass={cs.CL}
785
+ }
786
+ ```
787
+
788
+ <!--
789
+ ## Glossary
790
+
791
+ *Clearly define terms in order to be accessible across audiences.*
792
+ -->
793
+
794
+ <!--
795
+ ## Model Card Authors
796
+
797
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
798
+ -->
799
+
800
+ <!--
801
+ ## Model Card Contact
802
+
803
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
804
+ -->
config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "cross-encoder/ms-marco-MiniLM-L-4-v2",
3
+ "architectures": [
4
+ "BertModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 384,
12
+ "id2label": {
13
+ "0": "LABEL_0"
14
+ },
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 1536,
17
+ "label2id": {
18
+ "LABEL_0": 0
19
+ },
20
+ "layer_norm_eps": 1e-12,
21
+ "max_position_embeddings": 512,
22
+ "model_type": "bert",
23
+ "num_attention_heads": 12,
24
+ "num_hidden_layers": 4,
25
+ "pad_token_id": 0,
26
+ "position_embedding_type": "absolute",
27
+ "sbert_ce_default_activation_function": "torch.nn.modules.linear.Identity",
28
+ "torch_dtype": "float32",
29
+ "transformers_version": "4.42.4",
30
+ "type_vocab_size": 2,
31
+ "use_cache": true,
32
+ "vocab_size": 30522
33
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "3.0.1",
4
+ "transformers": "4.42.4",
5
+ "pytorch": "2.4.0+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:d30aab76b357ff01a79fba4607a7d3bc10254f0ba956041395d73af198e479b8
3
+ size 76664936
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
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
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": 512,
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