tomaarsen HF Staff commited on
Commit
d65f9ca
·
verified ·
1 Parent(s): 1eb7899

Add new SparseEncoder model

Browse files
README.md ADDED
@@ -0,0 +1,841 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: apache-2.0
5
+ tags:
6
+ - sentence-transformers
7
+ - sparse-encoder
8
+ - sparse
9
+ - asymmetric
10
+ - inference-free
11
+ - splade
12
+ - generated_from_trainer
13
+ - dataset_size:99000
14
+ - loss:SpladeLoss
15
+ - loss:SparseMultipleNegativesRankingLoss
16
+ - loss:FlopsLoss
17
+ widget:
18
+ - text: Rollin' (Limp Bizkit song) The music video was filmed atop the South Tower
19
+ of the former World Trade Center in New York City. The introduction features Ben
20
+ Stiller and Stephen Dorff mistaking Fred Durst for the valet and giving him the
21
+ keys to their Bentley Azure. Also making a cameo is break dancer Mr. Wiggles.
22
+ The rest of the video has several cuts to Durst and his bandmates hanging out
23
+ of the Bentley as they drive about Manhattan. The song Ben Stiller is playing
24
+ at the beginning is "My Generation" from the same album. The video also features
25
+ scenes of Fred Durst with five girls dancing in a room. The video was filmed around
26
+ the same time as the film Zoolander, which explains Stiller and Dorff's appearance.
27
+ Fred Durst has a small cameo in that film.
28
+ - text: 'Maze Runner: The Death Cure On April 22, 2017, the studio delayed the release
29
+ date once again, to February 9, 2018, in order to allow more time for post-production;
30
+ months later, on August 25, the studio moved the release forward two weeks.[17]
31
+ The film will premiere on January 26, 2018 in 3D, IMAX and IMAX 3D.[18][19]'
32
+ - text: who played the dj in the movie the warriors
33
+ - text: Lionel Messi Born and raised in central Argentina, Messi was diagnosed with
34
+ a growth hormone deficiency as a child. At age 13, he relocated to Spain to join
35
+ Barcelona, who agreed to pay for his medical treatment. After a fast progression
36
+ through Barcelona's youth academy, Messi made his competitive debut aged 17 in
37
+ October 2004. Despite being injury-prone during his early career, he established
38
+ himself as an integral player for the club within the next three years, finishing
39
+ 2007 as a finalist for both the Ballon d'Or and FIFA World Player of the Year
40
+ award, a feat he repeated the following year. His first uninterrupted campaign
41
+ came in the 2008–09 season, during which he helped Barcelona achieve the first
42
+ treble in Spanish football. At 22 years old, Messi won the Ballon d'Or and FIFA
43
+ World Player of the Year award by record voting margins.
44
+ - text: 'Send In the Clowns "Send In the Clowns" is a song written by Stephen Sondheim
45
+ for the 1973 musical A Little Night Music, an adaptation of Ingmar Bergman''s
46
+ film Smiles of a Summer Night. It is a ballad from Act Two, in which the character
47
+ Desirée reflects on the ironies and disappointments of her life. Among other things,
48
+ she looks back on an affair years earlier with the lawyer Fredrik, who was deeply
49
+ in love with her but whose marriage proposals she had rejected. Meeting him after
50
+ so long, she realizes she is in love with him and finally ready to marry him,
51
+ but now it is he who rejects her: he is in an unconsummated marriage with a much
52
+ younger woman. Desirée proposes marriage to rescue him from this situation, but
53
+ he declines, citing his dedication to his bride. Reacting to his rejection, Desirée
54
+ sings this song. The song is later reprised as a coda after Fredrik''s young wife
55
+ runs away with his son, and Fredrik is finally free to accept Desirée''s offer.[1]'
56
+ datasets:
57
+ - sentence-transformers/natural-questions
58
+ pipeline_tag: feature-extraction
59
+ library_name: sentence-transformers
60
+ metrics:
61
+ - dot_accuracy@1
62
+ - dot_accuracy@3
63
+ - dot_accuracy@5
64
+ - dot_accuracy@10
65
+ - dot_precision@1
66
+ - dot_precision@3
67
+ - dot_precision@5
68
+ - dot_precision@10
69
+ - dot_recall@1
70
+ - dot_recall@3
71
+ - dot_recall@5
72
+ - dot_recall@10
73
+ - dot_ndcg@10
74
+ - dot_mrr@10
75
+ - dot_map@100
76
+ - query_active_dims
77
+ - query_sparsity_ratio
78
+ - corpus_active_dims
79
+ - corpus_sparsity_ratio
80
+ co2_eq_emissions:
81
+ emissions: 63.662764436204725
82
+ energy_consumed: 0.16378296081883995
83
+ source: codecarbon
84
+ training_type: fine-tuning
85
+ on_cloud: false
86
+ cpu_model: 13th Gen Intel(R) Core(TM) i7-13700K
87
+ ram_total_size: 31.777088165283203
88
+ hours_used: 0.432
89
+ hardware_used: 1 x NVIDIA GeForce RTX 3090
90
+ model-index:
91
+ - name: Inference-free SPLADE bert-base-uncased trained on Natural-Questions tuples
92
+ results:
93
+ - task:
94
+ type: sparse-information-retrieval
95
+ name: Sparse Information Retrieval
96
+ dataset:
97
+ name: NanoMSMARCO
98
+ type: NanoMSMARCO
99
+ metrics:
100
+ - type: dot_accuracy@1
101
+ value: 0.24
102
+ name: Dot Accuracy@1
103
+ - type: dot_accuracy@3
104
+ value: 0.54
105
+ name: Dot Accuracy@3
106
+ - type: dot_accuracy@5
107
+ value: 0.68
108
+ name: Dot Accuracy@5
109
+ - type: dot_accuracy@10
110
+ value: 0.78
111
+ name: Dot Accuracy@10
112
+ - type: dot_precision@1
113
+ value: 0.24
114
+ name: Dot Precision@1
115
+ - type: dot_precision@3
116
+ value: 0.18
117
+ name: Dot Precision@3
118
+ - type: dot_precision@5
119
+ value: 0.136
120
+ name: Dot Precision@5
121
+ - type: dot_precision@10
122
+ value: 0.078
123
+ name: Dot Precision@10
124
+ - type: dot_recall@1
125
+ value: 0.24
126
+ name: Dot Recall@1
127
+ - type: dot_recall@3
128
+ value: 0.54
129
+ name: Dot Recall@3
130
+ - type: dot_recall@5
131
+ value: 0.68
132
+ name: Dot Recall@5
133
+ - type: dot_recall@10
134
+ value: 0.78
135
+ name: Dot Recall@10
136
+ - type: dot_ndcg@10
137
+ value: 0.5089651763164315
138
+ name: Dot Ndcg@10
139
+ - type: dot_mrr@10
140
+ value: 0.4219047619047619
141
+ name: Dot Mrr@10
142
+ - type: dot_map@100
143
+ value: 0.432147340250938
144
+ name: Dot Map@100
145
+ - type: query_active_dims
146
+ value: 7.21999979019165
147
+ name: Query Active Dims
148
+ - type: query_sparsity_ratio
149
+ value: 0.999763449322122
150
+ name: Query Sparsity Ratio
151
+ - type: corpus_active_dims
152
+ value: 64.50605010986328
153
+ name: Corpus Active Dims
154
+ - type: corpus_sparsity_ratio
155
+ value: 0.9978865719772668
156
+ name: Corpus Sparsity Ratio
157
+ - task:
158
+ type: sparse-information-retrieval
159
+ name: Sparse Information Retrieval
160
+ dataset:
161
+ name: NanoNFCorpus
162
+ type: NanoNFCorpus
163
+ metrics:
164
+ - type: dot_accuracy@1
165
+ value: 0.44
166
+ name: Dot Accuracy@1
167
+ - type: dot_accuracy@3
168
+ value: 0.54
169
+ name: Dot Accuracy@3
170
+ - type: dot_accuracy@5
171
+ value: 0.56
172
+ name: Dot Accuracy@5
173
+ - type: dot_accuracy@10
174
+ value: 0.58
175
+ name: Dot Accuracy@10
176
+ - type: dot_precision@1
177
+ value: 0.44
178
+ name: Dot Precision@1
179
+ - type: dot_precision@3
180
+ value: 0.3733333333333333
181
+ name: Dot Precision@3
182
+ - type: dot_precision@5
183
+ value: 0.324
184
+ name: Dot Precision@5
185
+ - type: dot_precision@10
186
+ value: 0.24599999999999997
187
+ name: Dot Precision@10
188
+ - type: dot_recall@1
189
+ value: 0.022479220566210704
190
+ name: Dot Recall@1
191
+ - type: dot_recall@3
192
+ value: 0.07612273703265512
193
+ name: Dot Recall@3
194
+ - type: dot_recall@5
195
+ value: 0.09256181151372667
196
+ name: Dot Recall@5
197
+ - type: dot_recall@10
198
+ value: 0.11369159268450002
199
+ name: Dot Recall@10
200
+ - type: dot_ndcg@10
201
+ value: 0.3093526962928894
202
+ name: Dot Ndcg@10
203
+ - type: dot_mrr@10
204
+ value: 0.4906666666666667
205
+ name: Dot Mrr@10
206
+ - type: dot_map@100
207
+ value: 0.12838279162115543
208
+ name: Dot Map@100
209
+ - type: query_active_dims
210
+ value: 5.659999847412109
211
+ name: Query Active Dims
212
+ - type: query_sparsity_ratio
213
+ value: 0.9998145599945151
214
+ name: Query Sparsity Ratio
215
+ - type: corpus_active_dims
216
+ value: 81.60819244384766
217
+ name: Corpus Active Dims
218
+ - type: corpus_sparsity_ratio
219
+ value: 0.9973262501656561
220
+ name: Corpus Sparsity Ratio
221
+ - task:
222
+ type: sparse-information-retrieval
223
+ name: Sparse Information Retrieval
224
+ dataset:
225
+ name: NanoNQ
226
+ type: NanoNQ
227
+ metrics:
228
+ - type: dot_accuracy@1
229
+ value: 0.38
230
+ name: Dot Accuracy@1
231
+ - type: dot_accuracy@3
232
+ value: 0.54
233
+ name: Dot Accuracy@3
234
+ - type: dot_accuracy@5
235
+ value: 0.62
236
+ name: Dot Accuracy@5
237
+ - type: dot_accuracy@10
238
+ value: 0.66
239
+ name: Dot Accuracy@10
240
+ - type: dot_precision@1
241
+ value: 0.38
242
+ name: Dot Precision@1
243
+ - type: dot_precision@3
244
+ value: 0.18
245
+ name: Dot Precision@3
246
+ - type: dot_precision@5
247
+ value: 0.128
248
+ name: Dot Precision@5
249
+ - type: dot_precision@10
250
+ value: 0.068
251
+ name: Dot Precision@10
252
+ - type: dot_recall@1
253
+ value: 0.38
254
+ name: Dot Recall@1
255
+ - type: dot_recall@3
256
+ value: 0.52
257
+ name: Dot Recall@3
258
+ - type: dot_recall@5
259
+ value: 0.61
260
+ name: Dot Recall@5
261
+ - type: dot_recall@10
262
+ value: 0.64
263
+ name: Dot Recall@10
264
+ - type: dot_ndcg@10
265
+ value: 0.5187972911837246
266
+ name: Dot Ndcg@10
267
+ - type: dot_mrr@10
268
+ value: 0.4807460317460317
269
+ name: Dot Mrr@10
270
+ - type: dot_map@100
271
+ value: 0.48967329128750314
272
+ name: Dot Map@100
273
+ - type: query_active_dims
274
+ value: 10.319999694824219
275
+ name: Query Active Dims
276
+ - type: query_sparsity_ratio
277
+ value: 0.9996618832417657
278
+ name: Query Sparsity Ratio
279
+ - type: corpus_active_dims
280
+ value: 53.484806060791016
281
+ name: Corpus Active Dims
282
+ - type: corpus_sparsity_ratio
283
+ value: 0.9982476637815088
284
+ name: Corpus Sparsity Ratio
285
+ - task:
286
+ type: sparse-nano-beir
287
+ name: Sparse Nano BEIR
288
+ dataset:
289
+ name: NanoBEIR mean
290
+ type: NanoBEIR_mean
291
+ metrics:
292
+ - type: dot_accuracy@1
293
+ value: 0.35333333333333333
294
+ name: Dot Accuracy@1
295
+ - type: dot_accuracy@3
296
+ value: 0.54
297
+ name: Dot Accuracy@3
298
+ - type: dot_accuracy@5
299
+ value: 0.6200000000000001
300
+ name: Dot Accuracy@5
301
+ - type: dot_accuracy@10
302
+ value: 0.6733333333333333
303
+ name: Dot Accuracy@10
304
+ - type: dot_precision@1
305
+ value: 0.35333333333333333
306
+ name: Dot Precision@1
307
+ - type: dot_precision@3
308
+ value: 0.24444444444444438
309
+ name: Dot Precision@3
310
+ - type: dot_precision@5
311
+ value: 0.19600000000000004
312
+ name: Dot Precision@5
313
+ - type: dot_precision@10
314
+ value: 0.13066666666666665
315
+ name: Dot Precision@10
316
+ - type: dot_recall@1
317
+ value: 0.21415974018873687
318
+ name: Dot Recall@1
319
+ - type: dot_recall@3
320
+ value: 0.3787075790108851
321
+ name: Dot Recall@3
322
+ - type: dot_recall@5
323
+ value: 0.4608539371712423
324
+ name: Dot Recall@5
325
+ - type: dot_recall@10
326
+ value: 0.5112305308948334
327
+ name: Dot Recall@10
328
+ - type: dot_ndcg@10
329
+ value: 0.4457050545976819
330
+ name: Dot Ndcg@10
331
+ - type: dot_mrr@10
332
+ value: 0.46443915343915343
333
+ name: Dot Mrr@10
334
+ - type: dot_map@100
335
+ value: 0.3500678077198655
336
+ name: Dot Map@100
337
+ - type: query_active_dims
338
+ value: 7.733333110809326
339
+ name: Query Active Dims
340
+ - type: query_sparsity_ratio
341
+ value: 0.999746630852801
342
+ name: Query Sparsity Ratio
343
+ - type: corpus_active_dims
344
+ value: 64.12316794619026
345
+ name: Corpus Active Dims
346
+ - type: corpus_sparsity_ratio
347
+ value: 0.9978991164423633
348
+ name: Corpus Sparsity Ratio
349
+ ---
350
+
351
+ # Inference-free SPLADE bert-base-uncased trained on Natural-Questions tuples
352
+
353
+ This is a [Asymmetric Inference-free SPLADE Sparse Encoder](https://www.sbert.net/docs/sparse_encoder/usage/usage.html) model trained on the [natural-questions](https://huggingface.co/datasets/sentence-transformers/natural-questions) dataset using the [sentence-transformers](https://www.SBERT.net) library. It maps sentences & paragraphs to a 30522-dimensional sparse vector space and can be used for semantic search and sparse retrieval.
354
+ ## Model Details
355
+
356
+ ### Model Description
357
+ - **Model Type:** Asymmetric Inference-free SPLADE Sparse Encoder
358
+ <!-- - **Base model:** [Unknown](https://huggingface.co/unknown) -->
359
+ - **Maximum Sequence Length:** 512 tokens
360
+ - **Output Dimensionality:** 30522 dimensions
361
+ - **Similarity Function:** Dot Product
362
+ - **Training Dataset:**
363
+ - [natural-questions](https://huggingface.co/datasets/sentence-transformers/natural-questions)
364
+ - **Language:** en
365
+ - **License:** apache-2.0
366
+
367
+ ### Model Sources
368
+
369
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
370
+ - **Documentation:** [Sparse Encoder Documentation](https://www.sbert.net/docs/sparse_encoder/usage/usage.html)
371
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
372
+ - **Hugging Face:** [Sparse Encoders on Hugging Face](https://huggingface.co/models?library=sentence-transformers&other=sparse-encoder)
373
+
374
+ ### Full Model Architecture
375
+
376
+ ```
377
+ SparseEncoder(
378
+ (0): Router(
379
+ (query_0_IDF): IDF ({'frozen': False}, dim:30522, tokenizer: BertTokenizerFast)
380
+ (document_0_MLMTransformer): MLMTransformer({'max_seq_length': 512, 'do_lower_case': False}) with MLMTransformer model: BertForMaskedLM
381
+ (document_1_SpladePooling): SpladePooling({'pooling_strategy': 'max', 'activation_function': 'relu', 'word_embedding_dimension': 30522})
382
+ )
383
+ )
384
+ ```
385
+
386
+ ## Usage
387
+
388
+ ### Direct Usage (Sentence Transformers)
389
+
390
+ First install the Sentence Transformers library:
391
+
392
+ ```bash
393
+ pip install -U sentence-transformers
394
+ ```
395
+
396
+ Then you can load this model and run inference.
397
+ ```python
398
+ from sentence_transformers import SparseEncoder
399
+
400
+ # Download from the 🤗 Hub
401
+ model = SparseEncoder("tomaarsen/inference-free-splade-bert-base-uncased-nq")
402
+ # Run inference
403
+ queries = [
404
+ "is send in the clowns from a musical",
405
+ ]
406
+ documents = [
407
+ 'Send In the Clowns "Send In the Clowns" is a song written by Stephen Sondheim for the 1973 musical A Little Night Music, an adaptation of Ingmar Bergman\'s film Smiles of a Summer Night. It is a ballad from Act Two, in which the character Desirée reflects on the ironies and disappointments of her life. Among other things, she looks back on an affair years earlier with the lawyer Fredrik, who was deeply in love with her but whose marriage proposals she had rejected. Meeting him after so long, she realizes she is in love with him and finally ready to marry him, but now it is he who rejects her: he is in an unconsummated marriage with a much younger woman. Desirée proposes marriage to rescue him from this situation, but he declines, citing his dedication to his bride. Reacting to his rejection, Desirée sings this song. The song is later reprised as a coda after Fredrik\'s young wife runs away with his son, and Fredrik is finally free to accept Desirée\'s offer.[1]',
408
+ 'The Suite Life on Deck The Suite Life on Deck is an American sitcom that aired on Disney Channel from September 26, 2008 to May 6, 2011. It is a sequel/spin-off of the Disney Channel Original Series The Suite Life of Zack & Cody. The series follows twin brothers Zack and Cody Martin and hotel heiress London Tipton in a new setting, the SS Tipton, where they attend classes at "Seven Seas High School" and meet Bailey Pickett while Mr. Moseby manages the ship. The ship travels around the world to nations such as Italy, France, Greece, India, Sweden and the United Kingdom where the characters experience different cultures, adventures, and situations.[1]',
409
+ 'Money in the Bank ladder match The first match was contested in 2005 at WrestleMania 21, after being invented (in kayfabe) by Chris Jericho.[1] At the time, it was exclusive to wrestlers of the Raw brand, and Edge won the inaugural match.[1] From then until 2010, the Money in the Bank ladder match, now open to all WWE brands, became a WrestleMania mainstay. 2010 saw a second and third Money in the Bank ladder match when the Money in the Bank pay-per-view debuted in July. Unlike the matches at WrestleMania, this new event featured two such ladder matches – one each for a contract for the WWE Championship and World Heavyweight Championship, respectively.',
410
+ ]
411
+ query_embeddings = model.encode_query(queries)
412
+ document_embeddings = model.encode_documents(documents)
413
+ print(query_embeddings.shape, document_embeddings.shape)
414
+ # [1, 30522] [3, 30522]
415
+
416
+ # Get the similarity scores for the embeddings
417
+ similarities = model.similarity(query_embeddings, document_embeddings)
418
+ print(similarities)
419
+ # tensor([[8.1355, 0.0000, 0.1926]])
420
+ ```
421
+
422
+ <!--
423
+ ### Direct Usage (Transformers)
424
+
425
+ <details><summary>Click to see the direct usage in Transformers</summary>
426
+
427
+ </details>
428
+ -->
429
+
430
+ <!--
431
+ ### Downstream Usage (Sentence Transformers)
432
+
433
+ You can finetune this model on your own dataset.
434
+
435
+ <details><summary>Click to expand</summary>
436
+
437
+ </details>
438
+ -->
439
+
440
+ <!--
441
+ ### Out-of-Scope Use
442
+
443
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
444
+ -->
445
+
446
+ ## Evaluation
447
+
448
+ ### Metrics
449
+
450
+ #### Sparse Information Retrieval
451
+
452
+ * Datasets: `NanoMSMARCO`, `NanoNFCorpus` and `NanoNQ`
453
+ * Evaluated with [<code>SparseInformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sparse_encoder/evaluation.html#sentence_transformers.sparse_encoder.evaluation.SparseInformationRetrievalEvaluator)
454
+
455
+ | Metric | NanoMSMARCO | NanoNFCorpus | NanoNQ |
456
+ |:----------------------|:------------|:-------------|:-----------|
457
+ | dot_accuracy@1 | 0.24 | 0.44 | 0.38 |
458
+ | dot_accuracy@3 | 0.54 | 0.54 | 0.54 |
459
+ | dot_accuracy@5 | 0.68 | 0.56 | 0.62 |
460
+ | dot_accuracy@10 | 0.78 | 0.58 | 0.66 |
461
+ | dot_precision@1 | 0.24 | 0.44 | 0.38 |
462
+ | dot_precision@3 | 0.18 | 0.3733 | 0.18 |
463
+ | dot_precision@5 | 0.136 | 0.324 | 0.128 |
464
+ | dot_precision@10 | 0.078 | 0.246 | 0.068 |
465
+ | dot_recall@1 | 0.24 | 0.0225 | 0.38 |
466
+ | dot_recall@3 | 0.54 | 0.0761 | 0.52 |
467
+ | dot_recall@5 | 0.68 | 0.0926 | 0.61 |
468
+ | dot_recall@10 | 0.78 | 0.1137 | 0.64 |
469
+ | **dot_ndcg@10** | **0.509** | **0.3094** | **0.5188** |
470
+ | dot_mrr@10 | 0.4219 | 0.4907 | 0.4807 |
471
+ | dot_map@100 | 0.4321 | 0.1284 | 0.4897 |
472
+ | query_active_dims | 7.22 | 5.66 | 10.32 |
473
+ | query_sparsity_ratio | 0.9998 | 0.9998 | 0.9997 |
474
+ | corpus_active_dims | 64.5061 | 81.6082 | 53.4848 |
475
+ | corpus_sparsity_ratio | 0.9979 | 0.9973 | 0.9982 |
476
+
477
+ #### Sparse Nano BEIR
478
+
479
+ * Dataset: `NanoBEIR_mean`
480
+ * Evaluated with [<code>SparseNanoBEIREvaluator</code>](https://sbert.net/docs/package_reference/sparse_encoder/evaluation.html#sentence_transformers.sparse_encoder.evaluation.SparseNanoBEIREvaluator) with these parameters:
481
+ ```json
482
+ {
483
+ "dataset_names": [
484
+ "msmarco",
485
+ "nfcorpus",
486
+ "nq"
487
+ ]
488
+ }
489
+ ```
490
+
491
+ | Metric | Value |
492
+ |:----------------------|:-----------|
493
+ | dot_accuracy@1 | 0.3533 |
494
+ | dot_accuracy@3 | 0.54 |
495
+ | dot_accuracy@5 | 0.62 |
496
+ | dot_accuracy@10 | 0.6733 |
497
+ | dot_precision@1 | 0.3533 |
498
+ | dot_precision@3 | 0.2444 |
499
+ | dot_precision@5 | 0.196 |
500
+ | dot_precision@10 | 0.1307 |
501
+ | dot_recall@1 | 0.2142 |
502
+ | dot_recall@3 | 0.3787 |
503
+ | dot_recall@5 | 0.4609 |
504
+ | dot_recall@10 | 0.5112 |
505
+ | **dot_ndcg@10** | **0.4457** |
506
+ | dot_mrr@10 | 0.4644 |
507
+ | dot_map@100 | 0.3501 |
508
+ | query_active_dims | 7.7333 |
509
+ | query_sparsity_ratio | 0.9997 |
510
+ | corpus_active_dims | 64.1232 |
511
+ | corpus_sparsity_ratio | 0.9979 |
512
+
513
+ <!--
514
+ ## Bias, Risks and Limitations
515
+
516
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
517
+ -->
518
+
519
+ <!--
520
+ ### Recommendations
521
+
522
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
523
+ -->
524
+
525
+ ## Training Details
526
+
527
+ ### Training Dataset
528
+
529
+ #### natural-questions
530
+
531
+ * Dataset: [natural-questions](https://huggingface.co/datasets/sentence-transformers/natural-questions) at [f9e894e](https://huggingface.co/datasets/sentence-transformers/natural-questions/tree/f9e894e1081e206e577b4eaa9ee6de2b06ae6f17)
532
+ * Size: 99,000 training samples
533
+ * Columns: <code>query</code> and <code>answer</code>
534
+ * Approximate statistics based on the first 1000 samples:
535
+ | | query | answer |
536
+ |:--------|:-----------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|
537
+ | type | string | string |
538
+ | details | <ul><li>min: 10 tokens</li><li>mean: 11.71 tokens</li><li>max: 26 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 131.81 tokens</li><li>max: 450 tokens</li></ul> |
539
+ * Samples:
540
+ | query | answer |
541
+ |:--------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
542
+ | <code>who played the father in papa don't preach</code> | <code>Alex McArthur Alex McArthur (born March 6, 1957) is an American actor.</code> |
543
+ | <code>where was the location of the battle of hastings</code> | <code>Battle of Hastings The Battle of Hastings[a] was fought on 14 October 1066 between the Norman-French army of William, the Duke of Normandy, and an English army under the Anglo-Saxon King Harold Godwinson, beginning the Norman conquest of England. It took place approximately 7 miles (11 kilometres) northwest of Hastings, close to the present-day town of Battle, East Sussex, and was a decisive Norman victory.</code> |
544
+ | <code>how many puppies can a dog give birth to</code> | <code>Canine reproduction The largest litter size to date was set by a Neapolitan Mastiff in Manea, Cambridgeshire, UK on November 29, 2004; the litter was 24 puppies.[22]</code> |
545
+ * Loss: [<code>SpladeLoss</code>](https://sbert.net/docs/package_reference/sparse_encoder/losses.html#spladeloss) with these parameters:
546
+ ```json
547
+ {
548
+ "loss": "SparseMultipleNegativesRankingLoss(scale=1.0, similarity_fct='dot_score')",
549
+ "lambda_corpus": 0.003,
550
+ "lambda_query": 0
551
+ }
552
+ ```
553
+
554
+ ### Evaluation Dataset
555
+
556
+ #### natural-questions
557
+
558
+ * Dataset: [natural-questions](https://huggingface.co/datasets/sentence-transformers/natural-questions) at [f9e894e](https://huggingface.co/datasets/sentence-transformers/natural-questions/tree/f9e894e1081e206e577b4eaa9ee6de2b06ae6f17)
559
+ * Size: 1,000 evaluation samples
560
+ * Columns: <code>query</code> and <code>answer</code>
561
+ * Approximate statistics based on the first 1000 samples:
562
+ | | query | answer |
563
+ |:--------|:-----------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|
564
+ | type | string | string |
565
+ | details | <ul><li>min: 10 tokens</li><li>mean: 11.69 tokens</li><li>max: 23 tokens</li></ul> | <ul><li>min: 15 tokens</li><li>mean: 134.01 tokens</li><li>max: 512 tokens</li></ul> |
566
+ * Samples:
567
+ | query | answer |
568
+ |:-------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
569
+ | <code>where is the tiber river located in italy</code> | <code>Tiber The Tiber (/ˈtaɪbər/, Latin: Tiberis,[1] Italian: Tevere [ˈteːvere])[2] is the third-longest river in Italy, rising in the Apennine Mountains in Emilia-Romagna and flowing 406 kilometres (252 mi) through Tuscany, Umbria and Lazio, where it is joined by the river Aniene, to the Tyrrhenian Sea, between Ostia and Fiumicino.[3] It drains a basin estimated at 17,375 square kilometres (6,709 sq mi). The river has achieved lasting fame as the main watercourse of the city of Rome, founded on its eastern banks.</code> |
570
+ | <code>what kind of car does jay gatsby drive</code> | <code>Jay Gatsby At the Buchanan home, Jordan Baker, Nick, Jay, and the Buchanans decide to visit New York City. Tom borrows Gatsby's yellow Rolls Royce to drive up to the city. On the way to New York City, Tom makes a detour at a gas station in "the Valley of Ashes", a run-down part of Long Island. The owner, George Wilson, shares his concern that his wife, Myrtle, may be having an affair. This unnerves Tom, who has been having an affair with Myrtle, and he leaves in a hurry.</code> |
571
+ | <code>who sings if i can dream about you</code> | <code>I Can Dream About You "I Can Dream About You" is a song performed by American singer Dan Hartman on the soundtrack album of the film Streets of Fire. Released in 1984 as a single from the soundtrack, and included on Hartman's album I Can Dream About You, it reached number 6 on the Billboard Hot 100.[1]</code> |
572
+ * Loss: [<code>SpladeLoss</code>](https://sbert.net/docs/package_reference/sparse_encoder/losses.html#spladeloss) with these parameters:
573
+ ```json
574
+ {
575
+ "loss": "SparseMultipleNegativesRankingLoss(scale=1.0, similarity_fct='dot_score')",
576
+ "lambda_corpus": 0.003,
577
+ "lambda_query": 0
578
+ }
579
+ ```
580
+
581
+ ### Training Hyperparameters
582
+ #### Non-Default Hyperparameters
583
+
584
+ - `eval_strategy`: steps
585
+ - `per_device_train_batch_size`: 16
586
+ - `per_device_eval_batch_size`: 16
587
+ - `learning_rate`: 2e-05
588
+ - `num_train_epochs`: 1
589
+ - `warmup_ratio`: 0.1
590
+ - `fp16`: True
591
+ - `batch_sampler`: no_duplicates
592
+ - `router_mapping`: {'query': 'query', 'answer': 'document'}
593
+ - `learning_rate_mapping`: {'IDF\\.weight': 0.001}
594
+
595
+ #### All Hyperparameters
596
+ <details><summary>Click to expand</summary>
597
+
598
+ - `overwrite_output_dir`: False
599
+ - `do_predict`: False
600
+ - `eval_strategy`: steps
601
+ - `prediction_loss_only`: True
602
+ - `per_device_train_batch_size`: 16
603
+ - `per_device_eval_batch_size`: 16
604
+ - `per_gpu_train_batch_size`: None
605
+ - `per_gpu_eval_batch_size`: None
606
+ - `gradient_accumulation_steps`: 1
607
+ - `eval_accumulation_steps`: None
608
+ - `torch_empty_cache_steps`: None
609
+ - `learning_rate`: 2e-05
610
+ - `weight_decay`: 0.0
611
+ - `adam_beta1`: 0.9
612
+ - `adam_beta2`: 0.999
613
+ - `adam_epsilon`: 1e-08
614
+ - `max_grad_norm`: 1.0
615
+ - `num_train_epochs`: 1
616
+ - `max_steps`: -1
617
+ - `lr_scheduler_type`: linear
618
+ - `lr_scheduler_kwargs`: {}
619
+ - `warmup_ratio`: 0.1
620
+ - `warmup_steps`: 0
621
+ - `log_level`: passive
622
+ - `log_level_replica`: warning
623
+ - `log_on_each_node`: True
624
+ - `logging_nan_inf_filter`: True
625
+ - `save_safetensors`: True
626
+ - `save_on_each_node`: False
627
+ - `save_only_model`: False
628
+ - `restore_callback_states_from_checkpoint`: False
629
+ - `no_cuda`: False
630
+ - `use_cpu`: False
631
+ - `use_mps_device`: False
632
+ - `seed`: 42
633
+ - `data_seed`: None
634
+ - `jit_mode_eval`: False
635
+ - `use_ipex`: False
636
+ - `bf16`: False
637
+ - `fp16`: True
638
+ - `fp16_opt_level`: O1
639
+ - `half_precision_backend`: auto
640
+ - `bf16_full_eval`: False
641
+ - `fp16_full_eval`: False
642
+ - `tf32`: None
643
+ - `local_rank`: 0
644
+ - `ddp_backend`: None
645
+ - `tpu_num_cores`: None
646
+ - `tpu_metrics_debug`: False
647
+ - `debug`: []
648
+ - `dataloader_drop_last`: False
649
+ - `dataloader_num_workers`: 0
650
+ - `dataloader_prefetch_factor`: None
651
+ - `past_index`: -1
652
+ - `disable_tqdm`: False
653
+ - `remove_unused_columns`: True
654
+ - `label_names`: None
655
+ - `load_best_model_at_end`: False
656
+ - `ignore_data_skip`: False
657
+ - `fsdp`: []
658
+ - `fsdp_min_num_params`: 0
659
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
660
+ - `fsdp_transformer_layer_cls_to_wrap`: None
661
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
662
+ - `deepspeed`: None
663
+ - `label_smoothing_factor`: 0.0
664
+ - `optim`: adamw_torch
665
+ - `optim_args`: None
666
+ - `adafactor`: False
667
+ - `group_by_length`: False
668
+ - `length_column_name`: length
669
+ - `ddp_find_unused_parameters`: None
670
+ - `ddp_bucket_cap_mb`: None
671
+ - `ddp_broadcast_buffers`: False
672
+ - `dataloader_pin_memory`: True
673
+ - `dataloader_persistent_workers`: False
674
+ - `skip_memory_metrics`: True
675
+ - `use_legacy_prediction_loop`: False
676
+ - `push_to_hub`: False
677
+ - `resume_from_checkpoint`: None
678
+ - `hub_model_id`: None
679
+ - `hub_strategy`: every_save
680
+ - `hub_private_repo`: None
681
+ - `hub_always_push`: False
682
+ - `gradient_checkpointing`: False
683
+ - `gradient_checkpointing_kwargs`: None
684
+ - `include_inputs_for_metrics`: False
685
+ - `include_for_metrics`: []
686
+ - `eval_do_concat_batches`: True
687
+ - `fp16_backend`: auto
688
+ - `push_to_hub_model_id`: None
689
+ - `push_to_hub_organization`: None
690
+ - `mp_parameters`:
691
+ - `auto_find_batch_size`: False
692
+ - `full_determinism`: False
693
+ - `torchdynamo`: None
694
+ - `ray_scope`: last
695
+ - `ddp_timeout`: 1800
696
+ - `torch_compile`: False
697
+ - `torch_compile_backend`: None
698
+ - `torch_compile_mode`: None
699
+ - `include_tokens_per_second`: False
700
+ - `include_num_input_tokens_seen`: False
701
+ - `neftune_noise_alpha`: None
702
+ - `optim_target_modules`: None
703
+ - `batch_eval_metrics`: False
704
+ - `eval_on_start`: False
705
+ - `use_liger_kernel`: False
706
+ - `eval_use_gather_object`: False
707
+ - `average_tokens_across_devices`: False
708
+ - `prompts`: None
709
+ - `batch_sampler`: no_duplicates
710
+ - `multi_dataset_batch_sampler`: proportional
711
+ - `router_mapping`: {'query': 'query', 'answer': 'document'}
712
+ - `learning_rate_mapping`: {'IDF\\.weight': 0.001}
713
+
714
+ </details>
715
+
716
+ ### Training Logs
717
+ | Epoch | Step | Training Loss | Validation Loss | NanoMSMARCO_dot_ndcg@10 | NanoNFCorpus_dot_ndcg@10 | NanoNQ_dot_ndcg@10 | NanoBEIR_mean_dot_ndcg@10 |
718
+ |:------:|:----:|:-------------:|:---------------:|:-----------------------:|:------------------------:|:------------------:|:-------------------------:|
719
+ | 0.0323 | 200 | 0.2623 | - | - | - | - | - |
720
+ | 0.0646 | 400 | 0.103 | 0.1146 | 0.5168 | 0.3151 | 0.5116 | 0.4479 |
721
+ | 0.0970 | 600 | 0.0867 | - | - | - | - | - |
722
+ | 0.1293 | 800 | 0.0656 | 0.0912 | 0.5291 | 0.3181 | 0.4704 | 0.4392 |
723
+ | 0.1616 | 1000 | 0.0668 | - | - | - | - | - |
724
+ | 0.1939 | 1200 | 0.0737 | 0.0962 | 0.4889 | 0.3257 | 0.5003 | 0.4383 |
725
+ | 0.2262 | 1400 | 0.08 | - | - | - | - | - |
726
+ | 0.2586 | 1600 | 0.0826 | 0.0943 | 0.5382 | 0.3263 | 0.5141 | 0.4595 |
727
+ | 0.2909 | 1800 | 0.0863 | - | - | - | - | - |
728
+ | 0.3232 | 2000 | 0.0896 | 0.1025 | 0.5305 | 0.3138 | 0.5585 | 0.4676 |
729
+ | 0.3555 | 2200 | 0.089 | - | - | - | - | - |
730
+ | 0.3878 | 2400 | 0.0845 | 0.1030 | 0.5135 | 0.3281 | 0.5277 | 0.4564 |
731
+ | 0.4202 | 2600 | 0.091 | - | - | - | - | - |
732
+ | 0.4525 | 2800 | 0.0837 | 0.0946 | 0.5384 | 0.3284 | 0.5282 | 0.4650 |
733
+ | 0.4848 | 3000 | 0.0761 | - | - | - | - | - |
734
+ | 0.5171 | 3200 | 0.0776 | 0.0917 | 0.5059 | 0.3253 | 0.5169 | 0.4494 |
735
+ | 0.5495 | 3400 | 0.0814 | - | - | - | - | - |
736
+ | 0.5818 | 3600 | 0.0767 | 0.0862 | 0.5381 | 0.3188 | 0.5323 | 0.4631 |
737
+ | 0.6141 | 3800 | 0.0824 | - | - | - | - | - |
738
+ | 0.6464 | 4000 | 0.0734 | 0.0853 | 0.5392 | 0.3234 | 0.5192 | 0.4606 |
739
+ | 0.6787 | 4200 | 0.0769 | - | - | - | - | - |
740
+ | 0.7111 | 4400 | 0.0681 | 0.0825 | 0.5236 | 0.3187 | 0.5369 | 0.4597 |
741
+ | 0.7434 | 4600 | 0.0699 | - | - | - | - | - |
742
+ | 0.7757 | 4800 | 0.0702 | 0.0814 | 0.5267 | 0.2961 | 0.5420 | 0.4549 |
743
+ | 0.8080 | 5000 | 0.0708 | - | - | - | - | - |
744
+ | 0.8403 | 5200 | 0.0731 | 0.0765 | 0.5376 | 0.3020 | 0.5307 | 0.4568 |
745
+ | 0.8727 | 5400 | 0.0739 | - | - | - | - | - |
746
+ | 0.9050 | 5600 | 0.0669 | 0.0771 | 0.5160 | 0.3091 | 0.5455 | 0.4569 |
747
+ | 0.9373 | 5800 | 0.0658 | - | - | - | - | - |
748
+ | 0.9696 | 6000 | 0.0662 | 0.0755 | 0.5080 | 0.3105 | 0.5215 | 0.4467 |
749
+ | -1 | -1 | - | - | 0.5090 | 0.3094 | 0.5188 | 0.4457 |
750
+
751
+
752
+ ### Environmental Impact
753
+ Carbon emissions were measured using [CodeCarbon](https://github.com/mlco2/codecarbon).
754
+ - **Energy Consumed**: 0.164 kWh
755
+ - **Carbon Emitted**: 0.064 kg of CO2
756
+ - **Hours Used**: 0.432 hours
757
+
758
+ ### Training Hardware
759
+ - **On Cloud**: No
760
+ - **GPU Model**: 1 x NVIDIA GeForce RTX 3090
761
+ - **CPU Model**: 13th Gen Intel(R) Core(TM) i7-13700K
762
+ - **RAM Size**: 31.78 GB
763
+
764
+ ### Framework Versions
765
+ - Python: 3.11.6
766
+ - Sentence Transformers: 4.2.0.dev0
767
+ - Transformers: 4.52.4
768
+ - PyTorch: 2.6.0+cu124
769
+ - Accelerate: 1.5.1
770
+ - Datasets: 2.21.0
771
+ - Tokenizers: 0.21.1
772
+
773
+ ## Citation
774
+
775
+ ### BibTeX
776
+
777
+ #### Sentence Transformers
778
+ ```bibtex
779
+ @inproceedings{reimers-2019-sentence-bert,
780
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
781
+ author = "Reimers, Nils and Gurevych, Iryna",
782
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
783
+ month = "11",
784
+ year = "2019",
785
+ publisher = "Association for Computational Linguistics",
786
+ url = "https://arxiv.org/abs/1908.10084",
787
+ }
788
+ ```
789
+
790
+ #### SpladeLoss
791
+ ```bibtex
792
+ @misc{formal2022distillationhardnegativesampling,
793
+ title={From Distillation to Hard Negative Sampling: Making Sparse Neural IR Models More Effective},
794
+ author={Thibault Formal and Carlos Lassance and Benjamin Piwowarski and Stéphane Clinchant},
795
+ year={2022},
796
+ eprint={2205.04733},
797
+ archivePrefix={arXiv},
798
+ primaryClass={cs.IR},
799
+ url={https://arxiv.org/abs/2205.04733},
800
+ }
801
+ ```
802
+
803
+ #### SparseMultipleNegativesRankingLoss
804
+ ```bibtex
805
+ @misc{henderson2017efficient,
806
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
807
+ 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},
808
+ year={2017},
809
+ eprint={1705.00652},
810
+ archivePrefix={arXiv},
811
+ primaryClass={cs.CL}
812
+ }
813
+ ```
814
+
815
+ #### FlopsLoss
816
+ ```bibtex
817
+ @article{paria2020minimizing,
818
+ title={Minimizing flops to learn efficient sparse representations},
819
+ author={Paria, Biswajit and Yeh, Chih-Kuan and Yen, Ian EH and Xu, Ning and Ravikumar, Pradeep and P{'o}czos, Barnab{'a}s},
820
+ journal={arXiv preprint arXiv:2004.05665},
821
+ year={2020}
822
+ }
823
+ ```
824
+
825
+ <!--
826
+ ## Glossary
827
+
828
+ *Clearly define terms in order to be accessible across audiences.*
829
+ -->
830
+
831
+ <!--
832
+ ## Model Card Authors
833
+
834
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
835
+ -->
836
+
837
+ <!--
838
+ ## Model Card Contact
839
+
840
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
841
+ -->
config_sentence_transformers.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "SparseEncoder",
3
+ "__version__": {
4
+ "sentence_transformers": "4.2.0.dev0",
5
+ "transformers": "4.52.4",
6
+ "pytorch": "2.6.0+cu124"
7
+ },
8
+ "prompts": {
9
+ "query": "",
10
+ "document": ""
11
+ },
12
+ "default_prompt_name": null,
13
+ "similarity_fn_name": "dot"
14
+ }
document_0_MLMTransformer/config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertForMaskedLM"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "classifier_dropout": null,
7
+ "gradient_checkpointing": false,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 768,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 3072,
13
+ "layer_norm_eps": 1e-12,
14
+ "max_position_embeddings": 512,
15
+ "model_type": "bert",
16
+ "num_attention_heads": 12,
17
+ "num_hidden_layers": 12,
18
+ "pad_token_id": 0,
19
+ "position_embedding_type": "absolute",
20
+ "torch_dtype": "float32",
21
+ "transformers_version": "4.52.4",
22
+ "type_vocab_size": 2,
23
+ "use_cache": true,
24
+ "vocab_size": 30522
25
+ }
document_0_MLMTransformer/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b5eba68204e35c26850e8927a4a4555f8884fc07e706abfcc2f46063f2e0fa02
3
+ size 438080896
document_0_MLMTransformer/sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 512,
3
+ "do_lower_case": false
4
+ }
document_0_MLMTransformer/special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
document_0_MLMTransformer/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
document_0_MLMTransformer/tokenizer_config.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": false,
45
+ "cls_token": "[CLS]",
46
+ "do_lower_case": true,
47
+ "extra_special_tokens": {},
48
+ "mask_token": "[MASK]",
49
+ "model_max_length": 512,
50
+ "pad_token": "[PAD]",
51
+ "sep_token": "[SEP]",
52
+ "strip_accents": null,
53
+ "tokenize_chinese_chars": true,
54
+ "tokenizer_class": "BertTokenizer",
55
+ "unk_token": "[UNK]"
56
+ }
document_0_MLMTransformer/vocab.txt ADDED
The diff for this file is too large to render. See raw diff
 
document_1_SpladePooling/config.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "pooling_strategy": "max",
3
+ "activation_function": "relu",
4
+ "word_embedding_dimension": 30522
5
+ }
modules.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Router"
7
+ }
8
+ ]
query_0_IDF/config.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "frozen": false
3
+ }
query_0_IDF/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a3456829c574477f7a8ae7e8013432fb4006741adc802b564030763bd9954da8
3
+ size 122168
query_0_IDF/special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
query_0_IDF/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
query_0_IDF/tokenizer_config.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": false,
45
+ "cls_token": "[CLS]",
46
+ "do_lower_case": true,
47
+ "extra_special_tokens": {},
48
+ "mask_token": "[MASK]",
49
+ "model_max_length": 512,
50
+ "pad_token": "[PAD]",
51
+ "sep_token": "[SEP]",
52
+ "strip_accents": null,
53
+ "tokenize_chinese_chars": true,
54
+ "tokenizer_class": "BertTokenizer",
55
+ "unk_token": "[UNK]"
56
+ }
query_0_IDF/vocab.txt ADDED
The diff for this file is too large to render. See raw diff
 
router_config.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "types": {
3
+ "query_0_IDF": "sentence_transformers.sparse_encoder.models.IDF.IDF",
4
+ "document_0_MLMTransformer": "sentence_transformers.sparse_encoder.models.MLMTransformer.MLMTransformer",
5
+ "document_1_SpladePooling": "sentence_transformers.sparse_encoder.models.SpladePooling.SpladePooling"
6
+ },
7
+ "structure": {
8
+ "query": [
9
+ "query_0_IDF"
10
+ ],
11
+ "document": [
12
+ "document_0_MLMTransformer",
13
+ "document_1_SpladePooling"
14
+ ]
15
+ },
16
+ "parameters": {
17
+ "default_route": "document",
18
+ "allow_empty_key": true
19
+ }
20
+ }