harcor commited on
Commit
02faa7d
·
verified ·
1 Parent(s): 8274850

Add new SentenceTransformer model

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 384,
3
+ "pooling_mode_cls_token": false,
4
+ "pooling_mode_mean_tokens": true,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,475 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: apache-2.0
5
+ tags:
6
+ - sentence-transformers
7
+ - sentence-similarity
8
+ - feature-extraction
9
+ - generated_from_trainer
10
+ - dataset_size:100029
11
+ - loss:TripletLoss
12
+ base_model: sentence-transformers/all-MiniLM-L6-v2
13
+ widget:
14
+ - source_sentence: Can I.Q. be improved?
15
+ sentences:
16
+ - Can I.Q. be enhanced?
17
+ - Q?
18
+ - What are the career opportunities after finishing chemical engineering?
19
+ - source_sentence: How do I have sex with my friend?
20
+ sentences:
21
+ - How do I get my friend to have sex with me?
22
+ - How get offline video of YouTube in SD card?
23
+ - How do I get my girlfriend to have sex with me?
24
+ - source_sentence: Why does Quora seemingly always tell me that my questions need
25
+ improvement when they are clear and concise questions?
26
+ sentences:
27
+ - What is a good home security company?
28
+ - Why are some questions on Quora flagged as needing improvement when they don’t
29
+ need improvement?
30
+ - Why doesn't Quora have admins that can judge the quality of a question before
31
+ posting?
32
+ - source_sentence: How are communism and capitalism alike?
33
+ sentences:
34
+ - How is socialism and communism different?
35
+ - Has anyone overcome depression by themselves without external help?
36
+ - How alike are capitalism and communism?
37
+ - source_sentence: How can I solve a rubic cube 3x3x3?
38
+ sentences:
39
+ - What is the fastest possible way to lose weight?
40
+ - How do you solve a Rubik's Cube?
41
+ - How can one solve Rubik’s cube 3×3×3?
42
+ pipeline_tag: sentence-similarity
43
+ library_name: sentence-transformers
44
+ metrics:
45
+ - cosine_accuracy
46
+ model-index:
47
+ - name: all-MiniLM-L6-v2
48
+ results:
49
+ - task:
50
+ type: triplet
51
+ name: Triplet
52
+ dataset:
53
+ name: all MiniLM L6 v2 electrical
54
+ type: all-MiniLM-L6-v2-electrical
55
+ metrics:
56
+ - type: cosine_accuracy
57
+ value: 0.9807699918746948
58
+ name: Cosine Accuracy
59
+ ---
60
+
61
+ # all-MiniLM-L6-v2
62
+
63
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2). It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
64
+
65
+ ## Model Details
66
+
67
+ ### Model Description
68
+ - **Model Type:** Sentence Transformer
69
+ - **Base model:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) <!-- at revision c9745ed1d9f207416be6d2e6f8de32d1f16199bf -->
70
+ - **Maximum Sequence Length:** 256 tokens
71
+ - **Output Dimensionality:** 384 dimensions
72
+ - **Similarity Function:** Cosine Similarity
73
+ <!-- - **Training Dataset:** Unknown -->
74
+ - **Language:** en
75
+ - **License:** apache-2.0
76
+
77
+ ### Model Sources
78
+
79
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
80
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
81
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
82
+
83
+ ### Full Model Architecture
84
+
85
+ ```
86
+ SentenceTransformer(
87
+ (0): Transformer({'max_seq_length': 256, 'do_lower_case': False}) with Transformer model: BertModel
88
+ (1): Pooling({'word_embedding_dimension': 384, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
89
+ (2): Normalize()
90
+ )
91
+ ```
92
+
93
+ ## Usage
94
+
95
+ ### Direct Usage (Sentence Transformers)
96
+
97
+ First install the Sentence Transformers library:
98
+
99
+ ```bash
100
+ pip install -U sentence-transformers
101
+ ```
102
+
103
+ Then you can load this model and run inference.
104
+ ```python
105
+ from sentence_transformers import SentenceTransformer
106
+
107
+ # Download from the 🤗 Hub
108
+ model = SentenceTransformer("harcor/all-MiniLM-L6-v2-electrical")
109
+ # Run inference
110
+ sentences = [
111
+ 'How can I solve a rubic cube 3x3x3?',
112
+ 'How can one solve Rubik’s cube 3×3×3?',
113
+ "How do you solve a Rubik's Cube?",
114
+ ]
115
+ embeddings = model.encode(sentences)
116
+ print(embeddings.shape)
117
+ # [3, 384]
118
+
119
+ # Get the similarity scores for the embeddings
120
+ similarities = model.similarity(embeddings, embeddings)
121
+ print(similarities.shape)
122
+ # [3, 3]
123
+ ```
124
+
125
+ <!--
126
+ ### Direct Usage (Transformers)
127
+
128
+ <details><summary>Click to see the direct usage in Transformers</summary>
129
+
130
+ </details>
131
+ -->
132
+
133
+ <!--
134
+ ### Downstream Usage (Sentence Transformers)
135
+
136
+ You can finetune this model on your own dataset.
137
+
138
+ <details><summary>Click to expand</summary>
139
+
140
+ </details>
141
+ -->
142
+
143
+ <!--
144
+ ### Out-of-Scope Use
145
+
146
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
147
+ -->
148
+
149
+ ## Evaluation
150
+
151
+ ### Metrics
152
+
153
+ #### Triplet
154
+
155
+ * Dataset: `all-MiniLM-L6-v2-electrical`
156
+ * Evaluated with [<code>TripletEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.TripletEvaluator)
157
+
158
+ | Metric | Value |
159
+ |:--------------------|:-----------|
160
+ | **cosine_accuracy** | **0.9808** |
161
+
162
+ <!--
163
+ ## Bias, Risks and Limitations
164
+
165
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
166
+ -->
167
+
168
+ <!--
169
+ ### Recommendations
170
+
171
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
172
+ -->
173
+
174
+ ## Training Details
175
+
176
+ ### Training Dataset
177
+
178
+ #### Unnamed Dataset
179
+
180
+ * Size: 100,029 training samples
181
+ * Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
182
+ * Approximate statistics based on the first 1000 samples:
183
+ | | anchor | positive | negative |
184
+ |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
185
+ | type | string | string | string |
186
+ | details | <ul><li>min: 6 tokens</li><li>mean: 14.15 tokens</li><li>max: 42 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 13.57 tokens</li><li>max: 44 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 14.63 tokens</li><li>max: 64 tokens</li></ul> |
187
+ * Samples:
188
+ | anchor | positive | negative |
189
+ |:------------------------------------------------------------------------|:---------------------------------------------------------------|:-----------------------------|
190
+ | <code>Terminal Block, 230 A, 600 V, 3.43 in. H, 1.02 in. W, Gray</code> | <code>Terminal Block 230 A</code> | <code>Fuse Cap, 100 A</code> |
191
+ | <code>Terminal Block, 230 A, 600 V, 3.43 in. H, 1.02 in. W, Gray</code> | <code>Terminal Block 230 A terminal blocks</code> | <code>Fuse Cap, 100 A</code> |
192
+ | <code>Terminal Block, 230 A, 600 V, 3.43 in. H, 1.02 in. W, Gray</code> | <code>Terminal Block 230 A pass through terminal blocks</code> | <code>Fuse Cap, 100 A</code> |
193
+ * Loss: [<code>TripletLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#tripletloss) with these parameters:
194
+ ```json
195
+ {
196
+ "distance_metric": "TripletDistanceMetric.EUCLIDEAN",
197
+ "triplet_margin": 5
198
+ }
199
+ ```
200
+
201
+ ### Evaluation Dataset
202
+
203
+ #### Unnamed Dataset
204
+
205
+ * Size: 100,000 evaluation samples
206
+ * Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
207
+ * Approximate statistics based on the first 1000 samples:
208
+ | | anchor | positive | negative |
209
+ |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
210
+ | type | string | string | string |
211
+ | details | <ul><li>min: 6 tokens</li><li>mean: 13.85 tokens</li><li>max: 42 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 13.65 tokens</li><li>max: 44 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 14.76 tokens</li><li>max: 64 tokens</li></ul> |
212
+ * Samples:
213
+ | anchor | positive | negative |
214
+ |:--------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------|
215
+ | <code>Why in India do we not have one on one political debate as in USA?</code> | <code>Why cant we have a public debate between politicians in India like the one in US?</code> | <code>Can people on Quora stop India Pakistan debate? We are sick and tired seeing this everyday in bulk?</code> |
216
+ | <code>What is OnePlus One?</code> | <code>How is oneplus one?</code> | <code>Why is OnePlus One so good?</code> |
217
+ | <code>Does our mind control our emotions?</code> | <code>How do smart and successful people control their emotions?</code> | <code>How can I control my positive emotions for the people whom I love but they don't care about me?</code> |
218
+ * Loss: [<code>TripletLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#tripletloss) with these parameters:
219
+ ```json
220
+ {
221
+ "distance_metric": "TripletDistanceMetric.EUCLIDEAN",
222
+ "triplet_margin": 5
223
+ }
224
+ ```
225
+
226
+ ### Training Hyperparameters
227
+ #### Non-Default Hyperparameters
228
+
229
+ - `per_device_train_batch_size`: 16
230
+ - `per_device_eval_batch_size`: 16
231
+ - `num_train_epochs`: 1
232
+ - `warmup_ratio`: 0.1
233
+
234
+ #### All Hyperparameters
235
+ <details><summary>Click to expand</summary>
236
+
237
+ - `overwrite_output_dir`: False
238
+ - `do_predict`: False
239
+ - `eval_strategy`: no
240
+ - `prediction_loss_only`: True
241
+ - `per_device_train_batch_size`: 16
242
+ - `per_device_eval_batch_size`: 16
243
+ - `per_gpu_train_batch_size`: None
244
+ - `per_gpu_eval_batch_size`: None
245
+ - `gradient_accumulation_steps`: 1
246
+ - `eval_accumulation_steps`: None
247
+ - `torch_empty_cache_steps`: None
248
+ - `learning_rate`: 5e-05
249
+ - `weight_decay`: 0.0
250
+ - `adam_beta1`: 0.9
251
+ - `adam_beta2`: 0.999
252
+ - `adam_epsilon`: 1e-08
253
+ - `max_grad_norm`: 1.0
254
+ - `num_train_epochs`: 1
255
+ - `max_steps`: -1
256
+ - `lr_scheduler_type`: linear
257
+ - `lr_scheduler_kwargs`: {}
258
+ - `warmup_ratio`: 0.1
259
+ - `warmup_steps`: 0
260
+ - `log_level`: passive
261
+ - `log_level_replica`: warning
262
+ - `log_on_each_node`: True
263
+ - `logging_nan_inf_filter`: True
264
+ - `save_safetensors`: True
265
+ - `save_on_each_node`: False
266
+ - `save_only_model`: False
267
+ - `restore_callback_states_from_checkpoint`: False
268
+ - `no_cuda`: False
269
+ - `use_cpu`: False
270
+ - `use_mps_device`: False
271
+ - `seed`: 42
272
+ - `data_seed`: None
273
+ - `jit_mode_eval`: False
274
+ - `use_ipex`: False
275
+ - `bf16`: False
276
+ - `fp16`: False
277
+ - `fp16_opt_level`: O1
278
+ - `half_precision_backend`: auto
279
+ - `bf16_full_eval`: False
280
+ - `fp16_full_eval`: False
281
+ - `tf32`: None
282
+ - `local_rank`: 0
283
+ - `ddp_backend`: None
284
+ - `tpu_num_cores`: None
285
+ - `tpu_metrics_debug`: False
286
+ - `debug`: []
287
+ - `dataloader_drop_last`: False
288
+ - `dataloader_num_workers`: 0
289
+ - `dataloader_prefetch_factor`: None
290
+ - `past_index`: -1
291
+ - `disable_tqdm`: False
292
+ - `remove_unused_columns`: True
293
+ - `label_names`: None
294
+ - `load_best_model_at_end`: False
295
+ - `ignore_data_skip`: False
296
+ - `fsdp`: []
297
+ - `fsdp_min_num_params`: 0
298
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
299
+ - `fsdp_transformer_layer_cls_to_wrap`: None
300
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
301
+ - `deepspeed`: None
302
+ - `label_smoothing_factor`: 0.0
303
+ - `optim`: adamw_torch
304
+ - `optim_args`: None
305
+ - `adafactor`: False
306
+ - `group_by_length`: False
307
+ - `length_column_name`: length
308
+ - `ddp_find_unused_parameters`: None
309
+ - `ddp_bucket_cap_mb`: None
310
+ - `ddp_broadcast_buffers`: False
311
+ - `dataloader_pin_memory`: True
312
+ - `dataloader_persistent_workers`: False
313
+ - `skip_memory_metrics`: True
314
+ - `use_legacy_prediction_loop`: False
315
+ - `push_to_hub`: False
316
+ - `resume_from_checkpoint`: None
317
+ - `hub_model_id`: None
318
+ - `hub_strategy`: every_save
319
+ - `hub_private_repo`: None
320
+ - `hub_always_push`: False
321
+ - `gradient_checkpointing`: False
322
+ - `gradient_checkpointing_kwargs`: None
323
+ - `include_inputs_for_metrics`: False
324
+ - `include_for_metrics`: []
325
+ - `eval_do_concat_batches`: True
326
+ - `fp16_backend`: auto
327
+ - `push_to_hub_model_id`: None
328
+ - `push_to_hub_organization`: None
329
+ - `mp_parameters`:
330
+ - `auto_find_batch_size`: False
331
+ - `full_determinism`: False
332
+ - `torchdynamo`: None
333
+ - `ray_scope`: last
334
+ - `ddp_timeout`: 1800
335
+ - `torch_compile`: False
336
+ - `torch_compile_backend`: None
337
+ - `torch_compile_mode`: None
338
+ - `include_tokens_per_second`: False
339
+ - `include_num_input_tokens_seen`: False
340
+ - `neftune_noise_alpha`: None
341
+ - `optim_target_modules`: None
342
+ - `batch_eval_metrics`: False
343
+ - `eval_on_start`: False
344
+ - `use_liger_kernel`: False
345
+ - `eval_use_gather_object`: False
346
+ - `average_tokens_across_devices`: False
347
+ - `prompts`: None
348
+ - `batch_sampler`: batch_sampler
349
+ - `multi_dataset_batch_sampler`: proportional
350
+
351
+ </details>
352
+
353
+ ### Training Logs
354
+ | Epoch | Step | Training Loss | all-MiniLM-L6-v2-electrical_cosine_accuracy |
355
+ |:------:|:----:|:-------------:|:-------------------------------------------:|
356
+ | -1 | -1 | - | 0.9808 |
357
+ | 0.0160 | 100 | 4.7269 | - |
358
+ | 0.0320 | 200 | 4.686 | - |
359
+ | 0.0480 | 300 | 4.6204 | - |
360
+ | 0.0640 | 400 | 4.5606 | - |
361
+ | 0.0800 | 500 | 4.5176 | - |
362
+ | 0.0960 | 600 | 4.4588 | - |
363
+ | 0.1120 | 700 | 4.417 | - |
364
+ | 0.1280 | 800 | 4.4144 | - |
365
+ | 0.1440 | 900 | 4.4004 | - |
366
+ | 0.1599 | 1000 | 4.3835 | - |
367
+ | 0.1759 | 1100 | 4.379 | - |
368
+ | 0.1919 | 1200 | 4.3828 | - |
369
+ | 0.2079 | 1300 | 4.3581 | - |
370
+ | 0.2239 | 1400 | 4.3502 | - |
371
+ | 0.2399 | 1500 | 4.3155 | - |
372
+ | 0.2559 | 1600 | 4.3204 | - |
373
+ | 0.2719 | 1700 | 4.3403 | - |
374
+ | 0.2879 | 1800 | 4.3195 | - |
375
+ | 0.3039 | 1900 | 4.2989 | - |
376
+ | 0.3199 | 2000 | 4.2871 | - |
377
+ | 0.3359 | 2100 | 4.2939 | - |
378
+ | 0.3519 | 2200 | 4.2906 | - |
379
+ | 0.3679 | 2300 | 4.2729 | - |
380
+ | 0.3839 | 2400 | 4.2765 | - |
381
+ | 0.3999 | 2500 | 4.2642 | - |
382
+ | 0.4159 | 2600 | 4.2629 | - |
383
+ | 0.4319 | 2700 | 4.276 | - |
384
+ | 0.4479 | 2800 | 4.276 | - |
385
+ | 0.4639 | 2900 | 4.2204 | - |
386
+ | 0.4798 | 3000 | 4.2556 | - |
387
+ | 0.4958 | 3100 | 4.2484 | - |
388
+ | 0.5118 | 3200 | 4.2004 | - |
389
+ | 0.5278 | 3300 | 4.2181 | - |
390
+ | 0.5438 | 3400 | 4.2097 | - |
391
+ | 0.5598 | 3500 | 4.2107 | - |
392
+ | 0.5758 | 3600 | 4.1949 | - |
393
+ | 0.5918 | 3700 | 4.2378 | - |
394
+ | 0.6078 | 3800 | 4.2098 | - |
395
+ | 0.6238 | 3900 | 4.196 | - |
396
+ | 0.6398 | 4000 | 4.1635 | - |
397
+ | 0.6558 | 4100 | 4.1946 | - |
398
+ | 0.6718 | 4200 | 4.1993 | - |
399
+ | 0.6878 | 4300 | 4.1971 | - |
400
+ | 0.7038 | 4400 | 4.2104 | - |
401
+ | 0.7198 | 4500 | 4.2174 | - |
402
+ | 0.7358 | 4600 | 4.1854 | - |
403
+ | 0.7518 | 4700 | 4.1834 | - |
404
+ | 0.7678 | 4800 | 4.1829 | - |
405
+ | 0.7837 | 4900 | 4.1831 | - |
406
+ | 0.7997 | 5000 | 4.1927 | - |
407
+ | 0.8157 | 5100 | 4.1746 | - |
408
+ | 0.8317 | 5200 | 4.1477 | - |
409
+ | 0.8477 | 5300 | 4.1748 | - |
410
+ | 0.8637 | 5400 | 4.1713 | - |
411
+ | 0.8797 | 5500 | 4.1313 | - |
412
+ | 0.8957 | 5600 | 4.1529 | - |
413
+ | 0.9117 | 5700 | 4.2078 | - |
414
+ | 0.9277 | 5800 | 4.1546 | - |
415
+ | 0.9437 | 5900 | 4.1684 | - |
416
+ | 0.9597 | 6000 | 4.1594 | - |
417
+ | 0.9757 | 6100 | 4.1426 | - |
418
+ | 0.9917 | 6200 | 4.1299 | - |
419
+
420
+
421
+ ### Framework Versions
422
+ - Python: 3.12.3
423
+ - Sentence Transformers: 4.1.0
424
+ - Transformers: 4.52.4
425
+ - PyTorch: 2.7.1+cu118
426
+ - Accelerate: 1.8.1
427
+ - Datasets: 3.6.0
428
+ - Tokenizers: 0.21.2
429
+
430
+ ## Citation
431
+
432
+ ### BibTeX
433
+
434
+ #### Sentence Transformers
435
+ ```bibtex
436
+ @inproceedings{reimers-2019-sentence-bert,
437
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
438
+ author = "Reimers, Nils and Gurevych, Iryna",
439
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
440
+ month = "11",
441
+ year = "2019",
442
+ publisher = "Association for Computational Linguistics",
443
+ url = "https://arxiv.org/abs/1908.10084",
444
+ }
445
+ ```
446
+
447
+ #### TripletLoss
448
+ ```bibtex
449
+ @misc{hermans2017defense,
450
+ title={In Defense of the Triplet Loss for Person Re-Identification},
451
+ author={Alexander Hermans and Lucas Beyer and Bastian Leibe},
452
+ year={2017},
453
+ eprint={1703.07737},
454
+ archivePrefix={arXiv},
455
+ primaryClass={cs.CV}
456
+ }
457
+ ```
458
+
459
+ <!--
460
+ ## Glossary
461
+
462
+ *Clearly define terms in order to be accessible across audiences.*
463
+ -->
464
+
465
+ <!--
466
+ ## Model Card Authors
467
+
468
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
469
+ -->
470
+
471
+ <!--
472
+ ## Model Card Contact
473
+
474
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
475
+ -->
config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertModel"
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": 384,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 1536,
13
+ "layer_norm_eps": 1e-12,
14
+ "max_position_embeddings": 512,
15
+ "model_type": "bert",
16
+ "num_attention_heads": 12,
17
+ "num_hidden_layers": 6,
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
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "4.1.0",
4
+ "transformers": "4.52.4",
5
+ "pytorch": "2.7.1+cu118"
6
+ },
7
+ "prompts": {},
8
+ "default_prompt_name": null,
9
+ "similarity_fn_name": "cosine"
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:564a8256420e41d9438b53ca36b1f04392d577660f0488e34e5a3936f41a1c35
3
+ size 90864192
modules.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ {
15
+ "idx": 2,
16
+ "name": "2",
17
+ "path": "2_Normalize",
18
+ "type": "sentence_transformers.models.Normalize"
19
+ }
20
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 256,
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,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": true,
48
+ "extra_special_tokens": {},
49
+ "mask_token": "[MASK]",
50
+ "max_length": 128,
51
+ "model_max_length": 256,
52
+ "never_split": null,
53
+ "pad_to_multiple_of": null,
54
+ "pad_token": "[PAD]",
55
+ "pad_token_type_id": 0,
56
+ "padding_side": "right",
57
+ "sep_token": "[SEP]",
58
+ "stride": 0,
59
+ "strip_accents": null,
60
+ "tokenize_chinese_chars": true,
61
+ "tokenizer_class": "BertTokenizer",
62
+ "truncation_side": "right",
63
+ "truncation_strategy": "longest_first",
64
+ "unk_token": "[UNK]"
65
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff