manestay commited on
Commit
f129648
·
verified ·
1 Parent(s): 4046457

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": true,
4
+ "pooling_mode_mean_tokens": false,
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,667 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ tags:
5
+ - sentence-transformers
6
+ - sentence-similarity
7
+ - feature-extraction
8
+ - generated_from_trainer
9
+ - dataset_size:200000
10
+ - loss:MultipleNegativesRankingLoss
11
+ - loss:ContrastiveLoss
12
+ base_model: BAAI/bge-base-en-v1.5
13
+ widget:
14
+ - source_sentence: What is the best sushi restaurant in Los Angeles, aside from Urasawa
15
+ which is impractical for regular visits?
16
+ sentences:
17
+ - How do I stop feeling sorry for ignorant and arrogant people?
18
+ - What are the best sushi restaurants in Los Angeles?
19
+ - Why do people flirt on Quora?
20
+ - source_sentence: Why are many Quora writers lonely and/ or unemployed?
21
+ sentences:
22
+ - Are writers on Quora mostly lonely or have no job (unemployed)?
23
+ - What are the attributes of monkeys belongs to Japanese-macaque monkey Family?
24
+ - I want to change the education system in India. How can I have such power?
25
+ - source_sentence: What is the best, and painless way to kill myself?
26
+ sentences:
27
+ - What is a way to commit suicide and not damaging your organs so that they can
28
+ be donated?
29
+ - How do I beat insomnia?
30
+ - What is the most painless way to commit suicide?
31
+ - source_sentence: What are ETF'S and what is the difference between ETF'S and mutual
32
+ funds?
33
+ sentences:
34
+ - What is the difference between ETF and mutual funds?
35
+ - What's better, an index ETF or an index mutual fund?
36
+ - 'Income Tax: How to check pan card status?'
37
+ - source_sentence: For what reasons can't the Olympics be held in India?
38
+ sentences:
39
+ - What are the best hotels to stay in Goa?
40
+ - When will Olympics be held in India?
41
+ - When will India qualify for the FIFA World Cup?
42
+ datasets:
43
+ - sentence-transformers/quora-duplicates
44
+ pipeline_tag: sentence-similarity
45
+ library_name: sentence-transformers
46
+ metrics:
47
+ - cosine_accuracy
48
+ - cosine_accuracy_threshold
49
+ - cosine_f1
50
+ - cosine_f1_threshold
51
+ - cosine_precision
52
+ - cosine_recall
53
+ - cosine_ap
54
+ - cosine_mcc
55
+ - average_precision
56
+ - f1
57
+ - precision
58
+ - recall
59
+ - threshold
60
+ - cosine_accuracy@1
61
+ - cosine_accuracy@3
62
+ - cosine_accuracy@5
63
+ - cosine_accuracy@10
64
+ - cosine_precision@1
65
+ - cosine_precision@3
66
+ - cosine_precision@5
67
+ - cosine_precision@10
68
+ - cosine_recall@1
69
+ - cosine_recall@3
70
+ - cosine_recall@5
71
+ - cosine_recall@10
72
+ - cosine_ndcg@10
73
+ - cosine_mrr@10
74
+ - cosine_map@100
75
+ model-index:
76
+ - name: SentenceTransformer based on BAAI/bge-base-en-v1.5
77
+ results:
78
+ - task:
79
+ type: binary-classification
80
+ name: Binary Classification
81
+ dataset:
82
+ name: quora duplicates
83
+ type: quora-duplicates
84
+ metrics:
85
+ - type: cosine_accuracy
86
+ value: 0.833
87
+ name: Cosine Accuracy
88
+ - type: cosine_accuracy_threshold
89
+ value: 0.8065301179885864
90
+ name: Cosine Accuracy Threshold
91
+ - type: cosine_f1
92
+ value: 0.7630522088353413
93
+ name: Cosine F1
94
+ - type: cosine_f1_threshold
95
+ value: 0.745335042476654
96
+ name: Cosine F1 Threshold
97
+ - type: cosine_precision
98
+ value: 0.6705882352941176
99
+ name: Cosine Precision
100
+ - type: cosine_recall
101
+ value: 0.8850931677018633
102
+ name: Cosine Recall
103
+ - type: cosine_ap
104
+ value: 0.8120519897128382
105
+ name: Cosine Ap
106
+ - type: cosine_mcc
107
+ value: 0.641402259734116
108
+ name: Cosine Mcc
109
+ - task:
110
+ type: paraphrase-mining
111
+ name: Paraphrase Mining
112
+ dataset:
113
+ name: quora duplicates dev
114
+ type: quora-duplicates-dev
115
+ metrics:
116
+ - type: average_precision
117
+ value: 0.6286866338232051
118
+ name: Average Precision
119
+ - type: f1
120
+ value: 0.6032452480296708
121
+ name: F1
122
+ - type: precision
123
+ value: 0.5627297495999654
124
+ name: Precision
125
+ - type: recall
126
+ value: 0.6500474596592896
127
+ name: Recall
128
+ - type: threshold
129
+ value: 0.7944510877132416
130
+ name: Threshold
131
+ - task:
132
+ type: information-retrieval
133
+ name: Information Retrieval
134
+ dataset:
135
+ name: Unknown
136
+ type: unknown
137
+ metrics:
138
+ - type: cosine_accuracy@1
139
+ value: 0.9732
140
+ name: Cosine Accuracy@1
141
+ - type: cosine_accuracy@3
142
+ value: 0.9944
143
+ name: Cosine Accuracy@3
144
+ - type: cosine_accuracy@5
145
+ value: 0.9958
146
+ name: Cosine Accuracy@5
147
+ - type: cosine_accuracy@10
148
+ value: 0.9994
149
+ name: Cosine Accuracy@10
150
+ - type: cosine_precision@1
151
+ value: 0.9732
152
+ name: Cosine Precision@1
153
+ - type: cosine_precision@3
154
+ value: 0.432
155
+ name: Cosine Precision@3
156
+ - type: cosine_precision@5
157
+ value: 0.27652
158
+ name: Cosine Precision@5
159
+ - type: cosine_precision@10
160
+ value: 0.14606
161
+ name: Cosine Precision@10
162
+ - type: cosine_recall@1
163
+ value: 0.8392449568046333
164
+ name: Cosine Recall@1
165
+ - type: cosine_recall@3
166
+ value: 0.9654790046130339
167
+ name: Cosine Recall@3
168
+ - type: cosine_recall@5
169
+ value: 0.9826052435636259
170
+ name: Cosine Recall@5
171
+ - type: cosine_recall@10
172
+ value: 0.9955256342023989
173
+ name: Cosine Recall@10
174
+ - type: cosine_ndcg@10
175
+ value: 0.9852328208350886
176
+ name: Cosine Ndcg@10
177
+ - type: cosine_mrr@10
178
+ value: 0.983879365079365
179
+ name: Cosine Mrr@10
180
+ - type: cosine_map@100
181
+ value: 0.9794253454223505
182
+ name: Cosine Map@100
183
+ ---
184
+
185
+ # SentenceTransformer based on BAAI/bge-base-en-v1.5
186
+
187
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [BAAI/bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5) on the [mnrl](https://huggingface.co/datasets/sentence-transformers/quora-duplicates) and [cl](https://huggingface.co/datasets/sentence-transformers/quora-duplicates) datasets. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
188
+
189
+ ## Model Details
190
+
191
+ ### Model Description
192
+ - **Model Type:** Sentence Transformer
193
+ - **Base model:** [BAAI/bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5) <!-- at revision a5beb1e3e68b9ab74eb54cfd186867f64f240e1a -->
194
+ - **Maximum Sequence Length:** 512 tokens
195
+ - **Output Dimensionality:** 768 dimensions
196
+ - **Similarity Function:** Cosine Similarity
197
+ - **Training Datasets:**
198
+ - [mnrl](https://huggingface.co/datasets/sentence-transformers/quora-duplicates)
199
+ - [cl](https://huggingface.co/datasets/sentence-transformers/quora-duplicates)
200
+ - **Language:** en
201
+ <!-- - **License:** Unknown -->
202
+
203
+ ### Model Sources
204
+
205
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
206
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
207
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
208
+
209
+ ### Full Model Architecture
210
+
211
+ ```
212
+ SentenceTransformer(
213
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': True}) with Transformer model: BertModel
214
+ (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
215
+ (2): Normalize()
216
+ )
217
+ ```
218
+
219
+ ## Usage
220
+
221
+ ### Direct Usage (Sentence Transformers)
222
+
223
+ First install the Sentence Transformers library:
224
+
225
+ ```bash
226
+ pip install -U sentence-transformers
227
+ ```
228
+
229
+ Then you can load this model and run inference.
230
+ ```python
231
+ from sentence_transformers import SentenceTransformer
232
+
233
+ # Download from the 🤗 Hub
234
+ model = SentenceTransformer("manestay/bge-base-en-v1.5-mnrl-cl-multi")
235
+ # Run inference
236
+ sentences = [
237
+ "For what reasons can't the Olympics be held in India?",
238
+ 'When will Olympics be held in India?',
239
+ 'When will India qualify for the FIFA World Cup?',
240
+ ]
241
+ embeddings = model.encode(sentences)
242
+ print(embeddings.shape)
243
+ # [3, 768]
244
+
245
+ # Get the similarity scores for the embeddings
246
+ similarities = model.similarity(embeddings, embeddings)
247
+ print(similarities.shape)
248
+ # [3, 3]
249
+ ```
250
+
251
+ <!--
252
+ ### Direct Usage (Transformers)
253
+
254
+ <details><summary>Click to see the direct usage in Transformers</summary>
255
+
256
+ </details>
257
+ -->
258
+
259
+ <!--
260
+ ### Downstream Usage (Sentence Transformers)
261
+
262
+ You can finetune this model on your own dataset.
263
+
264
+ <details><summary>Click to expand</summary>
265
+
266
+ </details>
267
+ -->
268
+
269
+ <!--
270
+ ### Out-of-Scope Use
271
+
272
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
273
+ -->
274
+
275
+ ## Evaluation
276
+
277
+ ### Metrics
278
+
279
+ #### Binary Classification
280
+
281
+ * Dataset: `quora-duplicates`
282
+ * Evaluated with [<code>BinaryClassificationEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.BinaryClassificationEvaluator)
283
+
284
+ | Metric | Value |
285
+ |:--------------------------|:-----------|
286
+ | cosine_accuracy | 0.833 |
287
+ | cosine_accuracy_threshold | 0.8065 |
288
+ | cosine_f1 | 0.7631 |
289
+ | cosine_f1_threshold | 0.7453 |
290
+ | cosine_precision | 0.6706 |
291
+ | cosine_recall | 0.8851 |
292
+ | **cosine_ap** | **0.8121** |
293
+ | cosine_mcc | 0.6414 |
294
+
295
+ #### Paraphrase Mining
296
+
297
+ * Dataset: `quora-duplicates-dev`
298
+ * Evaluated with [<code>ParaphraseMiningEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.ParaphraseMiningEvaluator) with these parameters:
299
+ ```json
300
+ {'add_transitive_closure': <function ParaphraseMiningEvaluator.add_transitive_closure at 0x7f26a89802c0>, 'max_pairs': 500000, 'top_k': 100}
301
+ ```
302
+
303
+ | Metric | Value |
304
+ |:----------------------|:-----------|
305
+ | **average_precision** | **0.6287** |
306
+ | f1 | 0.6032 |
307
+ | precision | 0.5627 |
308
+ | recall | 0.65 |
309
+ | threshold | 0.7945 |
310
+
311
+ #### Information Retrieval
312
+
313
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
314
+
315
+ | Metric | Value |
316
+ |:--------------------|:-----------|
317
+ | cosine_accuracy@1 | 0.9732 |
318
+ | cosine_accuracy@3 | 0.9944 |
319
+ | cosine_accuracy@5 | 0.9958 |
320
+ | cosine_accuracy@10 | 0.9994 |
321
+ | cosine_precision@1 | 0.9732 |
322
+ | cosine_precision@3 | 0.432 |
323
+ | cosine_precision@5 | 0.2765 |
324
+ | cosine_precision@10 | 0.1461 |
325
+ | cosine_recall@1 | 0.8392 |
326
+ | cosine_recall@3 | 0.9655 |
327
+ | cosine_recall@5 | 0.9826 |
328
+ | cosine_recall@10 | 0.9955 |
329
+ | **cosine_ndcg@10** | **0.9852** |
330
+ | cosine_mrr@10 | 0.9839 |
331
+ | cosine_map@100 | 0.9794 |
332
+
333
+ <!--
334
+ ## Bias, Risks and Limitations
335
+
336
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
337
+ -->
338
+
339
+ <!--
340
+ ### Recommendations
341
+
342
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
343
+ -->
344
+
345
+ ## Training Details
346
+
347
+ ### Training Datasets
348
+
349
+ #### mnrl
350
+
351
+ * Dataset: [mnrl](https://huggingface.co/datasets/sentence-transformers/quora-duplicates) at [451a485](https://huggingface.co/datasets/sentence-transformers/quora-duplicates/tree/451a4850bd141edb44ade1b5828c259abd762cdb)
352
+ * Size: 100,000 training samples
353
+ * Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
354
+ * Approximate statistics based on the first 1000 samples:
355
+ | | anchor | positive | negative |
356
+ |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
357
+ | type | string | string | string |
358
+ | 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> |
359
+ * Samples:
360
+ | anchor | positive | negative |
361
+ |:--------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------|
362
+ | <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> |
363
+ | <code>What is OnePlus One?</code> | <code>How is oneplus one?</code> | <code>Why is OnePlus One so good?</code> |
364
+ | <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> |
365
+ * Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
366
+ ```json
367
+ {
368
+ "scale": 20.0,
369
+ "similarity_fct": "cos_sim"
370
+ }
371
+ ```
372
+
373
+ #### cl
374
+
375
+ * Dataset: [cl](https://huggingface.co/datasets/sentence-transformers/quora-duplicates) at [451a485](https://huggingface.co/datasets/sentence-transformers/quora-duplicates/tree/451a4850bd141edb44ade1b5828c259abd762cdb)
376
+ * Size: 100,000 training samples
377
+ * Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>label</code>
378
+ * Approximate statistics based on the first 1000 samples:
379
+ | | sentence1 | sentence2 | label |
380
+ |:--------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:------------------------------------------------|
381
+ | type | string | string | int |
382
+ | details | <ul><li>min: 6 tokens</li><li>mean: 15.3 tokens</li><li>max: 57 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 15.66 tokens</li><li>max: 56 tokens</li></ul> | <ul><li>0: ~62.00%</li><li>1: ~38.00%</li></ul> |
383
+ * Samples:
384
+ | sentence1 | sentence2 | label |
385
+ |:---------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------|:---------------|
386
+ | <code>What is the step by step guide to invest in share market in india?</code> | <code>What is the step by step guide to invest in share market?</code> | <code>0</code> |
387
+ | <code>What is the story of Kohinoor (Koh-i-Noor) Diamond?</code> | <code>What would happen if the Indian government stole the Kohinoor (Koh-i-Noor) diamond back?</code> | <code>0</code> |
388
+ | <code>How can I increase the speed of my internet connection while using a VPN?</code> | <code>How can Internet speed be increased by hacking through DNS?</code> | <code>0</code> |
389
+ * Loss: [<code>ContrastiveLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#contrastiveloss) with these parameters:
390
+ ```json
391
+ {
392
+ "distance_metric": "SiameseDistanceMetric.COSINE_DISTANCE",
393
+ "margin": 0.5,
394
+ "size_average": true
395
+ }
396
+ ```
397
+
398
+ ### Evaluation Datasets
399
+
400
+ #### mnrl
401
+
402
+ * Dataset: [mnrl](https://huggingface.co/datasets/sentence-transformers/quora-duplicates) at [451a485](https://huggingface.co/datasets/sentence-transformers/quora-duplicates/tree/451a4850bd141edb44ade1b5828c259abd762cdb)
403
+ * Size: 1,000 evaluation samples
404
+ * Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
405
+ * Approximate statistics based on the first 1000 samples:
406
+ | | anchor | positive | negative |
407
+ |:--------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
408
+ | type | string | string | string |
409
+ | details | <ul><li>min: 7 tokens</li><li>mean: 13.84 tokens</li><li>max: 43 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 13.8 tokens</li><li>max: 38 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 14.71 tokens</li><li>max: 56 tokens</li></ul> |
410
+ * Samples:
411
+ | anchor | positive | negative |
412
+ |:---------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
413
+ | <code>Which programming language is best for developing low-end games?</code> | <code>What coding language should I learn first for making games?</code> | <code>I am entering the world of video game programming and want to know what language I should learn? Because there are so many languages ​​I do not know which one to start with. Can you recommend a language that's easy to learn and can be used with many platforms?</code> |
414
+ | <code>Was it appropriate for Meryl Streep to use her Golden Globes speech to attack Donald Trump?</code> | <code>Should Meryl Streep be using her position to attack the president?</code> | <code>Why did Kelly Ann Conway say that Meryl Streep incited peoples worst feelings?</code> |
415
+ | <code>Where can I found excellent commercial fridges in Sydney?</code> | <code>Where can I found impressive range of commercial fridges in Sydney?</code> | <code>What is the best grocery delivery service in Sydney?</code> |
416
+ * Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
417
+ ```json
418
+ {
419
+ "scale": 20.0,
420
+ "similarity_fct": "cos_sim"
421
+ }
422
+ ```
423
+
424
+ #### cl
425
+
426
+ * Dataset: [cl](https://huggingface.co/datasets/sentence-transformers/quora-duplicates) at [451a485](https://huggingface.co/datasets/sentence-transformers/quora-duplicates/tree/451a4850bd141edb44ade1b5828c259abd762cdb)
427
+ * Size: 1,000 evaluation samples
428
+ * Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>label</code>
429
+ * Approximate statistics based on the first 1000 samples:
430
+ | | sentence1 | sentence2 | label |
431
+ |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:------------------------------------------------|
432
+ | type | string | string | int |
433
+ | details | <ul><li>min: 5 tokens</li><li>mean: 15.59 tokens</li><li>max: 59 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 15.65 tokens</li><li>max: 76 tokens</li></ul> | <ul><li>0: ~63.40%</li><li>1: ~36.60%</li></ul> |
434
+ * Samples:
435
+ | sentence1 | sentence2 | label |
436
+ |:--------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------|:---------------|
437
+ | <code>What should I ask my friend to get from UK to India?</code> | <code>What is the process of getting a surgical residency in UK after completing MBBS from India?</code> | <code>0</code> |
438
+ | <code>How can I learn hacking for free?</code> | <code>How can I learn to hack seriously?</code> | <code>1</code> |
439
+ | <code>Which is the best website to learn programming language C++?</code> | <code>Which is the best website to learn C++ Programming language for free?</code> | <code>0</code> |
440
+ * Loss: [<code>ContrastiveLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#contrastiveloss) with these parameters:
441
+ ```json
442
+ {
443
+ "distance_metric": "SiameseDistanceMetric.COSINE_DISTANCE",
444
+ "margin": 0.5,
445
+ "size_average": true
446
+ }
447
+ ```
448
+
449
+ ### Training Hyperparameters
450
+ #### Non-Default Hyperparameters
451
+
452
+ - `eval_strategy`: steps
453
+ - `per_device_train_batch_size`: 400
454
+ - `per_device_eval_batch_size`: 400
455
+ - `num_train_epochs`: 100
456
+ - `warmup_ratio`: 0.1
457
+ - `bf16`: True
458
+ - `load_best_model_at_end`: True
459
+ - `batch_sampler`: no_duplicates
460
+
461
+ #### All Hyperparameters
462
+ <details><summary>Click to expand</summary>
463
+
464
+ - `overwrite_output_dir`: False
465
+ - `do_predict`: False
466
+ - `eval_strategy`: steps
467
+ - `prediction_loss_only`: True
468
+ - `per_device_train_batch_size`: 400
469
+ - `per_device_eval_batch_size`: 400
470
+ - `per_gpu_train_batch_size`: None
471
+ - `per_gpu_eval_batch_size`: None
472
+ - `gradient_accumulation_steps`: 1
473
+ - `eval_accumulation_steps`: None
474
+ - `torch_empty_cache_steps`: None
475
+ - `learning_rate`: 5e-05
476
+ - `weight_decay`: 0.0
477
+ - `adam_beta1`: 0.9
478
+ - `adam_beta2`: 0.999
479
+ - `adam_epsilon`: 1e-08
480
+ - `max_grad_norm`: 1.0
481
+ - `num_train_epochs`: 100
482
+ - `max_steps`: -1
483
+ - `lr_scheduler_type`: linear
484
+ - `lr_scheduler_kwargs`: {}
485
+ - `warmup_ratio`: 0.1
486
+ - `warmup_steps`: 0
487
+ - `log_level`: passive
488
+ - `log_level_replica`: warning
489
+ - `log_on_each_node`: True
490
+ - `logging_nan_inf_filter`: True
491
+ - `save_safetensors`: True
492
+ - `save_on_each_node`: False
493
+ - `save_only_model`: False
494
+ - `restore_callback_states_from_checkpoint`: False
495
+ - `no_cuda`: False
496
+ - `use_cpu`: False
497
+ - `use_mps_device`: False
498
+ - `seed`: 42
499
+ - `data_seed`: None
500
+ - `jit_mode_eval`: False
501
+ - `use_ipex`: False
502
+ - `bf16`: True
503
+ - `fp16`: False
504
+ - `fp16_opt_level`: O1
505
+ - `half_precision_backend`: auto
506
+ - `bf16_full_eval`: False
507
+ - `fp16_full_eval`: False
508
+ - `tf32`: None
509
+ - `local_rank`: 0
510
+ - `ddp_backend`: None
511
+ - `tpu_num_cores`: None
512
+ - `tpu_metrics_debug`: False
513
+ - `debug`: []
514
+ - `dataloader_drop_last`: False
515
+ - `dataloader_num_workers`: 0
516
+ - `dataloader_prefetch_factor`: None
517
+ - `past_index`: -1
518
+ - `disable_tqdm`: False
519
+ - `remove_unused_columns`: True
520
+ - `label_names`: None
521
+ - `load_best_model_at_end`: True
522
+ - `ignore_data_skip`: False
523
+ - `fsdp`: []
524
+ - `fsdp_min_num_params`: 0
525
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
526
+ - `fsdp_transformer_layer_cls_to_wrap`: None
527
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
528
+ - `deepspeed`: None
529
+ - `label_smoothing_factor`: 0.0
530
+ - `optim`: adamw_torch
531
+ - `optim_args`: None
532
+ - `adafactor`: False
533
+ - `group_by_length`: False
534
+ - `length_column_name`: length
535
+ - `ddp_find_unused_parameters`: None
536
+ - `ddp_bucket_cap_mb`: None
537
+ - `ddp_broadcast_buffers`: False
538
+ - `dataloader_pin_memory`: True
539
+ - `dataloader_persistent_workers`: False
540
+ - `skip_memory_metrics`: True
541
+ - `use_legacy_prediction_loop`: False
542
+ - `push_to_hub`: False
543
+ - `resume_from_checkpoint`: None
544
+ - `hub_model_id`: None
545
+ - `hub_strategy`: every_save
546
+ - `hub_private_repo`: None
547
+ - `hub_always_push`: False
548
+ - `gradient_checkpointing`: False
549
+ - `gradient_checkpointing_kwargs`: None
550
+ - `include_inputs_for_metrics`: False
551
+ - `include_for_metrics`: []
552
+ - `eval_do_concat_batches`: True
553
+ - `fp16_backend`: auto
554
+ - `push_to_hub_model_id`: None
555
+ - `push_to_hub_organization`: None
556
+ - `mp_parameters`:
557
+ - `auto_find_batch_size`: False
558
+ - `full_determinism`: False
559
+ - `torchdynamo`: None
560
+ - `ray_scope`: last
561
+ - `ddp_timeout`: 1800
562
+ - `torch_compile`: False
563
+ - `torch_compile_backend`: None
564
+ - `torch_compile_mode`: None
565
+ - `include_tokens_per_second`: False
566
+ - `include_num_input_tokens_seen`: False
567
+ - `neftune_noise_alpha`: None
568
+ - `optim_target_modules`: None
569
+ - `batch_eval_metrics`: False
570
+ - `eval_on_start`: False
571
+ - `use_liger_kernel`: False
572
+ - `eval_use_gather_object`: False
573
+ - `average_tokens_across_devices`: False
574
+ - `prompts`: None
575
+ - `batch_sampler`: no_duplicates
576
+ - `multi_dataset_batch_sampler`: proportional
577
+
578
+ </details>
579
+
580
+ ### Training Logs
581
+ | Epoch | Step | Training Loss | mnrl loss | cl loss | quora-duplicates_cosine_ap | quora-duplicates-dev_average_precision | cosine_ndcg@10 |
582
+ |:-------:|:-------:|:-------------:|:----------:|:----------:|:--------------------------:|:--------------------------------------:|:--------------:|
583
+ | 0 | 0 | - | - | - | 0.7461 | 0.5988 | 0.9831 |
584
+ | 0.2 | 100 | 0.2804 | - | - | - | - | - |
585
+ | 0.4 | 200 | 0.2006 | - | - | - | - | - |
586
+ | **0.5** | **250** | **-** | **0.1153** | **0.0157** | **0.7661** | **0.6165** | **0.9839** |
587
+ | 0.6 | 300 | 0.1704 | - | - | - | - | - |
588
+ | 0.8 | 400 | 0.1459 | - | - | - | - | - |
589
+ | 1.0 | 500 | 0.1296 | 0.0835 | 0.0146 | 0.7860 | 0.6238 | 0.9843 |
590
+ | 1.2 | 600 | 0.1344 | - | - | - | - | - |
591
+ | 1.4 | 700 | 0.1181 | - | - | - | - | - |
592
+ | 1.5 | 750 | - | 0.0737 | 0.0139 | 0.7983 | 0.6263 | 0.9847 |
593
+ | 1.6 | 800 | 0.1176 | - | - | - | - | - |
594
+ | 1.8 | 900 | 0.119 | - | - | - | - | - |
595
+ | 2.0 | 1000 | 0.1127 | 0.0682 | 0.0133 | 0.8121 | 0.6287 | 0.9852 |
596
+
597
+ * The bold row denotes the saved checkpoint.
598
+
599
+ ### Framework Versions
600
+ - Python: 3.12.9
601
+ - Sentence Transformers: 4.1.0
602
+ - Transformers: 4.52.4
603
+ - PyTorch: 2.7.0+cu126
604
+ - Accelerate: 1.7.0
605
+ - Datasets: 3.6.0
606
+ - Tokenizers: 0.21.1
607
+
608
+ ## Citation
609
+
610
+ ### BibTeX
611
+
612
+ #### Sentence Transformers
613
+ ```bibtex
614
+ @inproceedings{reimers-2019-sentence-bert,
615
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
616
+ author = "Reimers, Nils and Gurevych, Iryna",
617
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
618
+ month = "11",
619
+ year = "2019",
620
+ publisher = "Association for Computational Linguistics",
621
+ url = "https://arxiv.org/abs/1908.10084",
622
+ }
623
+ ```
624
+
625
+ #### MultipleNegativesRankingLoss
626
+ ```bibtex
627
+ @misc{henderson2017efficient,
628
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
629
+ 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},
630
+ year={2017},
631
+ eprint={1705.00652},
632
+ archivePrefix={arXiv},
633
+ primaryClass={cs.CL}
634
+ }
635
+ ```
636
+
637
+ #### ContrastiveLoss
638
+ ```bibtex
639
+ @inproceedings{hadsell2006dimensionality,
640
+ author={Hadsell, R. and Chopra, S. and LeCun, Y.},
641
+ booktitle={2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'06)},
642
+ title={Dimensionality Reduction by Learning an Invariant Mapping},
643
+ year={2006},
644
+ volume={2},
645
+ number={},
646
+ pages={1735-1742},
647
+ doi={10.1109/CVPR.2006.100}
648
+ }
649
+ ```
650
+
651
+ <!--
652
+ ## Glossary
653
+
654
+ *Clearly define terms in order to be accessible across audiences.*
655
+ -->
656
+
657
+ <!--
658
+ ## Model Card Authors
659
+
660
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
661
+ -->
662
+
663
+ <!--
664
+ ## Model Card Contact
665
+
666
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
667
+ -->
config.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": 768,
11
+ "id2label": {
12
+ "0": "LABEL_0"
13
+ },
14
+ "initializer_range": 0.02,
15
+ "intermediate_size": 3072,
16
+ "label2id": {
17
+ "LABEL_0": 0
18
+ },
19
+ "layer_norm_eps": 1e-12,
20
+ "max_position_embeddings": 512,
21
+ "model_type": "bert",
22
+ "num_attention_heads": 12,
23
+ "num_hidden_layers": 12,
24
+ "pad_token_id": 0,
25
+ "position_embedding_type": "absolute",
26
+ "torch_dtype": "float32",
27
+ "transformers_version": "4.52.4",
28
+ "type_vocab_size": 2,
29
+ "use_cache": true,
30
+ "vocab_size": 30522
31
+ }
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.0+cu126"
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:6510da6087f7e7976b49ffaa9f4ab1f43d7334dad1a8c8ff392184ad61761c51
3
+ size 437951328
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": 512,
3
+ "do_lower_case": true
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,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": true,
45
+ "cls_token": "[CLS]",
46
+ "do_basic_tokenize": true,
47
+ "do_lower_case": true,
48
+ "extra_special_tokens": {},
49
+ "mask_token": "[MASK]",
50
+ "model_max_length": 512,
51
+ "never_split": null,
52
+ "pad_token": "[PAD]",
53
+ "sep_token": "[SEP]",
54
+ "strip_accents": null,
55
+ "tokenize_chinese_chars": true,
56
+ "tokenizer_class": "BertTokenizer",
57
+ "unk_token": "[UNK]"
58
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff