adriansanz commited on
Commit
6db5f01
1 Parent(s): f35ee26

Add new SentenceTransformer model.

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 768,
3
+ "pooling_mode_cls_token": false,
4
+ "pooling_mode_mean_tokens": true,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,805 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: PlanTL-GOB-ES/roberta-base-bne
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: L'Ajuntament de Sitges ofereix a aquelles famílies que acompleixin
33
+ els requisits establerts, ajuts per al pagament de la quota del servei i de la
34
+ quota del menjador dels infants matriculats a les Llars d'Infants Municipals (
35
+ 0-3 anys).
36
+ sentences:
37
+ - Quin és l'objectiu principal de les subvencions per a projectes i activitats de
38
+ l'àmbit turístic?
39
+ - Quin és el procediment per a obtenir una llicència per a disposar d'una parada
40
+ en un mercat setmanal?
41
+ - Quin és el paper de l'Ajuntament de Sitges en la quota del menjador de les Llars
42
+ d'Infants Municipals?
43
+ - source_sentence: Es tracta de la sol·licitud de permís municipal per poder utilitzar
44
+ de forma privativa una zona de la via pública per instal·lacions d’atraccions
45
+ i venda en fires, amb independència de les possibles afectacions a la via pública...
46
+ sentences:
47
+ - Quin és el tipus de permís que es sol·licita?
48
+ - Quin és el paper de l'Ajuntament en aquest tràmit?
49
+ - Quin és el resultat de la llicència per a la constitució d'un règim de propietat
50
+ horitzontal en relació amb l’escriptura de divisió horitzontal?
51
+ - source_sentence: Totes les persones que resideixen a Espanya estan obligades a inscriure's
52
+ en el padró del municipi en el qual resideixen habitualment.
53
+ sentences:
54
+ - Quin és el benefici de l'ajut extraordinari per a la família de l'empleat?
55
+ - Què passa si no es presenta la sol·licitud d'acceptació en el termini establert?
56
+ - Qui està obligat a inscriure's en el Padró Municipal d'Habitants?
57
+ - source_sentence: Les persones i entitats beneficiaries hauran de justificar la realització
58
+ del projecte/activitat subvencionada com a màxim el dia 31 de març de 2023.
59
+ sentences:
60
+ - Quin és el termini per presentar la justificació de la realització del projecte/activitat
61
+ subvencionada?
62
+ - Quin és el període durant el qual es poden sol·licitar els ajuts?
63
+ - Quin és el registre on s'inscriuen les entitats d’interès ciutadà de Sitges?
64
+ - source_sentence: Els establiments locals tenen un paper clau en el projecte de la
65
+ targeta de fidelització, ja que són els que ofereixen descomptes i ofertes especials
66
+ als consumidors que utilitzen la targeta.
67
+ sentences:
68
+ - Quin és el paper dels establiments locals en el projecte de la targeta de fidelització?
69
+ - Quin és el paper de la via pública en aquest tràmit?
70
+ - Quins són els tractaments que beneficien la salut de l'empleat municipal que s'inclouen
71
+ en l'ajuda?
72
+ model-index:
73
+ - name: SentenceTransformer based on PlanTL-GOB-ES/roberta-base-bne
74
+ results:
75
+ - task:
76
+ type: information-retrieval
77
+ name: Information Retrieval
78
+ dataset:
79
+ name: dim 768
80
+ type: dim_768
81
+ metrics:
82
+ - type: cosine_accuracy@1
83
+ value: 0.05172413793103448
84
+ name: Cosine Accuracy@1
85
+ - type: cosine_accuracy@3
86
+ value: 0.125
87
+ name: Cosine Accuracy@3
88
+ - type: cosine_accuracy@5
89
+ value: 0.1875
90
+ name: Cosine Accuracy@5
91
+ - type: cosine_accuracy@10
92
+ value: 0.3857758620689655
93
+ name: Cosine Accuracy@10
94
+ - type: cosine_precision@1
95
+ value: 0.05172413793103448
96
+ name: Cosine Precision@1
97
+ - type: cosine_precision@3
98
+ value: 0.041666666666666664
99
+ name: Cosine Precision@3
100
+ - type: cosine_precision@5
101
+ value: 0.037500000000000006
102
+ name: Cosine Precision@5
103
+ - type: cosine_precision@10
104
+ value: 0.038577586206896546
105
+ name: Cosine Precision@10
106
+ - type: cosine_recall@1
107
+ value: 0.05172413793103448
108
+ name: Cosine Recall@1
109
+ - type: cosine_recall@3
110
+ value: 0.125
111
+ name: Cosine Recall@3
112
+ - type: cosine_recall@5
113
+ value: 0.1875
114
+ name: Cosine Recall@5
115
+ - type: cosine_recall@10
116
+ value: 0.3857758620689655
117
+ name: Cosine Recall@10
118
+ - type: cosine_ndcg@10
119
+ value: 0.18210165785971896
120
+ name: Cosine Ndcg@10
121
+ - type: cosine_mrr@10
122
+ value: 0.12195368089764656
123
+ name: Cosine Mrr@10
124
+ - type: cosine_map@100
125
+ value: 0.14624173028144724
126
+ name: Cosine Map@100
127
+ - task:
128
+ type: information-retrieval
129
+ name: Information Retrieval
130
+ dataset:
131
+ name: dim 512
132
+ type: dim_512
133
+ metrics:
134
+ - type: cosine_accuracy@1
135
+ value: 0.04525862068965517
136
+ name: Cosine Accuracy@1
137
+ - type: cosine_accuracy@3
138
+ value: 0.11422413793103449
139
+ name: Cosine Accuracy@3
140
+ - type: cosine_accuracy@5
141
+ value: 0.1810344827586207
142
+ name: Cosine Accuracy@5
143
+ - type: cosine_accuracy@10
144
+ value: 0.38146551724137934
145
+ name: Cosine Accuracy@10
146
+ - type: cosine_precision@1
147
+ value: 0.04525862068965517
148
+ name: Cosine Precision@1
149
+ - type: cosine_precision@3
150
+ value: 0.038074712643678156
151
+ name: Cosine Precision@3
152
+ - type: cosine_precision@5
153
+ value: 0.03620689655172414
154
+ name: Cosine Precision@5
155
+ - type: cosine_precision@10
156
+ value: 0.03814655172413794
157
+ name: Cosine Precision@10
158
+ - type: cosine_recall@1
159
+ value: 0.04525862068965517
160
+ name: Cosine Recall@1
161
+ - type: cosine_recall@3
162
+ value: 0.11422413793103449
163
+ name: Cosine Recall@3
164
+ - type: cosine_recall@5
165
+ value: 0.1810344827586207
166
+ name: Cosine Recall@5
167
+ - type: cosine_recall@10
168
+ value: 0.38146551724137934
169
+ name: Cosine Recall@10
170
+ - type: cosine_ndcg@10
171
+ value: 0.17527880528414544
172
+ name: Cosine Ndcg@10
173
+ - type: cosine_mrr@10
174
+ value: 0.1144422208538589
175
+ name: Cosine Mrr@10
176
+ - type: cosine_map@100
177
+ value: 0.1390144478189839
178
+ name: Cosine Map@100
179
+ - task:
180
+ type: information-retrieval
181
+ name: Information Retrieval
182
+ dataset:
183
+ name: dim 256
184
+ type: dim_256
185
+ metrics:
186
+ - type: cosine_accuracy@1
187
+ value: 0.04741379310344827
188
+ name: Cosine Accuracy@1
189
+ - type: cosine_accuracy@3
190
+ value: 0.12284482758620689
191
+ name: Cosine Accuracy@3
192
+ - type: cosine_accuracy@5
193
+ value: 0.20043103448275862
194
+ name: Cosine Accuracy@5
195
+ - type: cosine_accuracy@10
196
+ value: 0.39870689655172414
197
+ name: Cosine Accuracy@10
198
+ - type: cosine_precision@1
199
+ value: 0.04741379310344827
200
+ name: Cosine Precision@1
201
+ - type: cosine_precision@3
202
+ value: 0.040948275862068964
203
+ name: Cosine Precision@3
204
+ - type: cosine_precision@5
205
+ value: 0.04008620689655173
206
+ name: Cosine Precision@5
207
+ - type: cosine_precision@10
208
+ value: 0.03987068965517242
209
+ name: Cosine Precision@10
210
+ - type: cosine_recall@1
211
+ value: 0.04741379310344827
212
+ name: Cosine Recall@1
213
+ - type: cosine_recall@3
214
+ value: 0.12284482758620689
215
+ name: Cosine Recall@3
216
+ - type: cosine_recall@5
217
+ value: 0.20043103448275862
218
+ name: Cosine Recall@5
219
+ - type: cosine_recall@10
220
+ value: 0.39870689655172414
221
+ name: Cosine Recall@10
222
+ - type: cosine_ndcg@10
223
+ value: 0.18506006244346174
224
+ name: Cosine Ndcg@10
225
+ - type: cosine_mrr@10
226
+ value: 0.12174072933771223
227
+ name: Cosine Mrr@10
228
+ - type: cosine_map@100
229
+ value: 0.1456718436547049
230
+ name: Cosine Map@100
231
+ - task:
232
+ type: information-retrieval
233
+ name: Information Retrieval
234
+ dataset:
235
+ name: dim 128
236
+ type: dim_128
237
+ metrics:
238
+ - type: cosine_accuracy@1
239
+ value: 0.04525862068965517
240
+ name: Cosine Accuracy@1
241
+ - type: cosine_accuracy@3
242
+ value: 0.11637931034482758
243
+ name: Cosine Accuracy@3
244
+ - type: cosine_accuracy@5
245
+ value: 0.16810344827586207
246
+ name: Cosine Accuracy@5
247
+ - type: cosine_accuracy@10
248
+ value: 0.38146551724137934
249
+ name: Cosine Accuracy@10
250
+ - type: cosine_precision@1
251
+ value: 0.04525862068965517
252
+ name: Cosine Precision@1
253
+ - type: cosine_precision@3
254
+ value: 0.03879310344827586
255
+ name: Cosine Precision@3
256
+ - type: cosine_precision@5
257
+ value: 0.03362068965517242
258
+ name: Cosine Precision@5
259
+ - type: cosine_precision@10
260
+ value: 0.03814655172413794
261
+ name: Cosine Precision@10
262
+ - type: cosine_recall@1
263
+ value: 0.04525862068965517
264
+ name: Cosine Recall@1
265
+ - type: cosine_recall@3
266
+ value: 0.11637931034482758
267
+ name: Cosine Recall@3
268
+ - type: cosine_recall@5
269
+ value: 0.16810344827586207
270
+ name: Cosine Recall@5
271
+ - type: cosine_recall@10
272
+ value: 0.38146551724137934
273
+ name: Cosine Recall@10
274
+ - type: cosine_ndcg@10
275
+ value: 0.17534824322616613
276
+ name: Cosine Ndcg@10
277
+ - type: cosine_mrr@10
278
+ value: 0.11455682129173515
279
+ name: Cosine Mrr@10
280
+ - type: cosine_map@100
281
+ value: 0.139297198421225
282
+ name: Cosine Map@100
283
+ - task:
284
+ type: information-retrieval
285
+ name: Information Retrieval
286
+ dataset:
287
+ name: dim 64
288
+ type: dim_64
289
+ metrics:
290
+ - type: cosine_accuracy@1
291
+ value: 0.03879310344827586
292
+ name: Cosine Accuracy@1
293
+ - type: cosine_accuracy@3
294
+ value: 0.09698275862068965
295
+ name: Cosine Accuracy@3
296
+ - type: cosine_accuracy@5
297
+ value: 0.15301724137931033
298
+ name: Cosine Accuracy@5
299
+ - type: cosine_accuracy@10
300
+ value: 0.34698275862068967
301
+ name: Cosine Accuracy@10
302
+ - type: cosine_precision@1
303
+ value: 0.03879310344827586
304
+ name: Cosine Precision@1
305
+ - type: cosine_precision@3
306
+ value: 0.03232758620689655
307
+ name: Cosine Precision@3
308
+ - type: cosine_precision@5
309
+ value: 0.030603448275862068
310
+ name: Cosine Precision@5
311
+ - type: cosine_precision@10
312
+ value: 0.034698275862068965
313
+ name: Cosine Precision@10
314
+ - type: cosine_recall@1
315
+ value: 0.03879310344827586
316
+ name: Cosine Recall@1
317
+ - type: cosine_recall@3
318
+ value: 0.09698275862068965
319
+ name: Cosine Recall@3
320
+ - type: cosine_recall@5
321
+ value: 0.15301724137931033
322
+ name: Cosine Recall@5
323
+ - type: cosine_recall@10
324
+ value: 0.34698275862068967
325
+ name: Cosine Recall@10
326
+ - type: cosine_ndcg@10
327
+ value: 0.1568993526090112
328
+ name: Cosine Ndcg@10
329
+ - type: cosine_mrr@10
330
+ value: 0.10108699370552827
331
+ name: Cosine Mrr@10
332
+ - type: cosine_map@100
333
+ value: 0.1268371950835345
334
+ name: Cosine Map@100
335
+ ---
336
+
337
+ # SentenceTransformer based on PlanTL-GOB-ES/roberta-base-bne
338
+
339
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [PlanTL-GOB-ES/roberta-base-bne](https://huggingface.co/PlanTL-GOB-ES/roberta-base-bne). 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.
340
+
341
+ ## Model Details
342
+
343
+ ### Model Description
344
+ - **Model Type:** Sentence Transformer
345
+ - **Base model:** [PlanTL-GOB-ES/roberta-base-bne](https://huggingface.co/PlanTL-GOB-ES/roberta-base-bne) <!-- at revision 0e598176534f3cf2e30105f8286cf2503d6e4731 -->
346
+ - **Maximum Sequence Length:** 512 tokens
347
+ - **Output Dimensionality:** 768 tokens
348
+ - **Similarity Function:** Cosine Similarity
349
+ <!-- - **Training Dataset:** Unknown -->
350
+ <!-- - **Language:** Unknown -->
351
+ <!-- - **License:** Unknown -->
352
+
353
+ ### Model Sources
354
+
355
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
356
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
357
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
358
+
359
+ ### Full Model Architecture
360
+
361
+ ```
362
+ SentenceTransformer(
363
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: RobertaModel
364
+ (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})
365
+ )
366
+ ```
367
+
368
+ ## Usage
369
+
370
+ ### Direct Usage (Sentence Transformers)
371
+
372
+ First install the Sentence Transformers library:
373
+
374
+ ```bash
375
+ pip install -U sentence-transformers
376
+ ```
377
+
378
+ Then you can load this model and run inference.
379
+ ```python
380
+ from sentence_transformers import SentenceTransformer
381
+
382
+ # Download from the 🤗 Hub
383
+ model = SentenceTransformer("adriansanz/sitges10242608-4ep-rerankv3-sp")
384
+ # Run inference
385
+ sentences = [
386
+ 'Els establiments locals tenen un paper clau en el projecte de la targeta de fidelització, ja que són els que ofereixen descomptes i ofertes especials als consumidors que utilitzen la targeta.',
387
+ 'Quin és el paper dels establiments locals en el projecte de la targeta de fidelització?',
388
+ "Quins són els tractaments que beneficien la salut de l'empleat municipal que s'inclouen en l'ajuda?",
389
+ ]
390
+ embeddings = model.encode(sentences)
391
+ print(embeddings.shape)
392
+ # [3, 768]
393
+
394
+ # Get the similarity scores for the embeddings
395
+ similarities = model.similarity(embeddings, embeddings)
396
+ print(similarities.shape)
397
+ # [3, 3]
398
+ ```
399
+
400
+ <!--
401
+ ### Direct Usage (Transformers)
402
+
403
+ <details><summary>Click to see the direct usage in Transformers</summary>
404
+
405
+ </details>
406
+ -->
407
+
408
+ <!--
409
+ ### Downstream Usage (Sentence Transformers)
410
+
411
+ You can finetune this model on your own dataset.
412
+
413
+ <details><summary>Click to expand</summary>
414
+
415
+ </details>
416
+ -->
417
+
418
+ <!--
419
+ ### Out-of-Scope Use
420
+
421
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
422
+ -->
423
+
424
+ ## Evaluation
425
+
426
+ ### Metrics
427
+
428
+ #### Information Retrieval
429
+ * Dataset: `dim_768`
430
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
431
+
432
+ | Metric | Value |
433
+ |:--------------------|:-----------|
434
+ | cosine_accuracy@1 | 0.0517 |
435
+ | cosine_accuracy@3 | 0.125 |
436
+ | cosine_accuracy@5 | 0.1875 |
437
+ | cosine_accuracy@10 | 0.3858 |
438
+ | cosine_precision@1 | 0.0517 |
439
+ | cosine_precision@3 | 0.0417 |
440
+ | cosine_precision@5 | 0.0375 |
441
+ | cosine_precision@10 | 0.0386 |
442
+ | cosine_recall@1 | 0.0517 |
443
+ | cosine_recall@3 | 0.125 |
444
+ | cosine_recall@5 | 0.1875 |
445
+ | cosine_recall@10 | 0.3858 |
446
+ | cosine_ndcg@10 | 0.1821 |
447
+ | cosine_mrr@10 | 0.122 |
448
+ | **cosine_map@100** | **0.1462** |
449
+
450
+ #### Information Retrieval
451
+ * Dataset: `dim_512`
452
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
453
+
454
+ | Metric | Value |
455
+ |:--------------------|:----------|
456
+ | cosine_accuracy@1 | 0.0453 |
457
+ | cosine_accuracy@3 | 0.1142 |
458
+ | cosine_accuracy@5 | 0.181 |
459
+ | cosine_accuracy@10 | 0.3815 |
460
+ | cosine_precision@1 | 0.0453 |
461
+ | cosine_precision@3 | 0.0381 |
462
+ | cosine_precision@5 | 0.0362 |
463
+ | cosine_precision@10 | 0.0381 |
464
+ | cosine_recall@1 | 0.0453 |
465
+ | cosine_recall@3 | 0.1142 |
466
+ | cosine_recall@5 | 0.181 |
467
+ | cosine_recall@10 | 0.3815 |
468
+ | cosine_ndcg@10 | 0.1753 |
469
+ | cosine_mrr@10 | 0.1144 |
470
+ | **cosine_map@100** | **0.139** |
471
+
472
+ #### Information Retrieval
473
+ * Dataset: `dim_256`
474
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
475
+
476
+ | Metric | Value |
477
+ |:--------------------|:-----------|
478
+ | cosine_accuracy@1 | 0.0474 |
479
+ | cosine_accuracy@3 | 0.1228 |
480
+ | cosine_accuracy@5 | 0.2004 |
481
+ | cosine_accuracy@10 | 0.3987 |
482
+ | cosine_precision@1 | 0.0474 |
483
+ | cosine_precision@3 | 0.0409 |
484
+ | cosine_precision@5 | 0.0401 |
485
+ | cosine_precision@10 | 0.0399 |
486
+ | cosine_recall@1 | 0.0474 |
487
+ | cosine_recall@3 | 0.1228 |
488
+ | cosine_recall@5 | 0.2004 |
489
+ | cosine_recall@10 | 0.3987 |
490
+ | cosine_ndcg@10 | 0.1851 |
491
+ | cosine_mrr@10 | 0.1217 |
492
+ | **cosine_map@100** | **0.1457** |
493
+
494
+ #### Information Retrieval
495
+ * Dataset: `dim_128`
496
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
497
+
498
+ | Metric | Value |
499
+ |:--------------------|:-----------|
500
+ | cosine_accuracy@1 | 0.0453 |
501
+ | cosine_accuracy@3 | 0.1164 |
502
+ | cosine_accuracy@5 | 0.1681 |
503
+ | cosine_accuracy@10 | 0.3815 |
504
+ | cosine_precision@1 | 0.0453 |
505
+ | cosine_precision@3 | 0.0388 |
506
+ | cosine_precision@5 | 0.0336 |
507
+ | cosine_precision@10 | 0.0381 |
508
+ | cosine_recall@1 | 0.0453 |
509
+ | cosine_recall@3 | 0.1164 |
510
+ | cosine_recall@5 | 0.1681 |
511
+ | cosine_recall@10 | 0.3815 |
512
+ | cosine_ndcg@10 | 0.1753 |
513
+ | cosine_mrr@10 | 0.1146 |
514
+ | **cosine_map@100** | **0.1393** |
515
+
516
+ #### Information Retrieval
517
+ * Dataset: `dim_64`
518
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
519
+
520
+ | Metric | Value |
521
+ |:--------------------|:-----------|
522
+ | cosine_accuracy@1 | 0.0388 |
523
+ | cosine_accuracy@3 | 0.097 |
524
+ | cosine_accuracy@5 | 0.153 |
525
+ | cosine_accuracy@10 | 0.347 |
526
+ | cosine_precision@1 | 0.0388 |
527
+ | cosine_precision@3 | 0.0323 |
528
+ | cosine_precision@5 | 0.0306 |
529
+ | cosine_precision@10 | 0.0347 |
530
+ | cosine_recall@1 | 0.0388 |
531
+ | cosine_recall@3 | 0.097 |
532
+ | cosine_recall@5 | 0.153 |
533
+ | cosine_recall@10 | 0.347 |
534
+ | cosine_ndcg@10 | 0.1569 |
535
+ | cosine_mrr@10 | 0.1011 |
536
+ | **cosine_map@100** | **0.1268** |
537
+
538
+ <!--
539
+ ## Bias, Risks and Limitations
540
+
541
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
542
+ -->
543
+
544
+ <!--
545
+ ### Recommendations
546
+
547
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
548
+ -->
549
+
550
+ ## Training Details
551
+
552
+ ### Training Dataset
553
+
554
+ #### Unnamed Dataset
555
+
556
+
557
+ * Size: 4,173 training samples
558
+ * Columns: <code>positive</code> and <code>anchor</code>
559
+ * Approximate statistics based on the first 1000 samples:
560
+ | | positive | anchor |
561
+ |:--------|:------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|
562
+ | type | string | string |
563
+ | details | <ul><li>min: 10 tokens</li><li>mean: 60.84 tokens</li><li>max: 206 tokens</li></ul> | <ul><li>min: 10 tokens</li><li>mean: 25.34 tokens</li><li>max: 53 tokens</li></ul> |
564
+ * Samples:
565
+ | positive | anchor |
566
+ |:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------|
567
+ | <code>L'objectiu principal de la persona coordinadora de colònia felina és garantir el benestar dels animals de la colònia.</code> | <code>Quin és l'objectiu principal de la persona coordinadora de colònia felina?</code> |
568
+ | <code>Es tracta d'una sala amb capacitat per a 125 persones, equipada amb un petit escenari, sistema de sonorització, pantalla per a projeccions, camerins i serveis higiènics (WC).</code> | <code>Quin és el nombre de persones que pot acollir la sala d'actes del Casal Municipal de la Gent Gran de Sitges?</code> |
569
+ | <code>Aquest ajut pretén fomentar l’associacionisme empresarial local, per tal de disposar d’agrupacions, gremis o associacions representatives de l’activitat empresarial del municipi.</code> | <code>Quin és el paper de les empreses en aquest ajut?</code> |
570
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
571
+ ```json
572
+ {
573
+ "loss": "MultipleNegativesRankingLoss",
574
+ "matryoshka_dims": [
575
+ 768,
576
+ 512,
577
+ 256,
578
+ 128,
579
+ 64
580
+ ],
581
+ "matryoshka_weights": [
582
+ 1,
583
+ 1,
584
+ 1,
585
+ 1,
586
+ 1
587
+ ],
588
+ "n_dims_per_step": -1
589
+ }
590
+ ```
591
+
592
+ ### Training Hyperparameters
593
+ #### Non-Default Hyperparameters
594
+
595
+ - `eval_strategy`: epoch
596
+ - `per_device_train_batch_size`: 16
597
+ - `per_device_eval_batch_size`: 16
598
+ - `gradient_accumulation_steps`: 16
599
+ - `num_train_epochs`: 4
600
+ - `lr_scheduler_type`: cosine
601
+ - `warmup_ratio`: 0.2
602
+ - `bf16`: True
603
+ - `tf32`: False
604
+ - `load_best_model_at_end`: True
605
+ - `optim`: adamw_torch_fused
606
+ - `batch_sampler`: no_duplicates
607
+
608
+ #### All Hyperparameters
609
+ <details><summary>Click to expand</summary>
610
+
611
+ - `overwrite_output_dir`: False
612
+ - `do_predict`: False
613
+ - `eval_strategy`: epoch
614
+ - `prediction_loss_only`: True
615
+ - `per_device_train_batch_size`: 16
616
+ - `per_device_eval_batch_size`: 16
617
+ - `per_gpu_train_batch_size`: None
618
+ - `per_gpu_eval_batch_size`: None
619
+ - `gradient_accumulation_steps`: 16
620
+ - `eval_accumulation_steps`: None
621
+ - `learning_rate`: 5e-05
622
+ - `weight_decay`: 0.0
623
+ - `adam_beta1`: 0.9
624
+ - `adam_beta2`: 0.999
625
+ - `adam_epsilon`: 1e-08
626
+ - `max_grad_norm`: 1.0
627
+ - `num_train_epochs`: 4
628
+ - `max_steps`: -1
629
+ - `lr_scheduler_type`: cosine
630
+ - `lr_scheduler_kwargs`: {}
631
+ - `warmup_ratio`: 0.2
632
+ - `warmup_steps`: 0
633
+ - `log_level`: passive
634
+ - `log_level_replica`: warning
635
+ - `log_on_each_node`: True
636
+ - `logging_nan_inf_filter`: True
637
+ - `save_safetensors`: True
638
+ - `save_on_each_node`: False
639
+ - `save_only_model`: False
640
+ - `restore_callback_states_from_checkpoint`: False
641
+ - `no_cuda`: False
642
+ - `use_cpu`: False
643
+ - `use_mps_device`: False
644
+ - `seed`: 42
645
+ - `data_seed`: None
646
+ - `jit_mode_eval`: False
647
+ - `use_ipex`: False
648
+ - `bf16`: True
649
+ - `fp16`: False
650
+ - `fp16_opt_level`: O1
651
+ - `half_precision_backend`: auto
652
+ - `bf16_full_eval`: False
653
+ - `fp16_full_eval`: False
654
+ - `tf32`: False
655
+ - `local_rank`: 0
656
+ - `ddp_backend`: None
657
+ - `tpu_num_cores`: None
658
+ - `tpu_metrics_debug`: False
659
+ - `debug`: []
660
+ - `dataloader_drop_last`: False
661
+ - `dataloader_num_workers`: 0
662
+ - `dataloader_prefetch_factor`: None
663
+ - `past_index`: -1
664
+ - `disable_tqdm`: False
665
+ - `remove_unused_columns`: True
666
+ - `label_names`: None
667
+ - `load_best_model_at_end`: True
668
+ - `ignore_data_skip`: False
669
+ - `fsdp`: []
670
+ - `fsdp_min_num_params`: 0
671
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
672
+ - `fsdp_transformer_layer_cls_to_wrap`: None
673
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
674
+ - `deepspeed`: None
675
+ - `label_smoothing_factor`: 0.0
676
+ - `optim`: adamw_torch_fused
677
+ - `optim_args`: None
678
+ - `adafactor`: False
679
+ - `group_by_length`: False
680
+ - `length_column_name`: length
681
+ - `ddp_find_unused_parameters`: None
682
+ - `ddp_bucket_cap_mb`: None
683
+ - `ddp_broadcast_buffers`: False
684
+ - `dataloader_pin_memory`: True
685
+ - `dataloader_persistent_workers`: False
686
+ - `skip_memory_metrics`: True
687
+ - `use_legacy_prediction_loop`: False
688
+ - `push_to_hub`: False
689
+ - `resume_from_checkpoint`: None
690
+ - `hub_model_id`: None
691
+ - `hub_strategy`: every_save
692
+ - `hub_private_repo`: False
693
+ - `hub_always_push`: False
694
+ - `gradient_checkpointing`: False
695
+ - `gradient_checkpointing_kwargs`: None
696
+ - `include_inputs_for_metrics`: False
697
+ - `eval_do_concat_batches`: True
698
+ - `fp16_backend`: auto
699
+ - `push_to_hub_model_id`: None
700
+ - `push_to_hub_organization`: None
701
+ - `mp_parameters`:
702
+ - `auto_find_batch_size`: False
703
+ - `full_determinism`: False
704
+ - `torchdynamo`: None
705
+ - `ray_scope`: last
706
+ - `ddp_timeout`: 1800
707
+ - `torch_compile`: False
708
+ - `torch_compile_backend`: None
709
+ - `torch_compile_mode`: None
710
+ - `dispatch_batches`: None
711
+ - `split_batches`: None
712
+ - `include_tokens_per_second`: False
713
+ - `include_num_input_tokens_seen`: False
714
+ - `neftune_noise_alpha`: None
715
+ - `optim_target_modules`: None
716
+ - `batch_eval_metrics`: False
717
+ - `eval_on_start`: False
718
+ - `batch_sampler`: no_duplicates
719
+ - `multi_dataset_batch_sampler`: proportional
720
+
721
+ </details>
722
+
723
+ ### Training Logs
724
+ | 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 |
725
+ |:----------:|:------:|:-------------:|:----------------------:|:----------------------:|:----------------------:|:---------------------:|:----------------------:|
726
+ | 0.6130 | 10 | 10.8464 | - | - | - | - | - |
727
+ | 0.9808 | 16 | - | 0.1060 | 0.1088 | 0.1067 | 0.0984 | 0.1074 |
728
+ | 1.2261 | 20 | 3.5261 | - | - | - | - | - |
729
+ | 1.8391 | 30 | 1.4363 | - | - | - | - | - |
730
+ | 1.9617 | 32 | - | 0.1406 | 0.1468 | 0.1356 | 0.1395 | 0.1373 |
731
+ | 2.4521 | 40 | 0.5627 | - | - | - | - | - |
732
+ | 2.9425 | 48 | - | 0.1377 | 0.1418 | 0.1427 | 0.1322 | 0.1437 |
733
+ | 3.0651 | 50 | 0.2727 | - | - | - | - | - |
734
+ | 3.6782 | 60 | 0.1297 | - | - | - | - | - |
735
+ | **3.9234** | **64** | **-** | **0.1393** | **0.1457** | **0.139** | **0.1268** | **0.1462** |
736
+
737
+ * The bold row denotes the saved checkpoint.
738
+
739
+ ### Framework Versions
740
+ - Python: 3.10.12
741
+ - Sentence Transformers: 3.0.1
742
+ - Transformers: 4.42.4
743
+ - PyTorch: 2.4.0+cu121
744
+ - Accelerate: 0.34.0.dev0
745
+ - Datasets: 2.21.0
746
+ - Tokenizers: 0.19.1
747
+
748
+ ## Citation
749
+
750
+ ### BibTeX
751
+
752
+ #### Sentence Transformers
753
+ ```bibtex
754
+ @inproceedings{reimers-2019-sentence-bert,
755
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
756
+ author = "Reimers, Nils and Gurevych, Iryna",
757
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
758
+ month = "11",
759
+ year = "2019",
760
+ publisher = "Association for Computational Linguistics",
761
+ url = "https://arxiv.org/abs/1908.10084",
762
+ }
763
+ ```
764
+
765
+ #### MatryoshkaLoss
766
+ ```bibtex
767
+ @misc{kusupati2024matryoshka,
768
+ title={Matryoshka Representation Learning},
769
+ 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},
770
+ year={2024},
771
+ eprint={2205.13147},
772
+ archivePrefix={arXiv},
773
+ primaryClass={cs.LG}
774
+ }
775
+ ```
776
+
777
+ #### MultipleNegativesRankingLoss
778
+ ```bibtex
779
+ @misc{henderson2017efficient,
780
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
781
+ 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},
782
+ year={2017},
783
+ eprint={1705.00652},
784
+ archivePrefix={arXiv},
785
+ primaryClass={cs.CL}
786
+ }
787
+ ```
788
+
789
+ <!--
790
+ ## Glossary
791
+
792
+ *Clearly define terms in order to be accessible across audiences.*
793
+ -->
794
+
795
+ <!--
796
+ ## Model Card Authors
797
+
798
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
799
+ -->
800
+
801
+ <!--
802
+ ## Model Card Contact
803
+
804
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
805
+ -->
config.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "PlanTL-GOB-ES/roberta-base-bne",
3
+ "architectures": [
4
+ "RobertaModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.0,
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.0,
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": "roberta",
19
+ "num_attention_heads": 12,
20
+ "num_hidden_layers": 12,
21
+ "pad_token_id": 1,
22
+ "position_embedding_type": "absolute",
23
+ "torch_dtype": "float32",
24
+ "transformers_version": "4.42.4",
25
+ "type_vocab_size": 1,
26
+ "use_cache": true,
27
+ "vocab_size": 50262
28
+ }
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
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4175323bbad74a057b2c6f3dcd2f7118db69153c319706b717b7adf27c9df399
3
+ size 498595688
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,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "<s>",
11
+ "lstrip": false,
12
+ "normalized": true,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "</s>",
18
+ "lstrip": false,
19
+ "normalized": true,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "<mask>",
25
+ "lstrip": true,
26
+ "normalized": true,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "<pad>",
32
+ "lstrip": false,
33
+ "normalized": true,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "sep_token": {
38
+ "content": "</s>",
39
+ "lstrip": false,
40
+ "normalized": true,
41
+ "rstrip": false,
42
+ "single_word": false
43
+ },
44
+ "unk_token": {
45
+ "content": "<unk>",
46
+ "lstrip": false,
47
+ "normalized": true,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "0": {
5
+ "content": "<s>",
6
+ "lstrip": false,
7
+ "normalized": true,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "1": {
13
+ "content": "<pad>",
14
+ "lstrip": false,
15
+ "normalized": true,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "2": {
21
+ "content": "</s>",
22
+ "lstrip": false,
23
+ "normalized": true,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "3": {
29
+ "content": "<unk>",
30
+ "lstrip": false,
31
+ "normalized": true,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "4": {
37
+ "content": "<mask>",
38
+ "lstrip": true,
39
+ "normalized": true,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ }
44
+ },
45
+ "bos_token": "<s>",
46
+ "clean_up_tokenization_spaces": true,
47
+ "cls_token": "<s>",
48
+ "eos_token": "</s>",
49
+ "errors": "replace",
50
+ "mask_token": "<mask>",
51
+ "max_len": 512,
52
+ "model_max_length": 512,
53
+ "pad_token": "<pad>",
54
+ "sep_token": "</s>",
55
+ "tokenizer_class": "RobertaTokenizer",
56
+ "trim_offsets": true,
57
+ "unk_token": "<unk>"
58
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff