nickprock commited on
Commit
33b0a67
·
verified ·
1 Parent(s): 23e8892

Upgrade to V4 (Matryoshka Tuned Weights). 768d: 0.8427 | 128d: 0.8005

Browse files
Files changed (3) hide show
  1. README.md +842 -219
  2. model.safetensors +1 -1
  3. tokenizer_config.json +1 -1
README.md CHANGED
@@ -1,219 +1,842 @@
1
- ---
2
- language:
3
- - it
4
- tags:
5
- - sentence-transformers
6
- - sentence-similarity
7
- - feature-extraction
8
- - dense
9
- - matryoshka
10
- - information-retrieval
11
- - generated_from_trainer
12
- dataset_size: 50749
13
- loss:
14
- - MatryoshkaLoss
15
- - CachedMultipleNegativesRankingLoss
16
- - CosineSimilarityLoss
17
- base_model: nickprock/multi-sentence-BERTino
18
- widget:
19
- - source_sentence: >-
20
- Ci stiamo muovendo "... rispetto al commovente telaio cosmico di riposo ...
21
- a circa 371 km/s verso la costellazione del Leone".
22
- sentences:
23
- - Una donna sta tagliando le cipolle verdi.
24
- - Non c'è un 'fermo' che non sia relativo a qualche altro oggetto.
25
- - Un gruppo di anziani si mette in posa attorno a un tavolo da pranzo.
26
- - source_sentence: L'uomo ha parlato con una ragazza attraverso la telecamera di internet.
27
- sentences:
28
- - La ragazza è in piedi davanti alla porta aperta dell'autobus.
29
- - Il giocatore di basket sta per segnare punti per la sua squadra.
30
- - Un adolescente parla con una ragazza tramite una webcam.
31
- - source_sentence: Qual è stato il risultato della finale del Cincinnati Open 1971?
32
- sentences:
33
- - >-
34
- Partecipò ai Giochi della II Olimpiade di Parigi del 1900 conquistando una
35
- medaglia d'argento nel rugby a 15 con il SC 1880 Frankfurt, squadra
36
- rappresentante la Germania.
37
-
38
-
39
- Palmarès
40
- Argento olimpico: 1
41
- 1900
42
-
43
-
44
- Collegamenti esterni
45
-
46
- Profilo su espnscrum.
47
- - >-
48
- Biografia
49
-
50
- Ha un gemello, chiamato Thomas, anch'egli calciatore professionista.
51
-
52
-
53
- Carriera
54
-
55
-
56
- Club
57
-
58
- Michelsen cominciò la carriera con la maglia del Langhus, per poi passare al
59
- Drøbak/Frogn. Nel 1993 passò al Lyn Oslo. Esordì nell'Eliteserien il 2
60
- maggio dello stesso anno, quando fu titolare nella sconfitta casalinga per
61
- 0-1 contro il Rosenborg. Il 13 giugno arrivò la prima rete, nella vittoria
62
- per 5-3 sul Molde. A fine anno, tornò al Drøbak/Frogn.
63
-
64
-
65
- Nel 1996, fu ingaggiato dallo Skeid, tornando così nella massima divisione
66
- norvegese. Il 13 aprile, fu in campo nella sconfitta per 2-3 contro lo
67
- Strømsgodset.
68
- - >-
69
- Il singolare maschile del torneo di tennis Cincinnati Open 1971, facente
70
- parte della categoria Grand Prix, ha avuto come vincitore Stan Smith che ha
71
- battuto in finale Juan Gisbert 7-6, 6-3.
72
- pipeline_tag: sentence-similarity
73
- library_name: sentence-transformers
74
- metrics:
75
- - cosine_accuracy@1
76
- - cosine_accuracy@3
77
- - cosine_accuracy@5
78
- - cosine_accuracy@10
79
- - cosine_precision@1
80
- - cosine_precision@3
81
- - cosine_precision@5
82
- - cosine_precision@10
83
- - cosine_recall@1
84
- - cosine_recall@3
85
- - cosine_recall@5
86
- - cosine_recall@10
87
- - cosine_ndcg@10
88
- - cosine_mrr@10
89
- - cosine_map@100
90
- - pearson_cosine
91
- - spearman_cosine
92
- license: apache-2.0
93
- datasets:
94
- - nickprock/it-wiki-retrieval-synthetic-hn
95
- ---
96
-
97
- # multi-sentence-BERTino (V4 - Matryoshka Tuned)
98
-
99
-
100
-
101
- This is a state-of-the-art [sentence-transformers](https://www.SBERT.net) model for the Italian language. It maps sentences and paragraphs to a flexible dense vector space (up to 768 dimensions) and is highly optimized for semantic search, retrieval-augmented generation (RAG), and semantic textual similarity.
102
-
103
- ## Model Highlights: Matryoshka Representation Learning
104
- This V4 model was fine-tuned using **Matryoshka Representation Learning (MRL)** with asymmetric loss weights `[1.0, 0.3, 0.15, 0.1]`.
105
-
106
- This means the model has learned to hierarchically compress its semantic knowledge into the earliest dimensions of the vector. You can safely truncate the output embeddings to **512, 256, or 128 dimensions** with minimal degradation in retrieval metrics. Truncating to 128 dimensions allows you to **save up to 83% of storage costs** in vector databases (like Pinecone, Qdrant, or Milvus) and drastically speed up similarity searches, while still outperforming standard 128d baselines.
107
-
108
- Additionally, this model was trained exclusively on **Semantic Hard Negatives** (mined via dense bi-encoder self-retrieval) to prevent the "false-negative" traps commonly caused by traditional BM25 lexical mining.
109
-
110
- ## Usage
111
-
112
- ### Direct Usage (Sentence Transformers)
113
-
114
- First, install the Sentence Transformers library:
115
-
116
- ```bash
117
- pip install -U sentence-transformers
118
- ```
119
-
120
- **Standard Usage (Full 768 Dimensions):**
121
- ```python
122
- from sentence_transformers import SentenceTransformer
123
-
124
- # Download from the 🤗 Hub
125
- model = SentenceTransformer("nickprock/multi-sentence-BERTino")
126
-
127
- # Run inference
128
- sentences = [
129
- 'Chi ha dipinto la Gioconda?',
130
- 'Leonardo da Vinci è l\'autore della Gioconda, opera conservata al Louvre.',
131
- ]
132
- embeddings = model.encode(sentences)
133
- print(embeddings.shape)
134
- # Output: (2, 768)
135
- ```
136
-
137
- **Optimized Usage (Truncated to 128 Dimensions):**
138
- You can instantly compress the model's footprint by setting the `truncate_dim` parameter.
139
- ```python
140
- from sentence_transformers import SentenceTransformer
141
-
142
- # Load the model and force truncation at 128 dimensions
143
- model = SentenceTransformer("nickprock/multi-sentence-BERTino", truncate_dim=128)
144
-
145
- embeddings = model.encode(sentences)
146
- print(embeddings.shape)
147
- # Output: (2, 128) -> 83% less memory used!
148
- ```
149
-
150
- ## Evaluation Metrics
151
-
152
- This model was evaluated on a 5% hold-out split of our high-quality synthetic Italian retrieval dataset (containing tough semantic hard negatives) and the Italian STS-B dataset.
153
-
154
- As shown below, the model retains exceptional performance even when the vectors are truncated to 1/6th of their original size.
155
-
156
- ### Information Retrieval (MAP & NDCG)
157
-
158
- | Metric | 768 Dimensions (Full) | 128 Dimensions (Truncated) |
159
- |:-------|:----------------------|:---------------------------|
160
- | **MAP@100** | 0.8412 | 0.8029 |
161
- | **NDCG@10** | 0.8698 | 0.8353 |
162
- | **MRR@10** | 0.8396 | 0.8008 |
163
- | **Accuracy@1**| 0.7617 | 0.7149 |
164
- | **Accuracy@10**| 0.9616 | 0.9404 |
165
-
166
- ### Semantic Textual Similarity (STS-B Italian Dev)
167
- | Metric | 768 Dimensions (Full) |
168
- |:-------|:----------------------|
169
- | **Spearman Cosine** | 0.8519 |
170
- | **Pearson Cosine** | 0.8553 |
171
-
172
- ## Training Details
173
-
174
- ### Loss Functions
175
- The model was trained in a multi-task setup utilizing Gradient Caching for massive logical batch sizes, wrapped inside a Matryoshka Loss:
176
-
177
- 1. **Information Retrieval Task:** `CachedMultipleNegativesRankingLoss` with `mini_batch_size=16` and a logical `batch_size=128`.
178
- 2. **Semantic Similarity Task:** `CosineSimilarityLoss`.
179
-
180
- Both base losses were wrapped in `MatryoshkaLoss` targeting dimensions `[768, 512, 256, 128]`. To preserve the maximum absolute accuracy at 768d, we tuned the `matryoshka_weights` asymmetrically to `[1.0, 0.3, 0.15, 0.1]`.
181
-
182
- ### Training Datasets
183
- - **task_retrieval**: ~45,000 synthetic Italian search queries generated via LLM (Qwen-2.5-7B) from Italian Wikipedia paragraphs. Each query is paired with 1 positive document and 2 Dense Hard Negatives.
184
- - **task_sts**: The Italian split of `stsb_multi_mt`.
185
-
186
- ### Hyperparameters
187
- - `per_device_train_batch_size`: 128
188
- - `num_train_epochs`: 4
189
- - `learning_rate`: 1e-05
190
- - `warmup_steps`: 10%
191
- - `fp16`: True
192
- - `batch_sampler`: no_duplicates
193
-
194
- ## Citation
195
-
196
- ### BibTeX
197
- #### MatryoshkaLoss
198
- ```bibtex
199
- @misc{kusupati2024matryoshka,
200
- title={Matryoshka Representation Learning},
201
- 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},
202
- year={2024},
203
- eprint={2205.13147},
204
- archivePrefix={arXiv},
205
- primaryClass={cs.LG}
206
- }
207
- ```
208
-
209
- #### CachedMultipleNegativesRankingLoss
210
- ```bibtex
211
- @misc{gao2021scaling,
212
- title={Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup},
213
- author={Luyu Gao and Yunyi Zhang and Jiawei Han and Jamie Callan},
214
- year={2021},
215
- eprint={2101.06983},
216
- archivePrefix={arXiv},
217
- primaryClass={cs.LG}
218
- }
219
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - de
4
+ - en
5
+ - es
6
+ - fr
7
+ - it
8
+ - nl
9
+ - pl
10
+ - pt
11
+ - ru
12
+ - zh
13
+ tags:
14
+ - sentence-transformers
15
+ - sentence-similarity
16
+ - feature-extraction
17
+ - dense
18
+ - generated_from_trainer
19
+ - dataset_size:90992
20
+ - loss:MatryoshkaLoss
21
+ - loss:CachedMultipleNegativesRankingLoss
22
+ - loss:CoSENTLoss
23
+ base_model: nickprock/multi-sentence-BERTino
24
+ widget:
25
+ - source_sentence: Ci stiamo muovendo "... rispetto al commovente telaio cosmico di
26
+ riposo ... a circa 371 km/s verso la costellazione del Leone".
27
+ sentences:
28
+ - Una donna sta tagliando le cipolle verdi.
29
+ - Non c'è un 'fermo' che non sia relativo a qualche altro oggetto.
30
+ - Un gruppo di anziani si mette in posa attorno a un tavolo da pranzo.
31
+ - source_sentence: L'uomo ha parlato con una ragazza attraverso la telecamera di internet.
32
+ sentences:
33
+ - La ragazza è in piedi davanti alla porta aperta dell'autobus.
34
+ - Il giocatore di basket sta per segnare punti per la sua squadra.
35
+ - Un adolescente parla con una ragazza tramite una webcam.
36
+ - source_sentence: Qual è stato il risultato della finale del Cincinnati Open 1971?
37
+ sentences:
38
+ - "Partecipò ai Giochi della II Olimpiade di Parigi del 1900 conquistando una medaglia\
39
+ \ d'argento nel rugby a 15 con il SC 1880 Frankfurt, squadra rappresentante la\
40
+ \ Germania.\n\nPalmarès \n Argento olimpico: 1\n1900\n\nCollegamenti esterni \n\
41
+ \n Profilo su espnscrum."
42
+ - 'Biografia
43
+
44
+ Ha un gemello, chiamato Thomas, anch''egli calciatore professionista.
45
+
46
+
47
+ Carriera
48
+
49
+
50
+ Club
51
+
52
+ Michelsen cominciò la carriera con la maglia del Langhus, per poi passare al Drøbak/Frogn.
53
+ Nel 1993 passò al Lyn Oslo. Esordì nell''Eliteserien il 2 maggio dello stesso
54
+ anno, quando fu titolare nella sconfitta casalinga per 0-1 contro il Rosenborg.
55
+ Il 13 giugno arrivò la prima rete, nella vittoria per 5-3 sul Molde. A fine anno,
56
+ tornò al Drøbak/Frogn.
57
+
58
+
59
+ Nel 1996, fu ingaggiato dallo Skeid, tornando così nella massima divisione norvegese.
60
+ Il 13 aprile, fu in campo nella sconfitta per 2-3 contro lo Strømsgodset.'
61
+ - Il singolare maschile del torneo di tennis Cincinnati Open 1971, facente parte
62
+ della categoria Grand Prix, ha avuto come vincitore Stan Smith che ha battuto
63
+ in finale Juan Gisbert 7-6, 6-3.
64
+ - source_sentence: In che anno hanno iniziato gli eventi Invicta FC a essere trasmesse
65
+ sulla piattaforma UFC Fight Pass?
66
+ sentences:
67
+ - 'Coppa Ottorino Barassi – competizione calcistica ufficiale tra club italiani
68
+ e inglesi disputata dal 1968 al 1976
69
+
70
+ Lodo Barassi decisione arbitrale presa dal presidente federale Ottorino Barassi
71
+ che disciplinò la struttura del campionato italiano di calcio negli anni Cinquanta
72
+
73
+ Lodovico Barassi – giurista italiano (1873-1961)
74
+
75
+ Ottorino Barassi – dirigente sportivo italiano (1898-1971)
76
+
77
+ Ron Barassi – campione di football australiano
78
+
79
+ Pierre-Louis Barassi – giocatore della nazionale francese di rugby a 15'
80
+ - "L'Ordine d'Onore è un'onorificenza della Georgia.\n\nStoria \nL'Ordine è stato\
81
+ \ fondato il 24 dicembre 1992.\n\nInsegne \n Il nastro è bianco con una striscia\
82
+ \ blu al centro circondata da sottili strisce rosse."
83
+ - 'Invicta Fighting Championships, spesso abbreviata in Invicta FC, è un''organizzazione
84
+ statunitense di arti marziali miste femminili con base a Enka, area non incorporata
85
+ della città di Asheville.
86
+
87
+
88
+ Dalla sua nascita Invicta FC ha sempre messo sotto contratto buona parte delle
89
+ lottatrici più forti del mondo per i ranking ufficiali.
90
+
91
+ Gli eventi vennero inizialmente trasmessi su siti di streaming live come Ustream,
92
+ e dal 2014 essi sono inclusi nella piattaforma UFC Fight Pass della promozione
93
+ UFC.'
94
+ - source_sentence: Importanza storica delle partite ufficiali per i giocatori di calcio
95
+ sentences:
96
+ - '100050 Carloshernandez è un asteroide della fascia principale. Scoperto nel 1991,
97
+ presenta un''orbita caratterizzata da un semiasse maggiore pari a 2,5991503 UA
98
+ e da un''eccentricità di 0,2144518, inclinata di 1,67744° rispetto all''eclittica.
99
+
100
+
101
+ L''asteroide è stato dedicato dallo scopritore al nipote Carlos R. Hernandez.'
102
+ - 'Carriera
103
+
104
+
105
+ Club
106
+
107
+ Kortgaard vestì la maglia del Mjøndalen.
108
+
109
+
110
+ Nazionale
111
+
112
+ Conta 4 presenze per la . Debuttò il 19 maggio 1983, nel pareggio per 2-2 contro
113
+ la .'
114
+ - "Carriera\n\nNazionale\nHa preso parte ai Giochi Olimpici di Londra 2012, giocando\
115
+ \ in tutte e tre le partite disputate dalla sua Nazionale.\n\nCollegamenti esterni\
116
+ \ \n\nhttp://it.soccerway."
117
+ datasets:
118
+ - PhilipMay/stsb_multi_mt
119
+ pipeline_tag: sentence-similarity
120
+ library_name: sentence-transformers
121
+ metrics:
122
+ - cosine_accuracy@1
123
+ - cosine_accuracy@3
124
+ - cosine_accuracy@5
125
+ - cosine_accuracy@10
126
+ - cosine_precision@1
127
+ - cosine_precision@3
128
+ - cosine_precision@5
129
+ - cosine_precision@10
130
+ - cosine_recall@1
131
+ - cosine_recall@3
132
+ - cosine_recall@5
133
+ - cosine_recall@10
134
+ - cosine_ndcg@10
135
+ - cosine_mrr@10
136
+ - cosine_map@100
137
+ - pearson_cosine
138
+ - spearman_cosine
139
+ model-index:
140
+ - name: SentenceTransformer based on nickprock/multi-sentence-BERTino
141
+ results:
142
+ - task:
143
+ type: information-retrieval
144
+ name: Information Retrieval
145
+ dataset:
146
+ name: retrieval 768d
147
+ type: retrieval-768d
148
+ metrics:
149
+ - type: cosine_accuracy@1
150
+ value: 0.7652938824470212
151
+ name: Cosine Accuracy@1
152
+ - type: cosine_accuracy@3
153
+ value: 0.9052379048380648
154
+ name: Cosine Accuracy@3
155
+ - type: cosine_accuracy@5
156
+ value: 0.9384246301479409
157
+ name: Cosine Accuracy@5
158
+ - type: cosine_accuracy@10
159
+ value: 0.9616153538584566
160
+ name: Cosine Accuracy@10
161
+ - type: cosine_precision@1
162
+ value: 0.7652938824470212
163
+ name: Cosine Precision@1
164
+ - type: cosine_precision@3
165
+ value: 0.30174596827935496
166
+ name: Cosine Precision@3
167
+ - type: cosine_precision@5
168
+ value: 0.18768492602958814
169
+ name: Cosine Precision@5
170
+ - type: cosine_precision@10
171
+ value: 0.09616153538584567
172
+ name: Cosine Precision@10
173
+ - type: cosine_recall@1
174
+ value: 0.7652938824470212
175
+ name: Cosine Recall@1
176
+ - type: cosine_recall@3
177
+ value: 0.9052379048380648
178
+ name: Cosine Recall@3
179
+ - type: cosine_recall@5
180
+ value: 0.9384246301479409
181
+ name: Cosine Recall@5
182
+ - type: cosine_recall@10
183
+ value: 0.9616153538584566
184
+ name: Cosine Recall@10
185
+ - type: cosine_ndcg@10
186
+ value: 0.8709655191496608
187
+ name: Cosine Ndcg@10
188
+ - type: cosine_mrr@10
189
+ value: 0.8411203772459269
190
+ name: Cosine Mrr@10
191
+ - type: cosine_map@100
192
+ value: 0.8426922800593073
193
+ name: Cosine Map@100
194
+ - task:
195
+ type: information-retrieval
196
+ name: Information Retrieval
197
+ dataset:
198
+ name: retrieval 128d
199
+ type: retrieval-128d
200
+ metrics:
201
+ - type: cosine_accuracy@1
202
+ value: 0.7153138744502199
203
+ name: Cosine Accuracy@1
204
+ - type: cosine_accuracy@3
205
+ value: 0.8692522990803678
206
+ name: Cosine Accuracy@3
207
+ - type: cosine_accuracy@5
208
+ value: 0.9016393442622951
209
+ name: Cosine Accuracy@5
210
+ - type: cosine_accuracy@10
211
+ value: 0.9412235105957617
212
+ name: Cosine Accuracy@10
213
+ - type: cosine_precision@1
214
+ value: 0.7153138744502199
215
+ name: Cosine Precision@1
216
+ - type: cosine_precision@3
217
+ value: 0.2897507663601226
218
+ name: Cosine Precision@3
219
+ - type: cosine_precision@5
220
+ value: 0.18032786885245902
221
+ name: Cosine Precision@5
222
+ - type: cosine_precision@10
223
+ value: 0.09412235105957616
224
+ name: Cosine Precision@10
225
+ - type: cosine_recall@1
226
+ value: 0.7153138744502199
227
+ name: Cosine Recall@1
228
+ - type: cosine_recall@3
229
+ value: 0.8692522990803678
230
+ name: Cosine Recall@3
231
+ - type: cosine_recall@5
232
+ value: 0.9016393442622951
233
+ name: Cosine Recall@5
234
+ - type: cosine_recall@10
235
+ value: 0.9412235105957617
236
+ name: Cosine Recall@10
237
+ - type: cosine_ndcg@10
238
+ value: 0.833440978290933
239
+ name: Cosine Ndcg@10
240
+ - type: cosine_mrr@10
241
+ value: 0.7984015917442536
242
+ name: Cosine Mrr@10
243
+ - type: cosine_map@100
244
+ value: 0.8004509036706192
245
+ name: Cosine Map@100
246
+ - task:
247
+ type: semantic-similarity
248
+ name: Semantic Similarity
249
+ dataset:
250
+ name: sts dev
251
+ type: sts-dev
252
+ metrics:
253
+ - type: pearson_cosine
254
+ value: 0.8576299147217115
255
+ name: Pearson Cosine
256
+ - type: spearman_cosine
257
+ value: 0.8550707245646871
258
+ name: Spearman Cosine
259
+ ---
260
+
261
+ # SentenceTransformer based on nickprock/multi-sentence-BERTino
262
+
263
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [nickprock/multi-sentence-BERTino](https://huggingface.co/nickprock/multi-sentence-BERTino) on the task_retrieval and [task_sts](https://huggingface.co/datasets/stsb_multi_mt) datasets. 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.
264
+
265
+ ## Model Details
266
+
267
+ ### Model Description
268
+ - **Model Type:** Sentence Transformer
269
+ - **Base model:** [nickprock/multi-sentence-BERTino](https://huggingface.co/nickprock/multi-sentence-BERTino) <!-- at revision 23e88926f07dc8503737df806ea1c8d28f2b6ba6 -->
270
+ - **Maximum Sequence Length:** 512 tokens
271
+ - **Output Dimensionality:** 768 dimensions
272
+ - **Similarity Function:** Cosine Similarity
273
+ - **Training Datasets:**
274
+ - task_retrieval
275
+ - [task_sts](https://huggingface.co/datasets/stsb_multi_mt)
276
+ - **Languages:** de, en, es, fr, it, nl, pl, pt, ru, zh
277
+ <!-- - **License:** Unknown -->
278
+
279
+ ### Model Sources
280
+
281
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
282
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
283
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
284
+
285
+ ### Full Model Architecture
286
+
287
+ ```
288
+ SentenceTransformer(
289
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'DistilBertModel'})
290
+ (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})
291
+ )
292
+ ```
293
+
294
+ ## Usage
295
+
296
+ ### Direct Usage (Sentence Transformers)
297
+
298
+ First install the Sentence Transformers library:
299
+
300
+ ```bash
301
+ pip install -U sentence-transformers
302
+ ```
303
+
304
+ Then you can load this model and run inference.
305
+ ```python
306
+ from sentence_transformers import SentenceTransformer
307
+
308
+ # Download from the 🤗 Hub
309
+ model = SentenceTransformer("nickprock/multi-sentence-BERTino")
310
+ # Run inference
311
+ sentences = [
312
+ 'Importanza storica delle partite ufficiali per i giocatori di calcio',
313
+ 'Carriera\n\nClub\nKortgaard vestì la maglia del Mjøndalen.\n\nNazionale\nConta 4 presenze per la . Debuttò il 19 maggio 1983, nel pareggio per 2-2 contro la .',
314
+ "100050 Carloshernandez è un asteroide della fascia principale. Scoperto nel 1991, presenta un'orbita caratterizzata da un semiasse maggiore pari a 2,5991503\xa0UA e da un'eccentricità di 0,2144518, inclinata di 1,67744° rispetto all'eclittica.\n\nL'asteroide è stato dedicato dallo scopritore al nipote Carlos R. Hernandez.",
315
+ ]
316
+ embeddings = model.encode(sentences)
317
+ print(embeddings.shape)
318
+ # [3, 768]
319
+
320
+ # Get the similarity scores for the embeddings
321
+ similarities = model.similarity(embeddings, embeddings)
322
+ print(similarities)
323
+ # tensor([[ 1.0000, 0.3790, 0.0013],
324
+ # [ 0.3790, 1.0000, -0.0093],
325
+ # [ 0.0013, -0.0093, 1.0000]])
326
+ ```
327
+
328
+ <!--
329
+ ### Direct Usage (Transformers)
330
+
331
+ <details><summary>Click to see the direct usage in Transformers</summary>
332
+
333
+ </details>
334
+ -->
335
+
336
+ <!--
337
+ ### Downstream Usage (Sentence Transformers)
338
+
339
+ You can finetune this model on your own dataset.
340
+
341
+ <details><summary>Click to expand</summary>
342
+
343
+ </details>
344
+ -->
345
+
346
+ <!--
347
+ ### Out-of-Scope Use
348
+
349
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
350
+ -->
351
+
352
+ ## Evaluation
353
+
354
+ ### Metrics
355
+
356
+ #### Information Retrieval
357
+
358
+ * Dataset: `retrieval-768d`
359
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator) with these parameters:
360
+ ```json
361
+ {
362
+ "truncate_dim": 768
363
+ }
364
+ ```
365
+
366
+ | Metric | Value |
367
+ |:--------------------|:----------|
368
+ | cosine_accuracy@1 | 0.7653 |
369
+ | cosine_accuracy@3 | 0.9052 |
370
+ | cosine_accuracy@5 | 0.9384 |
371
+ | cosine_accuracy@10 | 0.9616 |
372
+ | cosine_precision@1 | 0.7653 |
373
+ | cosine_precision@3 | 0.3017 |
374
+ | cosine_precision@5 | 0.1877 |
375
+ | cosine_precision@10 | 0.0962 |
376
+ | cosine_recall@1 | 0.7653 |
377
+ | cosine_recall@3 | 0.9052 |
378
+ | cosine_recall@5 | 0.9384 |
379
+ | cosine_recall@10 | 0.9616 |
380
+ | **cosine_ndcg@10** | **0.871** |
381
+ | cosine_mrr@10 | 0.8411 |
382
+ | cosine_map@100 | 0.8427 |
383
+
384
+ #### Information Retrieval
385
+
386
+ * Dataset: `retrieval-128d`
387
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator) with these parameters:
388
+ ```json
389
+ {
390
+ "truncate_dim": 128
391
+ }
392
+ ```
393
+
394
+ | Metric | Value |
395
+ |:--------------------|:-----------|
396
+ | cosine_accuracy@1 | 0.7153 |
397
+ | cosine_accuracy@3 | 0.8693 |
398
+ | cosine_accuracy@5 | 0.9016 |
399
+ | cosine_accuracy@10 | 0.9412 |
400
+ | cosine_precision@1 | 0.7153 |
401
+ | cosine_precision@3 | 0.2898 |
402
+ | cosine_precision@5 | 0.1803 |
403
+ | cosine_precision@10 | 0.0941 |
404
+ | cosine_recall@1 | 0.7153 |
405
+ | cosine_recall@3 | 0.8693 |
406
+ | cosine_recall@5 | 0.9016 |
407
+ | cosine_recall@10 | 0.9412 |
408
+ | **cosine_ndcg@10** | **0.8334** |
409
+ | cosine_mrr@10 | 0.7984 |
410
+ | cosine_map@100 | 0.8005 |
411
+
412
+ #### Semantic Similarity
413
+
414
+ * Dataset: `sts-dev`
415
+ * Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
416
+
417
+ | Metric | Value |
418
+ |:--------------------|:-----------|
419
+ | pearson_cosine | 0.8576 |
420
+ | **spearman_cosine** | **0.8551** |
421
+
422
+ <!--
423
+ ## Bias, Risks and Limitations
424
+
425
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
426
+ -->
427
+
428
+ <!--
429
+ ### Recommendations
430
+
431
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
432
+ -->
433
+
434
+ ## Training Details
435
+
436
+ ### Training Datasets
437
+
438
+ #### task_retrieval
439
+
440
+ * Dataset: task_retrieval
441
+ * Size: 45,000 training samples
442
+ * Columns: <code>anchor</code>, <code>positive</code>, and <code>hard_negatives</code>
443
+ * Approximate statistics based on the first 1000 samples:
444
+ | | anchor | positive | hard_negatives |
445
+ |:--------|:----------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|:-----------------------------------|
446
+ | type | string | string | list |
447
+ | details | <ul><li>min: 9 tokens</li><li>mean: 18.51 tokens</li><li>max: 37 tokens</li></ul> | <ul><li>min: 21 tokens</li><li>mean: 103.48 tokens</li><li>max: 230 tokens</li></ul> | <ul><li>size: 2 elements</li></ul> |
448
+ * Samples:
449
+ | anchor | positive | hard_negatives |
450
+ |:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
451
+ | <code>Quale era l'origine di Criterion Games nel suo primo periodo di attività?</code> | <code>Criterion Games (ufficialmente Criterion Software) è una software house britannica fondata nel febbraio 1993. È situata a Guildford, nella contea di Surrey, in Inghilterra. Criterion è divenuta famosa per videogiochi di guida in stile arcade, come Burnout e Need for Speed, e per l'FPS di successo Black.<br><br>Storia <br>Criterion Software Ltd. è nata per commercializzare RenderWare, una API 3D per videogames. Inizialmente Criterion Games era una divisione di Criterion Software, creata per sviluppare giochi, utilizzando RenderWare, il motore grafico sviluppato dalla stessa software house.</code> | <code>['In Your House 10: Mind Games è stato un evento prodotto dalla World Wrestling Federation e si è svolto il 22 settembre 1996 al CoreStates Center di Filadelfia.', 'Il Clubino (talvolta anche definito "Clubino Dadi") è un club per gentiluomini di Milano.\n\nStoria\nIl circolo fu fondato nel 1901 come "New Club", italianizzato in Nuovo Circolo, poi diventato Clubino, da una scissione del Circolo dell\'Unione antico ritrovo dell\'aristocrazia e della borghesia milanese.\n\nIl circolo è stato fortemente voluto dalla classe dirigente milanese. I principali promotori del sodalizio furono l\'ingegner Giulio Ceretti, il cavalier Gerardo Maino e l\'ingegner Carlo Vogel.\n\nEbbe sede nel suo primo anno di vita presso la ex Fiaschetteria Toscana in Via Berchet.']</code> |
452
+ | <code>In quale anno Benjamin ha iniziato a esibirsi nelle strade e nelle piazze europee?</code> | <code>Biografia <br>Benjamin nasce nelle vicinanze di Melbourne, Australia e dopo aver avuto le sue prime esperienze musicali come musicista e cantante per una band locale chiamata Twitch all'età di diciannove anni decide di trasferirsi in Europa.<br><br>A soli ventidue anni si intromette nella scena musicale girando per le strade e per le piazze delle città europee con un nuovo tipo di musica.</code> | <code>['Attualmente vive a Los Angeles, California.\n\nBiografia \nHa iniziato a produrre musica nel 2006. A partire dal 2011, grazie a una delle sue tracce più famose, The End, viene notato da personaggi di spicco della musica elettronica, quali Tiësto, David Guetta, Swedish House Mafia, Afrojack e Laidback Luke.\n\nPrima di The End, aveva lanciato sul mercato nel 2010 All My Friends , con le voci di Tom Piper e Mr. Wilson, proprio quest\'ultimo aveva già prestato la sua voce per un\'altra suo brano, Need Me to Stay, canzone nominata "Best Dance Record" (Migliore Canzone Dance) agli ARIA Awards nel 2009.', "Biografia\nConobbe la notorietà nei primi anni cinquanta suonando il sax contralto e il flauto nella Innovations in Modern Music Orchestra di Stan Kenton, e durante quel decennio lavorò in piccole formazioni jazz. Negli anni sessanta fu a Hollywood come musicista di studio e per la World-Pacific. Nel 1961 esce l'album Brazilliance, Laurindo Almeida Featuring Bud Shank, nel 1962 l'album Brazilliance Vol. 2 - Bud Shank Featuring Laurindo Almeida e nel 1963 l'album Brazilliance Vol. 3, Bud Shank Featuring Laurindo Almeida; negli anni settanta suonò regolarmente con i L.A."]</code> |
453
+ | <code>Cosa accade nella trama di un allenatore di fantini dopo la morte del suo allievo migliore in un film drammatico ambientato nel mondo delle corse dei cavalli?</code> | <code>La vita che sognava (Boots Malone) è un film statunitense del 1952 diretto da William Dieterle.<br><br>È un film drammatico a sfondo sportivo (ambientato nel mondo delle corse dei cavalli) con protagonisti William Holden, Stanley Clements e Basil Ruysdael.<br><br>Trama <br>"Boots" Malone è un allenatore di fantini in cattive condizioni economiche dopo la morte del suo migliore allievo. Fuori a cena con il suo amico Stash, una sera nota un ragazzino che pretende di pagare la sua cena con un biglietto da 100 dollari. Il ragazzo è Thomas Gibson, detto "the Kid", scappato dal collegio per la passione dei cavalli e delle corse.</code> | <code>["Dragon Trainer (How to Train Your Dragon) è un franchise prodotto dalla DreamWorks Animation che consiste in tre lungometraggi: Dragon Trainer (2010), Dragon Trainer 2 (2014) e Dragon Trainer - Il mondo nascosto (2019) e ispirato alla omonima serie di libri della scrittrice Cressida Cowell; comprende anche cinque cortometraggi: La leggenda del drago Rubaossa (2010), Il libro dei draghi (2011), Il dono della Furia Buia (2011), L'inizio delle corse dei draghi (2014) e Dragon Trainer - Rimpatriata (2019) e una serie televisiva in sei stagioni che segue gli eventi del primo film, Dragons, prodotta dal 2012 al 2018.", 'Noto principalmente per il ruolo del detective Lionel Fusco nella serie televisiva Person of Interest.\n\nBiografia \nDurante la sua carriera Kevin Chapman è apparso in numerose produzioni sia cinematografiche che televisive.\n\nPer quanto riguarda il cinema lo si può vedere nei film The Boondock Saints - Giustizia finale (1999), Le regole della casa del sidro (1999), Mystic River (2003), 21 grammi (2003), In Good Company (2004), Squadra 49 (2004) e più recentemente in Unstoppable - Fuori controllo di Tony Scott (2010).']</code> |
454
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
455
+ ```json
456
+ {
457
+ "loss": "CachedMultipleNegativesRankingLoss",
458
+ "matryoshka_dims": [
459
+ 768,
460
+ 512,
461
+ 256,
462
+ 128
463
+ ],
464
+ "matryoshka_weights": [
465
+ 1.0,
466
+ 0.4,
467
+ 0.2,
468
+ 0.2
469
+ ],
470
+ "n_dims_per_step": -1
471
+ }
472
+ ```
473
+
474
+ #### task_sts
475
+
476
+ * Dataset: [task_sts](https://huggingface.co/datasets/stsb_multi_mt) at [3acaa3d](https://huggingface.co/datasets/stsb_multi_mt/tree/3acaa3dd8c91649e0b8e627ffad891f059e47c8c)
477
+ * Size: 45,992 training samples
478
+ * Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>score</code>
479
+ * Approximate statistics based on the first 1000 samples:
480
+ | | sentence1 | sentence2 | score |
481
+ |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|
482
+ | type | string | string | float |
483
+ | details | <ul><li>min: 6 tokens</li><li>mean: 10.85 tokens</li><li>max: 28 tokens</li></ul> | <ul><li>min: 7 tokens</li><li>mean: 10.86 tokens</li><li>max: 23 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.45</li><li>max: 1.0</li></ul> |
484
+ * Samples:
485
+ | sentence1 | sentence2 | score |
486
+ |:--------------------------------------------------------------------------|:------------------------------------------------------------------------------------|:--------------------------------|
487
+ | <code>Un aereo sta decollando.</code> | <code>Un aereo sta decollando.</code> | <code>1.0</code> |
488
+ | <code>Un uomo sta suonando un grande flauto.</code> | <code>Un uomo sta suonando un flauto.</code> | <code>0.7599999904632568</code> |
489
+ | <code>Un uomo sta spalmando del formaggio a pezzetti su una pizza.</code> | <code>Un uomo sta spalmando del formaggio a pezzetti su una pizza non cotta.</code> | <code>0.7599999904632568</code> |
490
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
491
+ ```json
492
+ {
493
+ "loss": "CoSENTLoss",
494
+ "matryoshka_dims": [
495
+ 768,
496
+ 512,
497
+ 256,
498
+ 128
499
+ ],
500
+ "matryoshka_weights": [
501
+ 1.0,
502
+ 0.4,
503
+ 0.2,
504
+ 0.2
505
+ ],
506
+ "n_dims_per_step": -1
507
+ }
508
+ ```
509
+
510
+ ### Evaluation Datasets
511
+
512
+ #### task_retrieval
513
+
514
+ * Dataset: task_retrieval
515
+ * Size: 2,501 evaluation samples
516
+ * Columns: <code>anchor</code>, <code>positive</code>, and <code>hard_negatives</code>
517
+ * Approximate statistics based on the first 1000 samples:
518
+ | | anchor | positive | hard_negatives |
519
+ |:--------|:-----------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|:-----------------------------------|
520
+ | type | string | string | list |
521
+ | details | <ul><li>min: 9 tokens</li><li>mean: 19.03 tokens</li><li>max: 193 tokens</li></ul> | <ul><li>min: 24 tokens</li><li>mean: 101.02 tokens</li><li>max: 218 tokens</li></ul> | <ul><li>size: 2 elements</li></ul> |
522
+ * Samples:
523
+ | anchor | positive | hard_negatives |
524
+ |:------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
525
+ | <code>Quali popoli nomadi hanno costruito imperi attraversando l'Europa occidentale dalla steppa asiatica?</code> | <code>La storia della Mongolia si identifica in gran parte con la storia dei popoli nomadi che hanno popolato la steppa dell'Asia centrale.<br><br>Alle sorgenti del fiume Amur che funge da frontiera tra la Cina e la Russia, la Mongolia è il cuore della steppa dell'Asia centrale ed è stata spesso il punto di partenza di temibili guerrieri che, allorquando hanno saputo federare le loro tribù di allevatori nomadi, sono riusciti a costruirsi degli imperi dilagando con i loro archi e i loro piccoli cavalli fino al sud della Cina e dell'India, e perfino in Europa occidentale (Unni di Attila, Bulgari, Avari, Ungari inquadrati dall'aristocrazia unica).</code> | <code>["La colonizzazione di Europa, quarto satellite di Giove per dimensioni, è stata oggetto di ipotesi sia nella fantascienza, sia nell'ambito della scienza. Le caratteristiche geofisiche di Europa, quali il probabile oceano di acqua sotto la crosta ghiacciata, potrebbero permettere la sopravvivenza di esseri umani sopra o sotto la superficie.\n\nFattibilità \nEuropa presenterebbe diversi vantaggi se fosse selezionata quale obiettivo per una possibile colonizzazione umana dello spazio rispetto ad altri corpi del sistema solare esterno, ma non sarebbe priva di problematiche.", 'Le biblioteche del Vicino Oriente antico servirono come archivi delle città-stato e degli imperi, santuari di sacre scritture e depositi di letteratura e cronache. Fu infatti in Egitto e Mesopotamia, terre abbondantemente bagnate da grandi fiumi, che nacque la civiltà e fu là che sorsero i primi esempi di uno degli aspetti principali della civiltà: la scrittura - incisa su tavolette di argilla che datano prima del 3000 a.C., scoperte tra i resti archeologici dei Sumeri, un popolo creativo che si stabilì nella Mesopotamia meridionale.']</code> |
526
+ | <code>Quali sono le caratteristiche del torneo ATP Challenger Tour?</code> | <code>L'Orbetello Challenger 2012 è stato un torneo professionistico di tennis giocato sul cemento. È stata la 4ª edizione del torneo che fa parte dell'ATP Challenger Tour nell'ambito dell'ATP Challenger Tour 2012. Si è giocato ad Orbetello in Italia dal 23 al 29 luglio 2012.<br><br>Partecipanti<br><br>Teste di serie<br><br> Ranking al 16 luglio 2012.</code> | <code>["L'ATP Challenger Trophy 2007 è stato un torneo di tennis facente parte della categoria ATP Challenger Series nell'ambito dell'ATP Challenger Series 2007. Il torneo si è giocato a Trnava in Slovacchia dal 24 al 30 settembre 2007 su campi in terra rossa.", "Il singolare dell'ATP Challenger Trophy 2012 è stato un torneo di tennis facente parte dell'ATP Challenger Tour 2012.\n\nIñigo Cervantes-Huegun era il detentrice del titolo, ma quest'anno non ha partecipato.\n\nAndrej Kuznecov ha battuto in finale Adrian Ungur 6–3, 6–3."]</code> |
527
+ | <code>Quali sono i dettagli sul comune di Bartošovice in Repubblica Ceca?</code> | <code>Bartošovice (in tedesco Partschendorf) è un comune della Repubblica Ceca facente parte del distretto di Nový Jičín, nella regione della Moravia-Slesia.</code> | <code>['Malé Svatoňovice è un comune della Repubblica Ceca facente parte del distretto di Trutnov, nella regione di Hradec Králové.\n\nSport\n\nCorsa in montagna \nMalé Svatoňovice ha ospitato i Campionati del mondo di corsa in montagna nel 1997.', 'Petřvald (in tedesco Gross Peterswald) è un comune della Repubblica Ceca facente parte del distretto di Nový Jičín, nella regione della Moravia-Slesia.']</code> |
528
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
529
+ ```json
530
+ {
531
+ "loss": "CachedMultipleNegativesRankingLoss",
532
+ "matryoshka_dims": [
533
+ 768,
534
+ 512,
535
+ 256,
536
+ 128
537
+ ],
538
+ "matryoshka_weights": [
539
+ 1.0,
540
+ 0.4,
541
+ 0.2,
542
+ 0.2
543
+ ],
544
+ "n_dims_per_step": -1
545
+ }
546
+ ```
547
+
548
+ #### task_sts
549
+
550
+ * Dataset: [task_sts](https://huggingface.co/datasets/stsb_multi_mt) at [3acaa3d](https://huggingface.co/datasets/stsb_multi_mt/tree/3acaa3dd8c91649e0b8e627ffad891f059e47c8c)
551
+ * Size: 1,500 evaluation samples
552
+ * Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>score</code>
553
+ * Approximate statistics based on the first 1000 samples:
554
+ | | sentence1 | sentence2 | score |
555
+ |:--------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|
556
+ | type | string | string | float |
557
+ | details | <ul><li>min: 5 tokens</li><li>mean: 16.1 tokens</li><li>max: 45 tokens</li></ul> | <ul><li>min: 7 tokens</li><li>mean: 16.14 tokens</li><li>max: 57 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.42</li><li>max: 1.0</li></ul> |
558
+ * Samples:
559
+ | sentence1 | sentence2 | score |
560
+ |:------------------------------------------------------------------|:---------------------------------------------------------------|:------------------|
561
+ | <code>Un uomo con l'elmetto sta ballando.</code> | <code>Un uomo che indossa un elmetto sta ballando.</code> | <code>1.0</code> |
562
+ | <code>Un bambino piccolo sta cavalcando un cavallo.</code> | <code>Un bambino sta cavalcando un cavallo.</code> | <code>0.95</code> |
563
+ | <code>Un uomo sta dando da mangiare un topo a un serpente.</code> | <code>L'uomo sta dando da mangiare un topo al serpente.</code> | <code>1.0</code> |
564
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
565
+ ```json
566
+ {
567
+ "loss": "CoSENTLoss",
568
+ "matryoshka_dims": [
569
+ 768,
570
+ 512,
571
+ 256,
572
+ 128
573
+ ],
574
+ "matryoshka_weights": [
575
+ 1.0,
576
+ 0.4,
577
+ 0.2,
578
+ 0.2
579
+ ],
580
+ "n_dims_per_step": -1
581
+ }
582
+ ```
583
+
584
+ ### Training Hyperparameters
585
+ #### Non-Default Hyperparameters
586
+
587
+ - `per_device_train_batch_size`: 128
588
+ - `num_train_epochs`: 4
589
+ - `learning_rate`: 1e-05
590
+ - `lr_scheduler_type`: cosine
591
+ - `warmup_steps`: 0.1
592
+ - `weight_decay`: 0.01
593
+ - `fp16`: True
594
+ - `eval_strategy`: steps
595
+ - `per_device_eval_batch_size`: 32
596
+ - `load_best_model_at_end`: True
597
+ - `batch_sampler`: no_duplicates
598
+
599
+ #### All Hyperparameters
600
+ <details><summary>Click to expand</summary>
601
+
602
+ - `per_device_train_batch_size`: 128
603
+ - `num_train_epochs`: 4
604
+ - `max_steps`: -1
605
+ - `learning_rate`: 1e-05
606
+ - `lr_scheduler_type`: cosine
607
+ - `lr_scheduler_kwargs`: None
608
+ - `warmup_steps`: 0.1
609
+ - `optim`: adamw_torch_fused
610
+ - `optim_args`: None
611
+ - `weight_decay`: 0.01
612
+ - `adam_beta1`: 0.9
613
+ - `adam_beta2`: 0.999
614
+ - `adam_epsilon`: 1e-08
615
+ - `optim_target_modules`: None
616
+ - `gradient_accumulation_steps`: 1
617
+ - `average_tokens_across_devices`: True
618
+ - `max_grad_norm`: 1.0
619
+ - `label_smoothing_factor`: 0.0
620
+ - `bf16`: False
621
+ - `fp16`: True
622
+ - `bf16_full_eval`: False
623
+ - `fp16_full_eval`: False
624
+ - `tf32`: None
625
+ - `gradient_checkpointing`: False
626
+ - `gradient_checkpointing_kwargs`: None
627
+ - `torch_compile`: False
628
+ - `torch_compile_backend`: None
629
+ - `torch_compile_mode`: None
630
+ - `use_liger_kernel`: False
631
+ - `liger_kernel_config`: None
632
+ - `use_cache`: False
633
+ - `neftune_noise_alpha`: None
634
+ - `torch_empty_cache_steps`: None
635
+ - `auto_find_batch_size`: False
636
+ - `log_on_each_node`: True
637
+ - `logging_nan_inf_filter`: True
638
+ - `include_num_input_tokens_seen`: no
639
+ - `log_level`: passive
640
+ - `log_level_replica`: warning
641
+ - `disable_tqdm`: False
642
+ - `project`: huggingface
643
+ - `trackio_space_id`: trackio
644
+ - `eval_strategy`: steps
645
+ - `per_device_eval_batch_size`: 32
646
+ - `prediction_loss_only`: True
647
+ - `eval_on_start`: False
648
+ - `eval_do_concat_batches`: True
649
+ - `eval_use_gather_object`: False
650
+ - `eval_accumulation_steps`: None
651
+ - `include_for_metrics`: []
652
+ - `batch_eval_metrics`: False
653
+ - `save_only_model`: False
654
+ - `save_on_each_node`: False
655
+ - `enable_jit_checkpoint`: False
656
+ - `push_to_hub`: False
657
+ - `hub_private_repo`: None
658
+ - `hub_model_id`: None
659
+ - `hub_strategy`: every_save
660
+ - `hub_always_push`: False
661
+ - `hub_revision`: None
662
+ - `load_best_model_at_end`: True
663
+ - `ignore_data_skip`: False
664
+ - `restore_callback_states_from_checkpoint`: False
665
+ - `full_determinism`: False
666
+ - `seed`: 42
667
+ - `data_seed`: None
668
+ - `use_cpu`: False
669
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
670
+ - `parallelism_config`: None
671
+ - `dataloader_drop_last`: False
672
+ - `dataloader_num_workers`: 0
673
+ - `dataloader_pin_memory`: True
674
+ - `dataloader_persistent_workers`: False
675
+ - `dataloader_prefetch_factor`: None
676
+ - `remove_unused_columns`: True
677
+ - `label_names`: None
678
+ - `train_sampling_strategy`: random
679
+ - `length_column_name`: length
680
+ - `ddp_find_unused_parameters`: None
681
+ - `ddp_bucket_cap_mb`: None
682
+ - `ddp_broadcast_buffers`: False
683
+ - `ddp_backend`: None
684
+ - `ddp_timeout`: 1800
685
+ - `fsdp`: []
686
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
687
+ - `deepspeed`: None
688
+ - `debug`: []
689
+ - `skip_memory_metrics`: True
690
+ - `do_predict`: False
691
+ - `resume_from_checkpoint`: None
692
+ - `warmup_ratio`: None
693
+ - `local_rank`: -1
694
+ - `prompts`: None
695
+ - `batch_sampler`: no_duplicates
696
+ - `multi_dataset_batch_sampler`: proportional
697
+ - `router_mapping`: {}
698
+ - `learning_rate_mapping`: {}
699
+
700
+ </details>
701
+
702
+ ### Training Logs
703
+ | Epoch | Step | Training Loss | task retrieval loss | task sts loss | retrieval-768d_cosine_ndcg@10 | retrieval-128d_cosine_ndcg@10 | sts-dev_spearman_cosine |
704
+ |:----------:|:-------:|:-------------:|:-------------------:|:-------------:|:-----------------------------:|:-----------------------------:|:-----------------------:|
705
+ | 0.0702 | 50 | 7.7958 | - | - | - | - | - |
706
+ | 0.1404 | 100 | 4.5273 | - | - | - | - | - |
707
+ | 0.2107 | 150 | 8.7004 | - | - | - | - | - |
708
+ | 0.2809 | 200 | 5.6620 | - | - | - | - | - |
709
+ | **0.3511** | **250** | **7.3535** | **0.0642** | **18.3673** | **0.871** | **0.8334** | **0.854** |
710
+ | 0.4213 | 300 | 6.3456 | - | - | - | - | - |
711
+ | 0.4916 | 350 | 6.5450 | - | - | - | - | - |
712
+ | 0.5618 | 400 | 8.1323 | - | - | - | - | - |
713
+ | 0.6320 | 450 | 6.1999 | - | - | - | - | - |
714
+ | 0.7022 | 500 | 5.9058 | 0.0577 | 18.5753 | 0.8682 | 0.8372 | 0.8538 |
715
+ | 0.7725 | 550 | 6.4255 | - | - | - | - | - |
716
+ | 0.8427 | 600 | 6.7009 | - | - | - | - | - |
717
+ | 0.9129 | 650 | 6.3682 | - | - | - | - | - |
718
+ | 0.9831 | 700 | 7.1500 | - | - | - | - | - |
719
+ | 1.0534 | 750 | 6.7907 | 0.0550 | 18.5580 | 0.8681 | 0.8333 | 0.8552 |
720
+ | 1.1236 | 800 | 5.2997 | - | - | - | - | - |
721
+ | 1.1938 | 850 | 6.0822 | - | - | - | - | - |
722
+ | 1.2640 | 900 | 6.5435 | - | - | - | - | - |
723
+ | 1.3343 | 950 | 7.0916 | - | - | - | - | - |
724
+ | 1.4045 | 1000 | 5.9986 | 0.0554 | 18.7416 | 0.8671 | 0.8354 | 0.8550 |
725
+ | 1.4747 | 1050 | 5.5105 | - | - | - | - | - |
726
+ | 1.5449 | 1100 | 7.5051 | - | - | - | - | - |
727
+ | 1.6152 | 1150 | 7.0109 | - | - | - | - | - |
728
+ | 1.6854 | 1200 | 5.2789 | - | - | - | - | - |
729
+ | 1.7556 | 1250 | 6.0140 | 0.0540 | 18.7505 | 0.8692 | 0.8387 | 0.8549 |
730
+ | 1.8258 | 1300 | 6.2669 | - | - | - | - | - |
731
+ | 1.8961 | 1350 | 6.2215 | - | - | - | - | - |
732
+ | 1.9663 | 1400 | 7.6712 | - | - | - | - | - |
733
+ | 2.0365 | 1450 | 6.1573 | - | - | - | - | - |
734
+ | 2.1067 | 1500 | 6.4583 | 0.0542 | 18.8299 | 0.8653 | 0.8359 | 0.8555 |
735
+ | 2.1770 | 1550 | 7.1814 | - | - | - | - | - |
736
+ | 2.2472 | 1600 | 5.9135 | - | - | - | - | - |
737
+ | 2.3174 | 1650 | 6.2025 | - | - | - | - | - |
738
+ | 2.3876 | 1700 | 4.9456 | - | - | - | - | - |
739
+ | 2.4579 | 1750 | 6.1588 | 0.0547 | 18.9144 | 0.8650 | 0.8357 | 0.8551 |
740
+ | 2.5281 | 1800 | 7.6150 | - | - | - | - | - |
741
+ | 2.5983 | 1850 | 6.2019 | - | - | - | - | - |
742
+ | 2.6685 | 1900 | 5.9106 | - | - | - | - | - |
743
+ | 2.7388 | 1950 | 5.4257 | - | - | - | - | - |
744
+ | 2.8090 | 2000 | 5.6597 | 0.0523 | 19.0004 | 0.8657 | 0.8361 | 0.8546 |
745
+ | 2.8792 | 2050 | 5.9472 | - | - | - | - | - |
746
+ | 2.9494 | 2100 | 5.6624 | - | - | - | - | - |
747
+ | 3.0197 | 2150 | 7.7736 | - | - | - | - | - |
748
+ | 3.0899 | 2200 | 6.6527 | - | - | - | - | - |
749
+ | 3.1601 | 2250 | 5.9107 | 0.0531 | 18.9516 | 0.8664 | 0.8373 | 0.8551 |
750
+ | 3.2303 | 2300 | 6.1335 | - | - | - | - | - |
751
+ | 3.3006 | 2350 | 5.4157 | - | - | - | - | - |
752
+ | 3.3708 | 2400 | 7.3402 | - | - | - | - | - |
753
+ | 3.4410 | 2450 | 4.6722 | - | - | - | - | - |
754
+ | 3.5112 | 2500 | 7.1186 | 0.0530 | 18.9883 | 0.8652 | 0.8356 | 0.8551 |
755
+ | 3.5815 | 2550 | 6.3746 | - | - | - | - | - |
756
+ | 3.6517 | 2600 | 3.9370 | - | - | - | - | - |
757
+ | 3.7219 | 2650 | 8.1087 | - | - | - | - | - |
758
+ | 3.7921 | 2700 | 4.8976 | - | - | - | - | - |
759
+ | 3.8624 | 2750 | 6.1367 | 0.0527 | 19.0004 | 0.8657 | 0.8372 | 0.8551 |
760
+ | 3.9326 | 2800 | 6.6133 | - | - | - | - | - |
761
+ | -1 | -1 | - | - | - | 0.8710 | 0.8334 | - |
762
+
763
+ * The bold row denotes the saved checkpoint.
764
+
765
+ ### Framework Versions
766
+ - Python: 3.10.19
767
+ - Sentence Transformers: 5.4.0.dev0
768
+ - Transformers: 5.3.0
769
+ - PyTorch: 2.10.0+cu128
770
+ - Accelerate: 1.13.0
771
+ - Datasets: 2.21.0
772
+ - Tokenizers: 0.22.2
773
+
774
+ ## Citation
775
+
776
+ ### BibTeX
777
+
778
+ #### Sentence Transformers
779
+ ```bibtex
780
+ @inproceedings{reimers-2019-sentence-bert,
781
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
782
+ author = "Reimers, Nils and Gurevych, Iryna",
783
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
784
+ month = "11",
785
+ year = "2019",
786
+ publisher = "Association for Computational Linguistics",
787
+ url = "https://arxiv.org/abs/1908.10084",
788
+ }
789
+ ```
790
+
791
+ #### MatryoshkaLoss
792
+ ```bibtex
793
+ @misc{kusupati2024matryoshka,
794
+ title={Matryoshka Representation Learning},
795
+ 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},
796
+ year={2024},
797
+ eprint={2205.13147},
798
+ archivePrefix={arXiv},
799
+ primaryClass={cs.LG}
800
+ }
801
+ ```
802
+
803
+ #### CachedMultipleNegativesRankingLoss
804
+ ```bibtex
805
+ @misc{gao2021scaling,
806
+ title={Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup},
807
+ author={Luyu Gao and Yunyi Zhang and Jiawei Han and Jamie Callan},
808
+ year={2021},
809
+ eprint={2101.06983},
810
+ archivePrefix={arXiv},
811
+ primaryClass={cs.LG}
812
+ }
813
+ ```
814
+
815
+ #### CoSENTLoss
816
+ ```bibtex
817
+ @article{10531646,
818
+ author={Huang, Xiang and Peng, Hao and Zou, Dongcheng and Liu, Zhiwei and Li, Jianxin and Liu, Kay and Wu, Jia and Su, Jianlin and Yu, Philip S.},
819
+ journal={IEEE/ACM Transactions on Audio, Speech, and Language Processing},
820
+ title={CoSENT: Consistent Sentence Embedding via Similarity Ranking},
821
+ year={2024},
822
+ doi={10.1109/TASLP.2024.3402087}
823
+ }
824
+ ```
825
+
826
+ <!--
827
+ ## Glossary
828
+
829
+ *Clearly define terms in order to be accessible across audiences.*
830
+ -->
831
+
832
+ <!--
833
+ ## Model Card Authors
834
+
835
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
836
+ -->
837
+
838
+ <!--
839
+ ## Model Card Contact
840
+
841
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
842
+ -->
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ac72b79996082b7418fd2130b23a3a86b40bd8afd3121fb727b01894e7db13f7
3
  size 270316376
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a0d90423b353949906bb4ce52f1da3786de0b1a65e94a37bc626f127153798a
3
  size 270316376
tokenizer_config.json CHANGED
@@ -5,7 +5,7 @@
5
  "do_basic_tokenize": true,
6
  "do_lower_case": true,
7
  "full_tokenizer_file": null,
8
- "is_local": true,
9
  "mask_token": "[MASK]",
10
  "max_len": 512,
11
  "max_length": 512,
 
5
  "do_basic_tokenize": true,
6
  "do_lower_case": true,
7
  "full_tokenizer_file": null,
8
+ "is_local": false,
9
  "mask_token": "[MASK]",
10
  "max_len": 512,
11
  "max_length": 512,