Add new SentenceTransformer model.
Browse files- 1_Pooling/config.json +10 -0
- 2_Dense/config.json +1 -0
- 2_Dense/model.safetensors +3 -0
- README.md +545 -0
- config.json +25 -0
- config_sentence_transformers.json +10 -0
- model.safetensors +3 -0
- modules.json +26 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +57 -0
- vocab.txt +0 -0
1_Pooling/config.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"word_embedding_dimension": 128,
|
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 |
+
}
|
2_Dense/config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"in_features": 128, "out_features": 256, "bias": true, "activation_function": "torch.nn.modules.activation.Tanh"}
|
2_Dense/model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:14cb75a0da4e4e40b794db41312104d5cceb3f8426d5548209e8ba0d33f3b979
|
3 |
+
size 132256
|
README.md
ADDED
@@ -0,0 +1,545 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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_cosine
|
8 |
+
- spearman_cosine
|
9 |
+
- pearson_manhattan
|
10 |
+
- spearman_manhattan
|
11 |
+
- pearson_euclidean
|
12 |
+
- spearman_euclidean
|
13 |
+
- pearson_dot
|
14 |
+
- spearman_dot
|
15 |
+
- pearson_max
|
16 |
+
- spearman_max
|
17 |
+
pipeline_tag: sentence-similarity
|
18 |
+
tags:
|
19 |
+
- sentence-transformers
|
20 |
+
- sentence-similarity
|
21 |
+
- feature-extraction
|
22 |
+
- generated_from_trainer
|
23 |
+
- dataset_size:277277
|
24 |
+
- loss:MultipleNegativesRankingLoss
|
25 |
+
widget:
|
26 |
+
- source_sentence: Tall man being stopped by an officer.
|
27 |
+
sentences:
|
28 |
+
- The man is short.
|
29 |
+
- There is a tall man.
|
30 |
+
- Male in brown leather jacket and tight black slacks, looking down at his phone
|
31 |
+
- source_sentence: Man relaxing on a bench at the bus stop.
|
32 |
+
sentences:
|
33 |
+
- The man stood next to the bench.
|
34 |
+
- The man relaxes on a bench.
|
35 |
+
- A dog running outside.
|
36 |
+
- source_sentence: Police officer with riot shield stands in front of crowd.
|
37 |
+
sentences:
|
38 |
+
- A police officer teaches two children something.
|
39 |
+
- The kid is at the beach.
|
40 |
+
- A police officer stands in front of a crowd.
|
41 |
+
- source_sentence: A woman in a red shirt and blue jeans is walking outside while
|
42 |
+
a man in a khaki jacket is right behind her.
|
43 |
+
sentences:
|
44 |
+
- A man and a woman are walking outside.
|
45 |
+
- A woman is outside.
|
46 |
+
- A man in an army jacket is following a woman in a pink dress.
|
47 |
+
- source_sentence: A waitress with a pink shirt and black pants walking through a
|
48 |
+
restaurant carrying bowls of soup.
|
49 |
+
sentences:
|
50 |
+
- Nobody has pants
|
51 |
+
- A person with pants
|
52 |
+
- a young kid jumps into the water
|
53 |
+
co2_eq_emissions:
|
54 |
+
emissions: 1.9590621986924506
|
55 |
+
energy_consumed: 0.005040010596015587
|
56 |
+
source: codecarbon
|
57 |
+
training_type: fine-tuning
|
58 |
+
on_cloud: false
|
59 |
+
cpu_model: 13th Gen Intel(R) Core(TM) i7-13700K
|
60 |
+
ram_total_size: 31.777088165283203
|
61 |
+
hours_used: 0.029
|
62 |
+
hardware_used: 1 x NVIDIA GeForce RTX 3090
|
63 |
+
model-index:
|
64 |
+
- name: SentenceTransformer based on prajjwal1/bert-tiny
|
65 |
+
results:
|
66 |
+
- task:
|
67 |
+
type: semantic-similarity
|
68 |
+
name: Semantic Similarity
|
69 |
+
dataset:
|
70 |
+
name: sts dev
|
71 |
+
type: sts-dev
|
72 |
+
metrics:
|
73 |
+
- type: pearson_cosine
|
74 |
+
value: 0.7526013757467193
|
75 |
+
name: Pearson Cosine
|
76 |
+
- type: spearman_cosine
|
77 |
+
value: 0.7614153421868329
|
78 |
+
name: Spearman Cosine
|
79 |
+
- type: pearson_manhattan
|
80 |
+
value: 0.7622035611835871
|
81 |
+
name: Pearson Manhattan
|
82 |
+
- type: spearman_manhattan
|
83 |
+
value: 0.7597498090089608
|
84 |
+
name: Spearman Manhattan
|
85 |
+
- type: pearson_euclidean
|
86 |
+
value: 0.7632410201154781
|
87 |
+
name: Pearson Euclidean
|
88 |
+
- type: spearman_euclidean
|
89 |
+
value: 0.7614153421868329
|
90 |
+
name: Spearman Euclidean
|
91 |
+
- type: pearson_dot
|
92 |
+
value: 0.7526013835604672
|
93 |
+
name: Pearson Dot
|
94 |
+
- type: spearman_dot
|
95 |
+
value: 0.7614153421868329
|
96 |
+
name: Spearman Dot
|
97 |
+
- type: pearson_max
|
98 |
+
value: 0.7632410201154781
|
99 |
+
name: Pearson Max
|
100 |
+
- type: spearman_max
|
101 |
+
value: 0.7614153421868329
|
102 |
+
name: Spearman Max
|
103 |
+
- task:
|
104 |
+
type: semantic-similarity
|
105 |
+
name: Semantic Similarity
|
106 |
+
dataset:
|
107 |
+
name: sts test
|
108 |
+
type: sts-test
|
109 |
+
metrics:
|
110 |
+
- type: pearson_cosine
|
111 |
+
value: 0.69132863091579
|
112 |
+
name: Pearson Cosine
|
113 |
+
- type: spearman_cosine
|
114 |
+
value: 0.6775246001958918
|
115 |
+
name: Spearman Cosine
|
116 |
+
- type: pearson_manhattan
|
117 |
+
value: 0.6993315331718462
|
118 |
+
name: Pearson Manhattan
|
119 |
+
- type: spearman_manhattan
|
120 |
+
value: 0.6760860789893309
|
121 |
+
name: Spearman Manhattan
|
122 |
+
- type: pearson_euclidean
|
123 |
+
value: 0.7005700491110102
|
124 |
+
name: Pearson Euclidean
|
125 |
+
- type: spearman_euclidean
|
126 |
+
value: 0.6775246001958918
|
127 |
+
name: Spearman Euclidean
|
128 |
+
- type: pearson_dot
|
129 |
+
value: 0.6913286275793098
|
130 |
+
name: Pearson Dot
|
131 |
+
- type: spearman_dot
|
132 |
+
value: 0.6775246001958918
|
133 |
+
name: Spearman Dot
|
134 |
+
- type: pearson_max
|
135 |
+
value: 0.7005700491110102
|
136 |
+
name: Pearson Max
|
137 |
+
- type: spearman_max
|
138 |
+
value: 0.6775246001958918
|
139 |
+
name: Spearman Max
|
140 |
+
---
|
141 |
+
|
142 |
+
# SentenceTransformer based on prajjwal1/bert-tiny
|
143 |
+
|
144 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [prajjwal1/bert-tiny](https://huggingface.co/prajjwal1/bert-tiny). It maps sentences & paragraphs to a 256-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
|
145 |
+
|
146 |
+
## Model Details
|
147 |
+
|
148 |
+
### Model Description
|
149 |
+
- **Model Type:** Sentence Transformer
|
150 |
+
- **Base model:** [prajjwal1/bert-tiny](https://huggingface.co/prajjwal1/bert-tiny) <!-- at revision 6f75de8b60a9f8a2fdf7b69cbd86d9e64bcb3837 -->
|
151 |
+
- **Maximum Sequence Length:** 384 tokens
|
152 |
+
- **Output Dimensionality:** 256 tokens
|
153 |
+
- **Similarity Function:** Cosine Similarity
|
154 |
+
<!-- - **Training Dataset:** Unknown -->
|
155 |
+
<!-- - **Language:** Unknown -->
|
156 |
+
<!-- - **License:** Unknown -->
|
157 |
+
|
158 |
+
### Model Sources
|
159 |
+
|
160 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
161 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
162 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
163 |
+
|
164 |
+
### Full Model Architecture
|
165 |
+
|
166 |
+
```
|
167 |
+
SentenceTransformer(
|
168 |
+
(0): Transformer({'max_seq_length': 384, 'do_lower_case': False}) with Transformer model: BertModel
|
169 |
+
(1): Pooling({'word_embedding_dimension': 128, '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})
|
170 |
+
(2): Dense({'in_features': 128, 'out_features': 256, 'bias': True, 'activation_function': 'torch.nn.modules.activation.Tanh'})
|
171 |
+
(3): Normalize()
|
172 |
+
)
|
173 |
+
```
|
174 |
+
|
175 |
+
## Usage
|
176 |
+
|
177 |
+
### Direct Usage (Sentence Transformers)
|
178 |
+
|
179 |
+
First install the Sentence Transformers library:
|
180 |
+
|
181 |
+
```bash
|
182 |
+
pip install -U sentence-transformers
|
183 |
+
```
|
184 |
+
|
185 |
+
Then you can load this model and run inference.
|
186 |
+
```python
|
187 |
+
from sentence_transformers import SentenceTransformer
|
188 |
+
|
189 |
+
# Download from the 🤗 Hub
|
190 |
+
model = SentenceTransformer("sentence-transformers-testing/all-nli-bert-tiny-dense")
|
191 |
+
# Run inference
|
192 |
+
sentences = [
|
193 |
+
'A waitress with a pink shirt and black pants walking through a restaurant carrying bowls of soup.',
|
194 |
+
'A person with pants',
|
195 |
+
'Nobody has pants',
|
196 |
+
]
|
197 |
+
embeddings = model.encode(sentences)
|
198 |
+
print(embeddings.shape)
|
199 |
+
# [3, 256]
|
200 |
+
|
201 |
+
# Get the similarity scores for the embeddings
|
202 |
+
similarities = model.similarity(embeddings, embeddings)
|
203 |
+
print(similarities.shape)
|
204 |
+
# [3, 3]
|
205 |
+
```
|
206 |
+
|
207 |
+
<!--
|
208 |
+
### Direct Usage (Transformers)
|
209 |
+
|
210 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
211 |
+
|
212 |
+
</details>
|
213 |
+
-->
|
214 |
+
|
215 |
+
<!--
|
216 |
+
### Downstream Usage (Sentence Transformers)
|
217 |
+
|
218 |
+
You can finetune this model on your own dataset.
|
219 |
+
|
220 |
+
<details><summary>Click to expand</summary>
|
221 |
+
|
222 |
+
</details>
|
223 |
+
-->
|
224 |
+
|
225 |
+
<!--
|
226 |
+
### Out-of-Scope Use
|
227 |
+
|
228 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
229 |
+
-->
|
230 |
+
|
231 |
+
## Evaluation
|
232 |
+
|
233 |
+
### Metrics
|
234 |
+
|
235 |
+
#### Semantic Similarity
|
236 |
+
* Dataset: `sts-dev`
|
237 |
+
* Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
|
238 |
+
|
239 |
+
| Metric | Value |
|
240 |
+
|:--------------------|:-----------|
|
241 |
+
| pearson_cosine | 0.7526 |
|
242 |
+
| **spearman_cosine** | **0.7614** |
|
243 |
+
| pearson_manhattan | 0.7622 |
|
244 |
+
| spearman_manhattan | 0.7597 |
|
245 |
+
| pearson_euclidean | 0.7632 |
|
246 |
+
| spearman_euclidean | 0.7614 |
|
247 |
+
| pearson_dot | 0.7526 |
|
248 |
+
| spearman_dot | 0.7614 |
|
249 |
+
| pearson_max | 0.7632 |
|
250 |
+
| spearman_max | 0.7614 |
|
251 |
+
|
252 |
+
#### Semantic Similarity
|
253 |
+
* Dataset: `sts-test`
|
254 |
+
* Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
|
255 |
+
|
256 |
+
| Metric | Value |
|
257 |
+
|:--------------------|:-----------|
|
258 |
+
| pearson_cosine | 0.6913 |
|
259 |
+
| **spearman_cosine** | **0.6775** |
|
260 |
+
| pearson_manhattan | 0.6993 |
|
261 |
+
| spearman_manhattan | 0.6761 |
|
262 |
+
| pearson_euclidean | 0.7006 |
|
263 |
+
| spearman_euclidean | 0.6775 |
|
264 |
+
| pearson_dot | 0.6913 |
|
265 |
+
| spearman_dot | 0.6775 |
|
266 |
+
| pearson_max | 0.7006 |
|
267 |
+
| spearman_max | 0.6775 |
|
268 |
+
|
269 |
+
<!--
|
270 |
+
## Bias, Risks and Limitations
|
271 |
+
|
272 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
273 |
+
-->
|
274 |
+
|
275 |
+
<!--
|
276 |
+
### Recommendations
|
277 |
+
|
278 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
279 |
+
-->
|
280 |
+
|
281 |
+
## Training Details
|
282 |
+
|
283 |
+
### Training Dataset
|
284 |
+
|
285 |
+
#### Unnamed Dataset
|
286 |
+
|
287 |
+
|
288 |
+
* Size: 277,277 training samples
|
289 |
+
* Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
|
290 |
+
* Approximate statistics based on the first 1000 samples:
|
291 |
+
| | anchor | positive | negative |
|
292 |
+
|:--------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
|
293 |
+
| type | string | string | string |
|
294 |
+
| details | <ul><li>min: 5 tokens</li><li>mean: 15.84 tokens</li><li>max: 64 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 9.45 tokens</li><li>max: 23 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 10.23 tokens</li><li>max: 28 tokens</li></ul> |
|
295 |
+
* Samples:
|
296 |
+
| anchor | positive | negative |
|
297 |
+
|:---------------------------------------------------------------------------|:-------------------------------------------------|:-----------------------------------------------------------|
|
298 |
+
| <code>A person on a horse jumps over a broken down airplane.</code> | <code>A person is outdoors, on a horse.</code> | <code>A person is at a diner, ordering an omelette.</code> |
|
299 |
+
| <code>Children smiling and waving at camera</code> | <code>There are children present</code> | <code>The kids are frowning</code> |
|
300 |
+
| <code>A boy is jumping on skateboard in the middle of a red bridge.</code> | <code>The boy does a skateboarding trick.</code> | <code>The boy skates down the sidewalk.</code> |
|
301 |
+
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
|
302 |
+
```json
|
303 |
+
{
|
304 |
+
"scale": 20.0,
|
305 |
+
"similarity_fct": "cos_sim"
|
306 |
+
}
|
307 |
+
```
|
308 |
+
|
309 |
+
### Evaluation Dataset
|
310 |
+
|
311 |
+
#### Unnamed Dataset
|
312 |
+
|
313 |
+
|
314 |
+
* Size: 5,875 evaluation samples
|
315 |
+
* Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
|
316 |
+
* Approximate statistics based on the first 1000 samples:
|
317 |
+
| | anchor | positive | negative |
|
318 |
+
|:--------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
|
319 |
+
| type | string | string | string |
|
320 |
+
| details | <ul><li>min: 6 tokens</li><li>mean: 17.85 tokens</li><li>max: 63 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 9.68 tokens</li><li>max: 29 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 10.36 tokens</li><li>max: 26 tokens</li></ul> |
|
321 |
+
* Samples:
|
322 |
+
| anchor | positive | negative |
|
323 |
+
|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------|:--------------------------------------------------------|
|
324 |
+
| <code>Two women are embracing while holding to go packages.</code> | <code>Two woman are holding packages.</code> | <code>The men are fighting outside a deli.</code> |
|
325 |
+
| <code>Two young children in blue jerseys, one with the number 9 and one with the number 2 are standing on wooden steps in a bathroom and washing their hands in a sink.</code> | <code>Two kids in numbered jerseys wash their hands.</code> | <code>Two kids in jackets walk to school.</code> |
|
326 |
+
| <code>A man selling donuts to a customer during a world exhibition event held in the city of Angeles</code> | <code>A man selling donuts to a customer.</code> | <code>A woman drinks her coffee in a small cafe.</code> |
|
327 |
+
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
|
328 |
+
```json
|
329 |
+
{
|
330 |
+
"scale": 20.0,
|
331 |
+
"similarity_fct": "cos_sim"
|
332 |
+
}
|
333 |
+
```
|
334 |
+
|
335 |
+
### Training Hyperparameters
|
336 |
+
#### Non-Default Hyperparameters
|
337 |
+
|
338 |
+
- `eval_strategy`: steps
|
339 |
+
- `per_device_train_batch_size`: 256
|
340 |
+
- `per_device_eval_batch_size`: 256
|
341 |
+
- `learning_rate`: 2e-05
|
342 |
+
- `num_train_epochs`: 1
|
343 |
+
- `warmup_ratio`: 0.1
|
344 |
+
- `bf16`: True
|
345 |
+
|
346 |
+
#### All Hyperparameters
|
347 |
+
<details><summary>Click to expand</summary>
|
348 |
+
|
349 |
+
- `overwrite_output_dir`: False
|
350 |
+
- `do_predict`: False
|
351 |
+
- `eval_strategy`: steps
|
352 |
+
- `prediction_loss_only`: True
|
353 |
+
- `per_device_train_batch_size`: 256
|
354 |
+
- `per_device_eval_batch_size`: 256
|
355 |
+
- `per_gpu_train_batch_size`: None
|
356 |
+
- `per_gpu_eval_batch_size`: None
|
357 |
+
- `gradient_accumulation_steps`: 1
|
358 |
+
- `eval_accumulation_steps`: None
|
359 |
+
- `torch_empty_cache_steps`: None
|
360 |
+
- `learning_rate`: 2e-05
|
361 |
+
- `weight_decay`: 0.0
|
362 |
+
- `adam_beta1`: 0.9
|
363 |
+
- `adam_beta2`: 0.999
|
364 |
+
- `adam_epsilon`: 1e-08
|
365 |
+
- `max_grad_norm`: 1.0
|
366 |
+
- `num_train_epochs`: 1
|
367 |
+
- `max_steps`: -1
|
368 |
+
- `lr_scheduler_type`: linear
|
369 |
+
- `lr_scheduler_kwargs`: {}
|
370 |
+
- `warmup_ratio`: 0.1
|
371 |
+
- `warmup_steps`: 0
|
372 |
+
- `log_level`: passive
|
373 |
+
- `log_level_replica`: warning
|
374 |
+
- `log_on_each_node`: True
|
375 |
+
- `logging_nan_inf_filter`: True
|
376 |
+
- `save_safetensors`: True
|
377 |
+
- `save_on_each_node`: False
|
378 |
+
- `save_only_model`: False
|
379 |
+
- `restore_callback_states_from_checkpoint`: False
|
380 |
+
- `no_cuda`: False
|
381 |
+
- `use_cpu`: False
|
382 |
+
- `use_mps_device`: False
|
383 |
+
- `seed`: 42
|
384 |
+
- `data_seed`: None
|
385 |
+
- `jit_mode_eval`: False
|
386 |
+
- `use_ipex`: False
|
387 |
+
- `bf16`: True
|
388 |
+
- `fp16`: False
|
389 |
+
- `fp16_opt_level`: O1
|
390 |
+
- `half_precision_backend`: auto
|
391 |
+
- `bf16_full_eval`: False
|
392 |
+
- `fp16_full_eval`: False
|
393 |
+
- `tf32`: None
|
394 |
+
- `local_rank`: 0
|
395 |
+
- `ddp_backend`: None
|
396 |
+
- `tpu_num_cores`: None
|
397 |
+
- `tpu_metrics_debug`: False
|
398 |
+
- `debug`: []
|
399 |
+
- `dataloader_drop_last`: False
|
400 |
+
- `dataloader_num_workers`: 0
|
401 |
+
- `dataloader_prefetch_factor`: None
|
402 |
+
- `past_index`: -1
|
403 |
+
- `disable_tqdm`: False
|
404 |
+
- `remove_unused_columns`: True
|
405 |
+
- `label_names`: None
|
406 |
+
- `load_best_model_at_end`: False
|
407 |
+
- `ignore_data_skip`: False
|
408 |
+
- `fsdp`: []
|
409 |
+
- `fsdp_min_num_params`: 0
|
410 |
+
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
411 |
+
- `fsdp_transformer_layer_cls_to_wrap`: None
|
412 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
413 |
+
- `deepspeed`: None
|
414 |
+
- `label_smoothing_factor`: 0.0
|
415 |
+
- `optim`: adamw_torch
|
416 |
+
- `optim_args`: None
|
417 |
+
- `adafactor`: False
|
418 |
+
- `group_by_length`: False
|
419 |
+
- `length_column_name`: length
|
420 |
+
- `ddp_find_unused_parameters`: None
|
421 |
+
- `ddp_bucket_cap_mb`: None
|
422 |
+
- `ddp_broadcast_buffers`: False
|
423 |
+
- `dataloader_pin_memory`: True
|
424 |
+
- `dataloader_persistent_workers`: False
|
425 |
+
- `skip_memory_metrics`: True
|
426 |
+
- `use_legacy_prediction_loop`: False
|
427 |
+
- `push_to_hub`: False
|
428 |
+
- `resume_from_checkpoint`: None
|
429 |
+
- `hub_model_id`: None
|
430 |
+
- `hub_strategy`: every_save
|
431 |
+
- `hub_private_repo`: False
|
432 |
+
- `hub_always_push`: False
|
433 |
+
- `gradient_checkpointing`: False
|
434 |
+
- `gradient_checkpointing_kwargs`: None
|
435 |
+
- `include_inputs_for_metrics`: False
|
436 |
+
- `eval_do_concat_batches`: True
|
437 |
+
- `fp16_backend`: auto
|
438 |
+
- `push_to_hub_model_id`: None
|
439 |
+
- `push_to_hub_organization`: None
|
440 |
+
- `mp_parameters`:
|
441 |
+
- `auto_find_batch_size`: False
|
442 |
+
- `full_determinism`: False
|
443 |
+
- `torchdynamo`: None
|
444 |
+
- `ray_scope`: last
|
445 |
+
- `ddp_timeout`: 1800
|
446 |
+
- `torch_compile`: False
|
447 |
+
- `torch_compile_backend`: None
|
448 |
+
- `torch_compile_mode`: None
|
449 |
+
- `dispatch_batches`: None
|
450 |
+
- `split_batches`: None
|
451 |
+
- `include_tokens_per_second`: False
|
452 |
+
- `include_num_input_tokens_seen`: False
|
453 |
+
- `neftune_noise_alpha`: None
|
454 |
+
- `optim_target_modules`: None
|
455 |
+
- `batch_eval_metrics`: False
|
456 |
+
- `eval_on_start`: False
|
457 |
+
- `eval_use_gather_object`: False
|
458 |
+
- `batch_sampler`: batch_sampler
|
459 |
+
- `multi_dataset_batch_sampler`: proportional
|
460 |
+
|
461 |
+
</details>
|
462 |
+
|
463 |
+
### Training Logs
|
464 |
+
| Epoch | Step | Training Loss | loss | sts-dev_spearman_cosine | sts-test_spearman_cosine |
|
465 |
+
|:------:|:----:|:-------------:|:------:|:-----------------------:|:------------------------:|
|
466 |
+
| 0.0923 | 100 | 3.4021 | 2.1678 | 0.7247 | - |
|
467 |
+
| 0.1845 | 200 | 2.3398 | 1.7482 | 0.7480 | - |
|
468 |
+
| 0.2768 | 300 | 2.0893 | 1.6365 | 0.7537 | - |
|
469 |
+
| 0.3690 | 400 | 2.0035 | 1.5782 | 0.7552 | - |
|
470 |
+
| 0.4613 | 500 | 1.9023 | 1.5376 | 0.7587 | - |
|
471 |
+
| 0.5535 | 600 | 1.8647 | 1.5059 | 0.7597 | - |
|
472 |
+
| 0.6458 | 700 | 1.8511 | 1.4836 | 0.7605 | - |
|
473 |
+
| 0.7380 | 800 | 1.8094 | 1.4698 | 0.7613 | - |
|
474 |
+
| 0.8303 | 900 | 1.8338 | 1.4593 | 0.7609 | - |
|
475 |
+
| 0.9225 | 1000 | 1.7951 | 1.4553 | 0.7614 | - |
|
476 |
+
| 1.0 | 1084 | - | - | - | 0.6775 |
|
477 |
+
|
478 |
+
|
479 |
+
### Environmental Impact
|
480 |
+
Carbon emissions were measured using [CodeCarbon](https://github.com/mlco2/codecarbon).
|
481 |
+
- **Energy Consumed**: 0.005 kWh
|
482 |
+
- **Carbon Emitted**: 0.002 kg of CO2
|
483 |
+
- **Hours Used**: 0.029 hours
|
484 |
+
|
485 |
+
### Training Hardware
|
486 |
+
- **On Cloud**: No
|
487 |
+
- **GPU Model**: 1 x NVIDIA GeForce RTX 3090
|
488 |
+
- **CPU Model**: 13th Gen Intel(R) Core(TM) i7-13700K
|
489 |
+
- **RAM Size**: 31.78 GB
|
490 |
+
|
491 |
+
### Framework Versions
|
492 |
+
- Python: 3.11.6
|
493 |
+
- Sentence Transformers: 3.1.0.dev0
|
494 |
+
- Transformers: 4.43.4
|
495 |
+
- PyTorch: 2.5.0.dev20240807+cu121
|
496 |
+
- Accelerate: 0.31.0
|
497 |
+
- Datasets: 2.20.0
|
498 |
+
- Tokenizers: 0.19.1
|
499 |
+
|
500 |
+
## Citation
|
501 |
+
|
502 |
+
### BibTeX
|
503 |
+
|
504 |
+
#### Sentence Transformers
|
505 |
+
```bibtex
|
506 |
+
@inproceedings{reimers-2019-sentence-bert,
|
507 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
508 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
509 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
510 |
+
month = "11",
|
511 |
+
year = "2019",
|
512 |
+
publisher = "Association for Computational Linguistics",
|
513 |
+
url = "https://arxiv.org/abs/1908.10084",
|
514 |
+
}
|
515 |
+
```
|
516 |
+
|
517 |
+
#### MultipleNegativesRankingLoss
|
518 |
+
```bibtex
|
519 |
+
@misc{henderson2017efficient,
|
520 |
+
title={Efficient Natural Language Response Suggestion for Smart Reply},
|
521 |
+
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},
|
522 |
+
year={2017},
|
523 |
+
eprint={1705.00652},
|
524 |
+
archivePrefix={arXiv},
|
525 |
+
primaryClass={cs.CL}
|
526 |
+
}
|
527 |
+
```
|
528 |
+
|
529 |
+
<!--
|
530 |
+
## Glossary
|
531 |
+
|
532 |
+
*Clearly define terms in order to be accessible across audiences.*
|
533 |
+
-->
|
534 |
+
|
535 |
+
<!--
|
536 |
+
## Model Card Authors
|
537 |
+
|
538 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
539 |
+
-->
|
540 |
+
|
541 |
+
<!--
|
542 |
+
## Model Card Contact
|
543 |
+
|
544 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
545 |
+
-->
|
config.json
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "prajjwal1/bert-tiny",
|
3 |
+
"architectures": [
|
4 |
+
"BertModel"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"classifier_dropout": null,
|
8 |
+
"hidden_act": "gelu",
|
9 |
+
"hidden_dropout_prob": 0.1,
|
10 |
+
"hidden_size": 128,
|
11 |
+
"initializer_range": 0.02,
|
12 |
+
"intermediate_size": 512,
|
13 |
+
"layer_norm_eps": 1e-12,
|
14 |
+
"max_position_embeddings": 512,
|
15 |
+
"model_type": "bert",
|
16 |
+
"num_attention_heads": 2,
|
17 |
+
"num_hidden_layers": 2,
|
18 |
+
"pad_token_id": 0,
|
19 |
+
"position_embedding_type": "absolute",
|
20 |
+
"torch_dtype": "float32",
|
21 |
+
"transformers_version": "4.43.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": "3.1.0.dev0",
|
4 |
+
"transformers": "4.43.4",
|
5 |
+
"pytorch": "2.5.0.dev20240807+cu121"
|
6 |
+
},
|
7 |
+
"prompts": {},
|
8 |
+
"default_prompt_name": null,
|
9 |
+
"similarity_fn_name": null
|
10 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:37f647ae493cd1e8935379eb3dc80ca965d6f0d34b8442b4d24fbc6577307507
|
3 |
+
size 17547912
|
modules.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Dense",
|
18 |
+
"type": "sentence_transformers.models.Dense"
|
19 |
+
},
|
20 |
+
{
|
21 |
+
"idx": 3,
|
22 |
+
"name": "3",
|
23 |
+
"path": "3_Normalize",
|
24 |
+
"type": "sentence_transformers.models.Normalize"
|
25 |
+
}
|
26 |
+
]
|
sentence_bert_config.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"max_seq_length": 384,
|
3 |
+
"do_lower_case": false
|
4 |
+
}
|
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 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"mask_token": "[MASK]",
|
49 |
+
"model_max_length": 384,
|
50 |
+
"never_split": null,
|
51 |
+
"pad_token": "[PAD]",
|
52 |
+
"sep_token": "[SEP]",
|
53 |
+
"strip_accents": null,
|
54 |
+
"tokenize_chinese_chars": true,
|
55 |
+
"tokenizer_class": "BertTokenizer",
|
56 |
+
"unk_token": "[UNK]"
|
57 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|