ostoveland commited on
Commit
1bed14e
·
verified ·
1 Parent(s): cf89b70

Add new SentenceTransformer model.

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 768,
3
+ "pooling_mode_cls_token": false,
4
+ "pooling_mode_mean_tokens": true,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,523 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - sentence-transformers
4
+ - sentence-similarity
5
+ - feature-extraction
6
+ - generated_from_trainer
7
+ - dataset_size:96724
8
+ - loss:Matryoshka2dLoss
9
+ - loss:MatryoshkaLoss
10
+ - loss:TripletLoss
11
+ - loss:MultipleNegativesRankingLoss
12
+ - loss:CoSENTLoss
13
+ base_model: NbAiLab/nb-sbert-base
14
+ widget:
15
+ - source_sentence: Ny duk til markise på 5.6 meter
16
+ sentences:
17
+ - oppussing av tegl fasade
18
+ - Installere ny markiseduk 5.6 meter
19
+ - installasjon av vann og kloakk
20
+ - source_sentence: Sette inn rør i pipe
21
+ sentences:
22
+ - montering av rør i pipe
23
+ - bytte og flytte varmtvannsbereder
24
+ - saging av betong for dører
25
+ - source_sentence: Helsparkling og pussing av vegger i en leilighet på 70 kvm
26
+ sentences:
27
+ - fullsparkling og pussing av vegger i 70 kvm leilighet
28
+ - støttemur med bunnfundament, 26 meter lang og 3 meter høy
29
+ - trappeteppe legging
30
+ - source_sentence: Montering av peisovn, samt finsparkling av brannmur bak peisovnen
31
+ sentences:
32
+ - Verditakst av leilighet i Oslo
33
+ - Montering av Nordpeis Sakai Peisovn - Lillestrøm
34
+ - Etterisolering og bytte av kledning
35
+ - source_sentence: Ny utvendig trapp til 2.etg
36
+ sentences:
37
+ - Installere utvendig trapp til 2. etasje
38
+ - Flyttelass fra Tromsø til Bodø
39
+ - tapetsere en vegg
40
+ pipeline_tag: sentence-similarity
41
+ library_name: sentence-transformers
42
+ ---
43
+
44
+ # SentenceTransformer based on NbAiLab/nb-sbert-base
45
+
46
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [NbAiLab/nb-sbert-base](https://huggingface.co/NbAiLab/nb-sbert-base). It maps sentences & paragraphs to a 64-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
47
+
48
+ ## Model Details
49
+
50
+ ### Model Description
51
+ - **Model Type:** Sentence Transformer
52
+ - **Base model:** [NbAiLab/nb-sbert-base](https://huggingface.co/NbAiLab/nb-sbert-base) <!-- at revision 26567595914b5f4b04ec871b5814db989ca261b9 -->
53
+ - **Maximum Sequence Length:** 75 tokens
54
+ - **Output Dimensionality:** 64 dimensions
55
+ - **Similarity Function:** Cosine Similarity
56
+ <!-- - **Training Dataset:** Unknown -->
57
+ <!-- - **Language:** Unknown -->
58
+ <!-- - **License:** Unknown -->
59
+
60
+ ### Model Sources
61
+
62
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
63
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
64
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
65
+
66
+ ### Full Model Architecture
67
+
68
+ ```
69
+ SentenceTransformer(
70
+ (0): Transformer({'max_seq_length': 75, 'do_lower_case': False}) with Transformer model: BertModel
71
+ (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})
72
+ )
73
+ ```
74
+
75
+ ## Usage
76
+
77
+ ### Direct Usage (Sentence Transformers)
78
+
79
+ First install the Sentence Transformers library:
80
+
81
+ ```bash
82
+ pip install -U sentence-transformers
83
+ ```
84
+
85
+ Then you can load this model and run inference.
86
+ ```python
87
+ from sentence_transformers import SentenceTransformer
88
+
89
+ # Download from the 🤗 Hub
90
+ model = SentenceTransformer("ostoveland/SBertBaseMittanbudver2")
91
+ # Run inference
92
+ sentences = [
93
+ 'Ny utvendig trapp til 2.etg',
94
+ 'Installere utvendig trapp til 2. etasje',
95
+ 'tapetsere en vegg',
96
+ ]
97
+ embeddings = model.encode(sentences)
98
+ print(embeddings.shape)
99
+ # [3, 64]
100
+
101
+ # Get the similarity scores for the embeddings
102
+ similarities = model.similarity(embeddings, embeddings)
103
+ print(similarities.shape)
104
+ # [3, 3]
105
+ ```
106
+
107
+ <!--
108
+ ### Direct Usage (Transformers)
109
+
110
+ <details><summary>Click to see the direct usage in Transformers</summary>
111
+
112
+ </details>
113
+ -->
114
+
115
+ <!--
116
+ ### Downstream Usage (Sentence Transformers)
117
+
118
+ You can finetune this model on your own dataset.
119
+
120
+ <details><summary>Click to expand</summary>
121
+
122
+ </details>
123
+ -->
124
+
125
+ <!--
126
+ ### Out-of-Scope Use
127
+
128
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
129
+ -->
130
+
131
+ <!--
132
+ ## Bias, Risks and Limitations
133
+
134
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
135
+ -->
136
+
137
+ <!--
138
+ ### Recommendations
139
+
140
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
141
+ -->
142
+
143
+ ## Training Details
144
+
145
+ ### Training Datasets
146
+
147
+ #### Unnamed Dataset
148
+
149
+
150
+ * Size: 55,426 training samples
151
+ * Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>sentence_2</code>
152
+ * Approximate statistics based on the first 1000 samples:
153
+ | | sentence_0 | sentence_1 | sentence_2 |
154
+ |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
155
+ | type | string | string | string |
156
+ | details | <ul><li>min: 4 tokens</li><li>mean: 11.44 tokens</li><li>max: 51 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 10.73 tokens</li><li>max: 52 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 10.42 tokens</li><li>max: 36 tokens</li></ul> |
157
+ * Samples:
158
+ | sentence_0 | sentence_1 | sentence_2 |
159
+ |:-------------------------------------------------------------------------------------------|:--------------------------------------------------------|:--------------------------------------------|
160
+ | <code>Varmekabler soverom</code> | <code>Legging av varmekabler</code> | <code>Bytte vv bereder,</code> |
161
+ | <code>Pga liten vannskade trengs det å fjerne / legge nytt laminat på kjøkken 9,5m2</code> | <code>Legge laminatgulv, samt montere gulvlister</code> | <code>Garderobe med innfelte fronter</code> |
162
+ | <code>Sette opp gjerde i stål</code> | <code>Stålgjerde på natursteinsmur</code> | <code>Legge pergo-gulv på soverom</code> |
163
+ * Loss: [<code>Matryoshka2dLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshka2dloss) with these parameters:
164
+ ```json
165
+ {
166
+ "loss": "TripletLoss",
167
+ "n_layers_per_step": 1,
168
+ "last_layer_weight": 1.0,
169
+ "prior_layers_weight": 1.0,
170
+ "kl_div_weight": 1.0,
171
+ "kl_temperature": 0.3,
172
+ "matryoshka_dims": [
173
+ 768,
174
+ 512,
175
+ 256,
176
+ 128,
177
+ 64
178
+ ],
179
+ "matryoshka_weights": [
180
+ 1,
181
+ 1,
182
+ 1,
183
+ 1,
184
+ 1
185
+ ],
186
+ "n_dims_per_step": 1
187
+ }
188
+ ```
189
+
190
+ #### Unnamed Dataset
191
+
192
+
193
+ * Size: 22,563 training samples
194
+ * Columns: <code>sentence_0</code> and <code>sentence_1</code>
195
+ * Approximate statistics based on the first 1000 samples:
196
+ | | sentence_0 | sentence_1 |
197
+ |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
198
+ | type | string | string |
199
+ | details | <ul><li>min: 3 tokens</li><li>mean: 11.06 tokens</li><li>max: 42 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 10.13 tokens</li><li>max: 25 tokens</li></ul> |
200
+ * Samples:
201
+ | sentence_0 | sentence_1 |
202
+ |:----------------------------------------------|:------------------------------------------------------|
203
+ | <code>bygge terrasse på 41 kvm</code> | <code>41 kvadratmeter terrasse i første etasje</code> |
204
+ | <code>tapetsering av stue og spisestue</code> | <code>tapetsere stue og spisestue</code> |
205
+ | <code>Pusse opp en klinikk i Trondheim</code> | <code>oppussing av klinikk i Trondheim</code> |
206
+ * Loss: [<code>Matryoshka2dLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshka2dloss) with these parameters:
207
+ ```json
208
+ {
209
+ "loss": "MultipleNegativesRankingLoss",
210
+ "n_layers_per_step": 1,
211
+ "last_layer_weight": 1.0,
212
+ "prior_layers_weight": 1.0,
213
+ "kl_div_weight": 1.0,
214
+ "kl_temperature": 0.3,
215
+ "matryoshka_dims": [
216
+ 768,
217
+ 512,
218
+ 256,
219
+ 128,
220
+ 64
221
+ ],
222
+ "matryoshka_weights": [
223
+ 1,
224
+ 1,
225
+ 1,
226
+ 1,
227
+ 1
228
+ ],
229
+ "n_dims_per_step": 1
230
+ }
231
+ ```
232
+
233
+ #### Unnamed Dataset
234
+
235
+
236
+ * Size: 18,735 training samples
237
+ * Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>label</code>
238
+ * Approximate statistics based on the first 1000 samples:
239
+ | | sentence_0 | sentence_1 | label |
240
+ |:--------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------|
241
+ | type | string | string | float |
242
+ | details | <ul><li>min: 3 tokens</li><li>mean: 13.31 tokens</li><li>max: 55 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 9.65 tokens</li><li>max: 24 tokens</li></ul> | <ul><li>min: 0.05</li><li>mean: 0.5</li><li>max: 0.95</li></ul> |
243
+ * Samples:
244
+ | sentence_0 | sentence_1 | label |
245
+ |:----------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------|:------------------|
246
+ | <code>Overflateoppussing av Pilestredet Park</code> | <code>renovere hus på 120kvm</code> | <code>0.9</code> |
247
+ | <code>Tømme og koble fra varmtvannsbereder under kjøkkenbenk i 2 etg, samt montere ny 200 l. bereder i 1.etg, under trapp.</code> | <code>Bytte varmtvannsbereder fra kjøkken til under trapp</code> | <code>0.95</code> |
248
+ | <code>Kjerneboring</code> | <code>Boring for rør</code> | <code>0.35</code> |
249
+ * Loss: [<code>Matryoshka2dLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshka2dloss) with these parameters:
250
+ ```json
251
+ {
252
+ "loss": "CoSENTLoss",
253
+ "n_layers_per_step": 1,
254
+ "last_layer_weight": 1.0,
255
+ "prior_layers_weight": 1.0,
256
+ "kl_div_weight": 1.0,
257
+ "kl_temperature": 0.3,
258
+ "matryoshka_dims": [
259
+ 768,
260
+ 512,
261
+ 256,
262
+ 128,
263
+ 64
264
+ ],
265
+ "matryoshka_weights": [
266
+ 1,
267
+ 1,
268
+ 1,
269
+ 1,
270
+ 1
271
+ ],
272
+ "n_dims_per_step": 1
273
+ }
274
+ ```
275
+
276
+ ### Training Hyperparameters
277
+ #### Non-Default Hyperparameters
278
+
279
+ - `per_device_train_batch_size`: 32
280
+ - `per_device_eval_batch_size`: 32
281
+ - `multi_dataset_batch_sampler`: round_robin
282
+
283
+ #### All Hyperparameters
284
+ <details><summary>Click to expand</summary>
285
+
286
+ - `overwrite_output_dir`: False
287
+ - `do_predict`: False
288
+ - `eval_strategy`: no
289
+ - `prediction_loss_only`: True
290
+ - `per_device_train_batch_size`: 32
291
+ - `per_device_eval_batch_size`: 32
292
+ - `per_gpu_train_batch_size`: None
293
+ - `per_gpu_eval_batch_size`: None
294
+ - `gradient_accumulation_steps`: 1
295
+ - `eval_accumulation_steps`: None
296
+ - `torch_empty_cache_steps`: None
297
+ - `learning_rate`: 5e-05
298
+ - `weight_decay`: 0.0
299
+ - `adam_beta1`: 0.9
300
+ - `adam_beta2`: 0.999
301
+ - `adam_epsilon`: 1e-08
302
+ - `max_grad_norm`: 1
303
+ - `num_train_epochs`: 3
304
+ - `max_steps`: -1
305
+ - `lr_scheduler_type`: linear
306
+ - `lr_scheduler_kwargs`: {}
307
+ - `warmup_ratio`: 0.0
308
+ - `warmup_steps`: 0
309
+ - `log_level`: passive
310
+ - `log_level_replica`: warning
311
+ - `log_on_each_node`: True
312
+ - `logging_nan_inf_filter`: True
313
+ - `save_safetensors`: True
314
+ - `save_on_each_node`: False
315
+ - `save_only_model`: False
316
+ - `restore_callback_states_from_checkpoint`: False
317
+ - `no_cuda`: False
318
+ - `use_cpu`: False
319
+ - `use_mps_device`: False
320
+ - `seed`: 42
321
+ - `data_seed`: None
322
+ - `jit_mode_eval`: False
323
+ - `use_ipex`: False
324
+ - `bf16`: False
325
+ - `fp16`: False
326
+ - `fp16_opt_level`: O1
327
+ - `half_precision_backend`: auto
328
+ - `bf16_full_eval`: False
329
+ - `fp16_full_eval`: False
330
+ - `tf32`: None
331
+ - `local_rank`: 0
332
+ - `ddp_backend`: None
333
+ - `tpu_num_cores`: None
334
+ - `tpu_metrics_debug`: False
335
+ - `debug`: []
336
+ - `dataloader_drop_last`: False
337
+ - `dataloader_num_workers`: 0
338
+ - `dataloader_prefetch_factor`: None
339
+ - `past_index`: -1
340
+ - `disable_tqdm`: False
341
+ - `remove_unused_columns`: True
342
+ - `label_names`: None
343
+ - `load_best_model_at_end`: False
344
+ - `ignore_data_skip`: False
345
+ - `fsdp`: []
346
+ - `fsdp_min_num_params`: 0
347
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
348
+ - `fsdp_transformer_layer_cls_to_wrap`: None
349
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
350
+ - `deepspeed`: None
351
+ - `label_smoothing_factor`: 0.0
352
+ - `optim`: adamw_torch
353
+ - `optim_args`: None
354
+ - `adafactor`: False
355
+ - `group_by_length`: False
356
+ - `length_column_name`: length
357
+ - `ddp_find_unused_parameters`: None
358
+ - `ddp_bucket_cap_mb`: None
359
+ - `ddp_broadcast_buffers`: False
360
+ - `dataloader_pin_memory`: True
361
+ - `dataloader_persistent_workers`: False
362
+ - `skip_memory_metrics`: True
363
+ - `use_legacy_prediction_loop`: False
364
+ - `push_to_hub`: False
365
+ - `resume_from_checkpoint`: None
366
+ - `hub_model_id`: None
367
+ - `hub_strategy`: every_save
368
+ - `hub_private_repo`: False
369
+ - `hub_always_push`: False
370
+ - `gradient_checkpointing`: False
371
+ - `gradient_checkpointing_kwargs`: None
372
+ - `include_inputs_for_metrics`: False
373
+ - `include_for_metrics`: []
374
+ - `eval_do_concat_batches`: True
375
+ - `fp16_backend`: auto
376
+ - `push_to_hub_model_id`: None
377
+ - `push_to_hub_organization`: None
378
+ - `mp_parameters`:
379
+ - `auto_find_batch_size`: False
380
+ - `full_determinism`: False
381
+ - `torchdynamo`: None
382
+ - `ray_scope`: last
383
+ - `ddp_timeout`: 1800
384
+ - `torch_compile`: False
385
+ - `torch_compile_backend`: None
386
+ - `torch_compile_mode`: None
387
+ - `dispatch_batches`: None
388
+ - `split_batches`: None
389
+ - `include_tokens_per_second`: False
390
+ - `include_num_input_tokens_seen`: False
391
+ - `neftune_noise_alpha`: None
392
+ - `optim_target_modules`: None
393
+ - `batch_eval_metrics`: False
394
+ - `eval_on_start`: False
395
+ - `use_liger_kernel`: False
396
+ - `eval_use_gather_object`: False
397
+ - `average_tokens_across_devices`: False
398
+ - `prompts`: None
399
+ - `batch_sampler`: batch_sampler
400
+ - `multi_dataset_batch_sampler`: round_robin
401
+
402
+ </details>
403
+
404
+ ### Training Logs
405
+ | Epoch | Step | Training Loss |
406
+ |:------:|:----:|:-------------:|
407
+ | 0.2844 | 500 | 6.6521 |
408
+ | 0.5688 | 1000 | 7.298 |
409
+ | 0.8532 | 1500 | 7.4369 |
410
+ | 1.0006 | 1759 | - |
411
+ | 1.1371 | 2000 | 7.3562 |
412
+ | 1.4215 | 2500 | 7.0798 |
413
+ | 1.7059 | 3000 | 6.9418 |
414
+ | 1.9903 | 3500 | 7.1839 |
415
+ | 2.0006 | 3518 | - |
416
+ | 2.2742 | 4000 | 7.3609 |
417
+ | 2.5586 | 4500 | 6.9551 |
418
+ | 2.8430 | 5000 | 6.8276 |
419
+ | 2.9989 | 5274 | - |
420
+
421
+
422
+ ### Framework Versions
423
+ - Python: 3.10.12
424
+ - Sentence Transformers: 3.3.1
425
+ - Transformers: 4.46.3
426
+ - PyTorch: 2.5.1+cu121
427
+ - Accelerate: 1.1.1
428
+ - Datasets: 3.1.0
429
+ - Tokenizers: 0.20.3
430
+
431
+ ## Citation
432
+
433
+ ### BibTeX
434
+
435
+ #### Sentence Transformers
436
+ ```bibtex
437
+ @inproceedings{reimers-2019-sentence-bert,
438
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
439
+ author = "Reimers, Nils and Gurevych, Iryna",
440
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
441
+ month = "11",
442
+ year = "2019",
443
+ publisher = "Association for Computational Linguistics",
444
+ url = "https://arxiv.org/abs/1908.10084",
445
+ }
446
+ ```
447
+
448
+ #### Matryoshka2dLoss
449
+ ```bibtex
450
+ @misc{li20242d,
451
+ title={2D Matryoshka Sentence Embeddings},
452
+ author={Xianming Li and Zongxi Li and Jing Li and Haoran Xie and Qing Li},
453
+ year={2024},
454
+ eprint={2402.14776},
455
+ archivePrefix={arXiv},
456
+ primaryClass={cs.CL}
457
+ }
458
+ ```
459
+
460
+ #### MatryoshkaLoss
461
+ ```bibtex
462
+ @misc{kusupati2024matryoshka,
463
+ title={Matryoshka Representation Learning},
464
+ 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},
465
+ year={2024},
466
+ eprint={2205.13147},
467
+ archivePrefix={arXiv},
468
+ primaryClass={cs.LG}
469
+ }
470
+ ```
471
+
472
+ #### TripletLoss
473
+ ```bibtex
474
+ @misc{hermans2017defense,
475
+ title={In Defense of the Triplet Loss for Person Re-Identification},
476
+ author={Alexander Hermans and Lucas Beyer and Bastian Leibe},
477
+ year={2017},
478
+ eprint={1703.07737},
479
+ archivePrefix={arXiv},
480
+ primaryClass={cs.CV}
481
+ }
482
+ ```
483
+
484
+ #### MultipleNegativesRankingLoss
485
+ ```bibtex
486
+ @misc{henderson2017efficient,
487
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
488
+ 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},
489
+ year={2017},
490
+ eprint={1705.00652},
491
+ archivePrefix={arXiv},
492
+ primaryClass={cs.CL}
493
+ }
494
+ ```
495
+
496
+ #### CoSENTLoss
497
+ ```bibtex
498
+ @online{kexuefm-8847,
499
+ title={CoSENT: A more efficient sentence vector scheme than Sentence-BERT},
500
+ author={Su Jianlin},
501
+ year={2022},
502
+ month={Jan},
503
+ url={https://kexue.fm/archives/8847},
504
+ }
505
+ ```
506
+
507
+ <!--
508
+ ## Glossary
509
+
510
+ *Clearly define terms in order to be accessible across audiences.*
511
+ -->
512
+
513
+ <!--
514
+ ## Model Card Authors
515
+
516
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
517
+ -->
518
+
519
+ <!--
520
+ ## Model Card Contact
521
+
522
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
523
+ -->
config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "NbAiLab/nb-sbert-base",
3
+ "architectures": [
4
+ "BertModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "directionality": "bidi",
9
+ "gradient_checkpointing": false,
10
+ "hidden_act": "gelu",
11
+ "hidden_dropout_prob": 0.1,
12
+ "hidden_size": 768,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 3072,
15
+ "layer_norm_eps": 1e-12,
16
+ "max_position_embeddings": 512,
17
+ "model_type": "bert",
18
+ "num_attention_heads": 12,
19
+ "num_hidden_layers": 12,
20
+ "pad_token_id": 0,
21
+ "pooler_fc_size": 768,
22
+ "pooler_num_attention_heads": 12,
23
+ "pooler_num_fc_layers": 3,
24
+ "pooler_size_per_head": 128,
25
+ "pooler_type": "first_token_transform",
26
+ "position_embedding_type": "absolute",
27
+ "torch_dtype": "float32",
28
+ "transformers_version": "4.46.3",
29
+ "type_vocab_size": 2,
30
+ "use_cache": true,
31
+ "vocab_size": 119547
32
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "3.3.1",
4
+ "transformers": "4.46.3",
5
+ "pytorch": "2.5.1+cu121"
6
+ },
7
+ "prompts": {},
8
+ "default_prompt_name": null,
9
+ "similarity_fn_name": "cosine"
10
+ }
modules.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_Pooling",
12
+ "type": "sentence_transformers.models.Pooling"
13
+ }
14
+ ]
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:72ebe2574cdd8fd06f1c5aeedc9d24617b3af544abd945fe7b0be12ace59b809
3
+ size 711480934
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 75,
3
+ "do_lower_case": false
4
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_basic_tokenize": true,
47
+ "do_lower_case": false,
48
+ "mask_token": "[MASK]",
49
+ "max_length": 75,
50
+ "model_max_length": 1000000000000000019884624838656,
51
+ "never_split": null,
52
+ "pad_to_multiple_of": null,
53
+ "pad_token": "[PAD]",
54
+ "pad_token_type_id": 0,
55
+ "padding_side": "right",
56
+ "sep_token": "[SEP]",
57
+ "stride": 0,
58
+ "strip_accents": null,
59
+ "tokenize_chinese_chars": true,
60
+ "tokenizer_class": "BertTokenizer",
61
+ "truncation_side": "right",
62
+ "truncation_strategy": "longest_first",
63
+ "unk_token": "[UNK]"
64
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff