pierreinalco
commited on
Commit
•
ae7847a
1
Parent(s):
8a6c748
Add new SentenceTransformer model.
Browse files- 1_Pooling/config.json +10 -0
- README.md +521 -0
- config.json +24 -0
- config_sentence_transformers.json +10 -0
- model.safetensors +3 -0
- modules.json +14 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +37 -0
- tokenizer.json +0 -0
- tokenizer_config.json +62 -0
- vocab.txt +0 -0
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,521 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: []
|
3 |
+
library_name: sentence-transformers
|
4 |
+
tags:
|
5 |
+
- sentence-transformers
|
6 |
+
- sentence-similarity
|
7 |
+
- feature-extraction
|
8 |
+
- dataset_size:10K<n<100K
|
9 |
+
- loss:CosineSimilarityLoss
|
10 |
+
base_model: pierreinalco/distilbert-base-uncased-sts
|
11 |
+
metrics:
|
12 |
+
- pearson_cosine
|
13 |
+
- spearman_cosine
|
14 |
+
- pearson_manhattan
|
15 |
+
- spearman_manhattan
|
16 |
+
- pearson_euclidean
|
17 |
+
- spearman_euclidean
|
18 |
+
- pearson_dot
|
19 |
+
- spearman_dot
|
20 |
+
- pearson_max
|
21 |
+
- spearman_max
|
22 |
+
widget:
|
23 |
+
- source_sentence: '[SYNTAX] Inversion is a common syntactic feature in questions.'
|
24 |
+
sentences:
|
25 |
+
- '[SYNTAX] DNA transcription is a common biological mechanism regulating RNA synthesis.'
|
26 |
+
- '[SYNTAX] Fermions and bosons are the two broad categories of subatomic particles.'
|
27 |
+
- Extensive legislative debate is often required when amending existing public policies.
|
28 |
+
- source_sentence: The examination of meaning in language is known as semantics.
|
29 |
+
sentences:
|
30 |
+
- 'Semantics is the study of meaning in language. '
|
31 |
+
- '[SYNTAX] Extreme weather events are becoming more frequent due to climate change.'
|
32 |
+
- Regular practice is essential to ensure the success of musical performances.
|
33 |
+
- source_sentence: Marine life thrives in ecosystems teeming with diverse species.
|
34 |
+
sentences:
|
35 |
+
- Climate change modifies the balance of ecosystems around the globe.
|
36 |
+
- '[SYNTAX] One key focus of archaeology is the exploration of ancient civilizations.'
|
37 |
+
- 'By examining butcher marks, scientists can infer ancient dietary practices. '
|
38 |
+
- source_sentence: Bicyclists rode swiftly in the park while a gentle breeze blew.
|
39 |
+
sentences:
|
40 |
+
- 'Urban parks offer residents vital green spaces for recreation and relaxation. '
|
41 |
+
- Contour farming follows the natural shape of the land to improve water retention.
|
42 |
+
- Skipping breakfast can affect your energy levels and concentration throughout
|
43 |
+
the day.
|
44 |
+
- source_sentence: Fossil fuel reserves are finite and will eventually be depleted.
|
45 |
+
sentences:
|
46 |
+
- Trace fossils, like footprints and burrows, reveal the behavior of ancient organisms.
|
47 |
+
- Electric trains are more environmentally friendly compared to diesel-powered ones.
|
48 |
+
- A declining atmospheric pressure frequently indicates the imminent arrival of
|
49 |
+
a storm.
|
50 |
+
pipeline_tag: sentence-similarity
|
51 |
+
model-index:
|
52 |
+
- name: SentenceTransformer based on pierreinalco/distilbert-base-uncased-sts
|
53 |
+
results:
|
54 |
+
- task:
|
55 |
+
type: semantic-similarity
|
56 |
+
name: Semantic Similarity
|
57 |
+
dataset:
|
58 |
+
name: custom dev
|
59 |
+
type: custom-dev
|
60 |
+
metrics:
|
61 |
+
- type: pearson_cosine
|
62 |
+
value: 0.9199550350229381
|
63 |
+
name: Pearson Cosine
|
64 |
+
- type: spearman_cosine
|
65 |
+
value: 0.8477353426901187
|
66 |
+
name: Spearman Cosine
|
67 |
+
- type: pearson_manhattan
|
68 |
+
value: 0.922270207368092
|
69 |
+
name: Pearson Manhattan
|
70 |
+
- type: spearman_manhattan
|
71 |
+
value: 0.8455601721195604
|
72 |
+
name: Spearman Manhattan
|
73 |
+
- type: pearson_euclidean
|
74 |
+
value: 0.9225814550760436
|
75 |
+
name: Pearson Euclidean
|
76 |
+
- type: spearman_euclidean
|
77 |
+
value: 0.8455566196441302
|
78 |
+
name: Spearman Euclidean
|
79 |
+
- type: pearson_dot
|
80 |
+
value: 0.9112758242260417
|
81 |
+
name: Pearson Dot
|
82 |
+
- type: spearman_dot
|
83 |
+
value: 0.8381909699446571
|
84 |
+
name: Spearman Dot
|
85 |
+
- type: pearson_max
|
86 |
+
value: 0.9225814550760436
|
87 |
+
name: Pearson Max
|
88 |
+
- type: spearman_max
|
89 |
+
value: 0.8477353426901187
|
90 |
+
name: Spearman Max
|
91 |
+
- task:
|
92 |
+
type: semantic-similarity
|
93 |
+
name: Semantic Similarity
|
94 |
+
dataset:
|
95 |
+
name: custom test
|
96 |
+
type: custom-test
|
97 |
+
metrics:
|
98 |
+
- type: pearson_cosine
|
99 |
+
value: 0.9124658569127322
|
100 |
+
name: Pearson Cosine
|
101 |
+
- type: spearman_cosine
|
102 |
+
value: 0.8453565105014698
|
103 |
+
name: Spearman Cosine
|
104 |
+
- type: pearson_manhattan
|
105 |
+
value: 0.9161256101176948
|
106 |
+
name: Pearson Manhattan
|
107 |
+
- type: spearman_manhattan
|
108 |
+
value: 0.845382323611419
|
109 |
+
name: Spearman Manhattan
|
110 |
+
- type: pearson_euclidean
|
111 |
+
value: 0.9165265409472989
|
112 |
+
name: Pearson Euclidean
|
113 |
+
- type: spearman_euclidean
|
114 |
+
value: 0.8457233262812305
|
115 |
+
name: Spearman Euclidean
|
116 |
+
- type: pearson_dot
|
117 |
+
value: 0.903021036040846
|
118 |
+
name: Pearson Dot
|
119 |
+
- type: spearman_dot
|
120 |
+
value: 0.8319052098219432
|
121 |
+
name: Spearman Dot
|
122 |
+
- type: pearson_max
|
123 |
+
value: 0.9165265409472989
|
124 |
+
name: Pearson Max
|
125 |
+
- type: spearman_max
|
126 |
+
value: 0.8457233262812305
|
127 |
+
name: Spearman Max
|
128 |
+
---
|
129 |
+
|
130 |
+
# SentenceTransformer based on pierreinalco/distilbert-base-uncased-sts
|
131 |
+
|
132 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [pierreinalco/distilbert-base-uncased-sts](https://huggingface.co/pierreinalco/distilbert-base-uncased-sts). 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.
|
133 |
+
|
134 |
+
## Model Details
|
135 |
+
|
136 |
+
### Model Description
|
137 |
+
- **Model Type:** Sentence Transformer
|
138 |
+
- **Base model:** [pierreinalco/distilbert-base-uncased-sts](https://huggingface.co/pierreinalco/distilbert-base-uncased-sts) <!-- at revision 5c3e1e82bd154604c8803ea705b7bc57712eab5b -->
|
139 |
+
- **Maximum Sequence Length:** 512 tokens
|
140 |
+
- **Output Dimensionality:** 768 tokens
|
141 |
+
- **Similarity Function:** Cosine Similarity
|
142 |
+
<!-- - **Training Dataset:** Unknown -->
|
143 |
+
<!-- - **Language:** Unknown -->
|
144 |
+
<!-- - **License:** Unknown -->
|
145 |
+
|
146 |
+
### Model Sources
|
147 |
+
|
148 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
149 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
150 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
151 |
+
|
152 |
+
### Full Model Architecture
|
153 |
+
|
154 |
+
```
|
155 |
+
SentenceTransformer(
|
156 |
+
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: DistilBertModel
|
157 |
+
(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})
|
158 |
+
)
|
159 |
+
```
|
160 |
+
|
161 |
+
## Usage
|
162 |
+
|
163 |
+
### Direct Usage (Sentence Transformers)
|
164 |
+
|
165 |
+
First install the Sentence Transformers library:
|
166 |
+
|
167 |
+
```bash
|
168 |
+
pip install -U sentence-transformers
|
169 |
+
```
|
170 |
+
|
171 |
+
Then you can load this model and run inference.
|
172 |
+
```python
|
173 |
+
from sentence_transformers import SentenceTransformer
|
174 |
+
|
175 |
+
# Download from the 🤗 Hub
|
176 |
+
model = SentenceTransformer("sentence_transformers_model_id")
|
177 |
+
# Run inference
|
178 |
+
sentences = [
|
179 |
+
'Fossil fuel reserves are finite and will eventually be depleted.',
|
180 |
+
'Trace fossils, like footprints and burrows, reveal the behavior of ancient organisms.',
|
181 |
+
'Electric trains are more environmentally friendly compared to diesel-powered ones.',
|
182 |
+
]
|
183 |
+
embeddings = model.encode(sentences)
|
184 |
+
print(embeddings.shape)
|
185 |
+
# [3, 768]
|
186 |
+
|
187 |
+
# Get the similarity scores for the embeddings
|
188 |
+
similarities = model.similarity(embeddings, embeddings)
|
189 |
+
print(similarities.shape)
|
190 |
+
# [3, 3]
|
191 |
+
```
|
192 |
+
|
193 |
+
<!--
|
194 |
+
### Direct Usage (Transformers)
|
195 |
+
|
196 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
197 |
+
|
198 |
+
</details>
|
199 |
+
-->
|
200 |
+
|
201 |
+
<!--
|
202 |
+
### Downstream Usage (Sentence Transformers)
|
203 |
+
|
204 |
+
You can finetune this model on your own dataset.
|
205 |
+
|
206 |
+
<details><summary>Click to expand</summary>
|
207 |
+
|
208 |
+
</details>
|
209 |
+
-->
|
210 |
+
|
211 |
+
<!--
|
212 |
+
### Out-of-Scope Use
|
213 |
+
|
214 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
215 |
+
-->
|
216 |
+
|
217 |
+
## Evaluation
|
218 |
+
|
219 |
+
### Metrics
|
220 |
+
|
221 |
+
#### Semantic Similarity
|
222 |
+
* Dataset: `custom-dev`
|
223 |
+
* Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
|
224 |
+
|
225 |
+
| Metric | Value |
|
226 |
+
|:--------------------|:-----------|
|
227 |
+
| pearson_cosine | 0.92 |
|
228 |
+
| **spearman_cosine** | **0.8477** |
|
229 |
+
| pearson_manhattan | 0.9223 |
|
230 |
+
| spearman_manhattan | 0.8456 |
|
231 |
+
| pearson_euclidean | 0.9226 |
|
232 |
+
| spearman_euclidean | 0.8456 |
|
233 |
+
| pearson_dot | 0.9113 |
|
234 |
+
| spearman_dot | 0.8382 |
|
235 |
+
| pearson_max | 0.9226 |
|
236 |
+
| spearman_max | 0.8477 |
|
237 |
+
|
238 |
+
#### Semantic Similarity
|
239 |
+
* Dataset: `custom-test`
|
240 |
+
* Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
|
241 |
+
|
242 |
+
| Metric | Value |
|
243 |
+
|:--------------------|:-----------|
|
244 |
+
| pearson_cosine | 0.9125 |
|
245 |
+
| **spearman_cosine** | **0.8454** |
|
246 |
+
| pearson_manhattan | 0.9161 |
|
247 |
+
| spearman_manhattan | 0.8454 |
|
248 |
+
| pearson_euclidean | 0.9165 |
|
249 |
+
| spearman_euclidean | 0.8457 |
|
250 |
+
| pearson_dot | 0.903 |
|
251 |
+
| spearman_dot | 0.8319 |
|
252 |
+
| pearson_max | 0.9165 |
|
253 |
+
| spearman_max | 0.8457 |
|
254 |
+
|
255 |
+
<!--
|
256 |
+
## Bias, Risks and Limitations
|
257 |
+
|
258 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
259 |
+
-->
|
260 |
+
|
261 |
+
<!--
|
262 |
+
### Recommendations
|
263 |
+
|
264 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
265 |
+
-->
|
266 |
+
|
267 |
+
## Training Details
|
268 |
+
|
269 |
+
### Training Dataset
|
270 |
+
|
271 |
+
#### Unnamed Dataset
|
272 |
+
|
273 |
+
|
274 |
+
* Size: 19,352 training samples
|
275 |
+
* Columns: <code>s1</code>, <code>s2</code>, and <code>label</code>
|
276 |
+
* Approximate statistics based on the first 1000 samples:
|
277 |
+
| | s1 | s2 | label |
|
278 |
+
|:--------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:------------------------------------------------|
|
279 |
+
| type | string | string | int |
|
280 |
+
| details | <ul><li>min: 10 tokens</li><li>mean: 19.85 tokens</li><li>max: 38 tokens</li></ul> | <ul><li>min: 11 tokens</li><li>mean: 20.47 tokens</li><li>max: 34 tokens</li></ul> | <ul><li>0: ~51.40%</li><li>1: ~48.60%</li></ul> |
|
281 |
+
* Samples:
|
282 |
+
| s1 | s2 | label |
|
283 |
+
|:---------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------|:---------------|
|
284 |
+
| <code>Resources and funding are essential for the successful rollout of any new curriculum.</code> | <code>For any new curriculum to be successfully rolled out, it is essential to have resources and funding.</code> | <code>1</code> |
|
285 |
+
| <code>Upgrading to LED lighting is a simple step toward improving energy efficiency in buildings.</code> | <code>Upgrading to new software is a simple step toward improving technology adoption in companies.</code> | <code>0</code> |
|
286 |
+
| <code>Ethnicity and language often intersect in interesting and complex ways.</code> | <code>Ethnicity and culture often diverge in unexpected and straightforward ways.</code> | <code>0</code> |
|
287 |
+
* Loss: [<code>CosineSimilarityLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) with these parameters:
|
288 |
+
```json
|
289 |
+
{
|
290 |
+
"loss_fct": "torch.nn.modules.loss.MSELoss"
|
291 |
+
}
|
292 |
+
```
|
293 |
+
|
294 |
+
### Evaluation Dataset
|
295 |
+
|
296 |
+
#### Unnamed Dataset
|
297 |
+
|
298 |
+
|
299 |
+
* Size: 2,419 evaluation samples
|
300 |
+
* Columns: <code>s1</code>, <code>s2</code>, and <code>label</code>
|
301 |
+
* Approximate statistics based on the first 1000 samples:
|
302 |
+
| | s1 | s2 | label |
|
303 |
+
|:--------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:------------------------------------------------|
|
304 |
+
| type | string | string | int |
|
305 |
+
| details | <ul><li>min: 10 tokens</li><li>mean: 19.91 tokens</li><li>max: 39 tokens</li></ul> | <ul><li>min: 11 tokens</li><li>mean: 20.41 tokens</li><li>max: 38 tokens</li></ul> | <ul><li>0: ~52.90%</li><li>1: ~47.10%</li></ul> |
|
306 |
+
* Samples:
|
307 |
+
| s1 | s2 | label |
|
308 |
+
|:-------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------|:---------------|
|
309 |
+
| <code>[SYNTAX] Consuming too much processed sugar can lead to insulin resistance and diabetes.</code> | <code>[SYNTAX] Drinking too much water can help maintain proper hydration and overall health.</code> | <code>1</code> |
|
310 |
+
| <code>Neutral tones and minimalist designs are staples of gender-neutral fashion. </code> | <code>Colorful patterns and intricate designs are staples of traditional ceremonial attire.</code> | <code>0</code> |
|
311 |
+
| <code>[SYNTAX] Policies focusing on sustainable agriculture practices are essential for ensuring food security in the face of climate change. </code> | <code>[SYNTAX] Ensuring food security amidst climate change requires critical policies that emphasize sustainable agricultural practices.</code> | <code>0</code> |
|
312 |
+
* Loss: [<code>CosineSimilarityLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) with these parameters:
|
313 |
+
```json
|
314 |
+
{
|
315 |
+
"loss_fct": "torch.nn.modules.loss.MSELoss"
|
316 |
+
}
|
317 |
+
```
|
318 |
+
|
319 |
+
### Training Hyperparameters
|
320 |
+
#### Non-Default Hyperparameters
|
321 |
+
|
322 |
+
- `eval_strategy`: steps
|
323 |
+
- `per_device_train_batch_size`: 16
|
324 |
+
- `per_device_eval_batch_size`: 16
|
325 |
+
- `num_train_epochs`: 10
|
326 |
+
- `warmup_ratio`: 0.1
|
327 |
+
- `fp16`: True
|
328 |
+
|
329 |
+
#### All Hyperparameters
|
330 |
+
<details><summary>Click to expand</summary>
|
331 |
+
|
332 |
+
- `overwrite_output_dir`: False
|
333 |
+
- `do_predict`: False
|
334 |
+
- `eval_strategy`: steps
|
335 |
+
- `prediction_loss_only`: True
|
336 |
+
- `per_device_train_batch_size`: 16
|
337 |
+
- `per_device_eval_batch_size`: 16
|
338 |
+
- `per_gpu_train_batch_size`: None
|
339 |
+
- `per_gpu_eval_batch_size`: None
|
340 |
+
- `gradient_accumulation_steps`: 1
|
341 |
+
- `eval_accumulation_steps`: None
|
342 |
+
- `learning_rate`: 5e-05
|
343 |
+
- `weight_decay`: 0.0
|
344 |
+
- `adam_beta1`: 0.9
|
345 |
+
- `adam_beta2`: 0.999
|
346 |
+
- `adam_epsilon`: 1e-08
|
347 |
+
- `max_grad_norm`: 1.0
|
348 |
+
- `num_train_epochs`: 10
|
349 |
+
- `max_steps`: -1
|
350 |
+
- `lr_scheduler_type`: linear
|
351 |
+
- `lr_scheduler_kwargs`: {}
|
352 |
+
- `warmup_ratio`: 0.1
|
353 |
+
- `warmup_steps`: 0
|
354 |
+
- `log_level`: passive
|
355 |
+
- `log_level_replica`: warning
|
356 |
+
- `log_on_each_node`: True
|
357 |
+
- `logging_nan_inf_filter`: True
|
358 |
+
- `save_safetensors`: True
|
359 |
+
- `save_on_each_node`: False
|
360 |
+
- `save_only_model`: False
|
361 |
+
- `restore_callback_states_from_checkpoint`: False
|
362 |
+
- `no_cuda`: False
|
363 |
+
- `use_cpu`: False
|
364 |
+
- `use_mps_device`: False
|
365 |
+
- `seed`: 42
|
366 |
+
- `data_seed`: None
|
367 |
+
- `jit_mode_eval`: False
|
368 |
+
- `use_ipex`: False
|
369 |
+
- `bf16`: False
|
370 |
+
- `fp16`: True
|
371 |
+
- `fp16_opt_level`: O1
|
372 |
+
- `half_precision_backend`: auto
|
373 |
+
- `bf16_full_eval`: False
|
374 |
+
- `fp16_full_eval`: False
|
375 |
+
- `tf32`: None
|
376 |
+
- `local_rank`: 0
|
377 |
+
- `ddp_backend`: None
|
378 |
+
- `tpu_num_cores`: None
|
379 |
+
- `tpu_metrics_debug`: False
|
380 |
+
- `debug`: []
|
381 |
+
- `dataloader_drop_last`: False
|
382 |
+
- `dataloader_num_workers`: 0
|
383 |
+
- `dataloader_prefetch_factor`: None
|
384 |
+
- `past_index`: -1
|
385 |
+
- `disable_tqdm`: False
|
386 |
+
- `remove_unused_columns`: True
|
387 |
+
- `label_names`: None
|
388 |
+
- `load_best_model_at_end`: False
|
389 |
+
- `ignore_data_skip`: False
|
390 |
+
- `fsdp`: []
|
391 |
+
- `fsdp_min_num_params`: 0
|
392 |
+
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
393 |
+
- `fsdp_transformer_layer_cls_to_wrap`: None
|
394 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
395 |
+
- `deepspeed`: None
|
396 |
+
- `label_smoothing_factor`: 0.0
|
397 |
+
- `optim`: adamw_torch
|
398 |
+
- `optim_args`: None
|
399 |
+
- `adafactor`: False
|
400 |
+
- `group_by_length`: False
|
401 |
+
- `length_column_name`: length
|
402 |
+
- `ddp_find_unused_parameters`: None
|
403 |
+
- `ddp_bucket_cap_mb`: None
|
404 |
+
- `ddp_broadcast_buffers`: False
|
405 |
+
- `dataloader_pin_memory`: True
|
406 |
+
- `dataloader_persistent_workers`: False
|
407 |
+
- `skip_memory_metrics`: True
|
408 |
+
- `use_legacy_prediction_loop`: False
|
409 |
+
- `push_to_hub`: False
|
410 |
+
- `resume_from_checkpoint`: None
|
411 |
+
- `hub_model_id`: None
|
412 |
+
- `hub_strategy`: every_save
|
413 |
+
- `hub_private_repo`: False
|
414 |
+
- `hub_always_push`: False
|
415 |
+
- `gradient_checkpointing`: False
|
416 |
+
- `gradient_checkpointing_kwargs`: None
|
417 |
+
- `include_inputs_for_metrics`: False
|
418 |
+
- `eval_do_concat_batches`: True
|
419 |
+
- `fp16_backend`: auto
|
420 |
+
- `push_to_hub_model_id`: None
|
421 |
+
- `push_to_hub_organization`: None
|
422 |
+
- `mp_parameters`:
|
423 |
+
- `auto_find_batch_size`: False
|
424 |
+
- `full_determinism`: False
|
425 |
+
- `torchdynamo`: None
|
426 |
+
- `ray_scope`: last
|
427 |
+
- `ddp_timeout`: 1800
|
428 |
+
- `torch_compile`: False
|
429 |
+
- `torch_compile_backend`: None
|
430 |
+
- `torch_compile_mode`: None
|
431 |
+
- `dispatch_batches`: None
|
432 |
+
- `split_batches`: None
|
433 |
+
- `include_tokens_per_second`: False
|
434 |
+
- `include_num_input_tokens_seen`: False
|
435 |
+
- `neftune_noise_alpha`: None
|
436 |
+
- `optim_target_modules`: None
|
437 |
+
- `batch_eval_metrics`: False
|
438 |
+
- `batch_sampler`: batch_sampler
|
439 |
+
- `multi_dataset_batch_sampler`: proportional
|
440 |
+
|
441 |
+
</details>
|
442 |
+
|
443 |
+
### Training Logs
|
444 |
+
| Epoch | Step | Training Loss | loss | custom-dev_spearman_cosine | custom-test_spearman_cosine |
|
445 |
+
|:------:|:----:|:-------------:|:------:|:--------------------------:|:---------------------------:|
|
446 |
+
| 0.3300 | 100 | 0.2137 | 0.0971 | 0.8252 | - |
|
447 |
+
| 0.6601 | 200 | 0.0722 | 0.0516 | 0.8445 | - |
|
448 |
+
| 0.9901 | 300 | 0.0503 | 0.0440 | 0.8480 | - |
|
449 |
+
| 1.3201 | 400 | 0.0353 | 0.0417 | 0.8479 | - |
|
450 |
+
| 1.6502 | 500 | 0.032 | 0.0388 | 0.8500 | - |
|
451 |
+
| 1.9802 | 600 | 0.0312 | 0.0375 | 0.8484 | - |
|
452 |
+
| 2.3102 | 700 | 0.0175 | 0.0380 | 0.8494 | - |
|
453 |
+
| 2.6403 | 800 | 0.016 | 0.0368 | 0.8486 | - |
|
454 |
+
| 2.9703 | 900 | 0.0158 | 0.0367 | 0.8486 | - |
|
455 |
+
| 3.3003 | 1000 | 0.0087 | 0.0394 | 0.8463 | - |
|
456 |
+
| 3.6304 | 1100 | 0.0086 | 0.0371 | 0.8463 | - |
|
457 |
+
| 3.9604 | 1200 | 0.0098 | 0.0368 | 0.8475 | - |
|
458 |
+
| 4.2904 | 1300 | 0.0055 | 0.0384 | 0.8496 | - |
|
459 |
+
| 4.6205 | 1400 | 0.0057 | 0.0379 | 0.8466 | - |
|
460 |
+
| 4.9505 | 1500 | 0.0057 | 0.0389 | 0.8473 | - |
|
461 |
+
| 5.2805 | 1600 | 0.0037 | 0.0391 | 0.8482 | - |
|
462 |
+
| 5.6106 | 1700 | 0.0042 | 0.0379 | 0.8477 | - |
|
463 |
+
| 5.9406 | 1800 | 0.0039 | 0.0380 | 0.8479 | - |
|
464 |
+
| 6.2706 | 1900 | 0.0026 | 0.0390 | 0.8477 | - |
|
465 |
+
| 6.6007 | 2000 | 0.0028 | 0.0390 | 0.8475 | - |
|
466 |
+
| 6.9307 | 2100 | 0.0031 | 0.0385 | 0.8473 | - |
|
467 |
+
| 7.2607 | 2200 | 0.0022 | 0.0393 | 0.8473 | - |
|
468 |
+
| 7.5908 | 2300 | 0.0021 | 0.0391 | 0.8470 | - |
|
469 |
+
| 7.9208 | 2400 | 0.002 | 0.0387 | 0.8482 | - |
|
470 |
+
| 8.2508 | 2500 | 0.0013 | 0.0389 | 0.8482 | - |
|
471 |
+
| 8.5809 | 2600 | 0.0014 | 0.0392 | 0.8484 | - |
|
472 |
+
| 8.9109 | 2700 | 0.0018 | 0.0390 | 0.8479 | - |
|
473 |
+
| 9.2409 | 2800 | 0.0015 | 0.0393 | 0.8480 | - |
|
474 |
+
| 9.5710 | 2900 | 0.0012 | 0.0393 | 0.8479 | - |
|
475 |
+
| 9.9010 | 3000 | 0.0013 | 0.0394 | 0.8477 | - |
|
476 |
+
| 10.0 | 3030 | - | - | - | 0.8454 |
|
477 |
+
|
478 |
+
|
479 |
+
### Framework Versions
|
480 |
+
- Python: 3.11.9
|
481 |
+
- Sentence Transformers: 3.0.0
|
482 |
+
- Transformers: 4.41.2
|
483 |
+
- PyTorch: 2.3.0+cu121
|
484 |
+
- Accelerate: 0.30.1
|
485 |
+
- Datasets: 2.19.1
|
486 |
+
- Tokenizers: 0.19.1
|
487 |
+
|
488 |
+
## Citation
|
489 |
+
|
490 |
+
### BibTeX
|
491 |
+
|
492 |
+
#### Sentence Transformers
|
493 |
+
```bibtex
|
494 |
+
@inproceedings{reimers-2019-sentence-bert,
|
495 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
496 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
497 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
498 |
+
month = "11",
|
499 |
+
year = "2019",
|
500 |
+
publisher = "Association for Computational Linguistics",
|
501 |
+
url = "https://arxiv.org/abs/1908.10084",
|
502 |
+
}
|
503 |
+
```
|
504 |
+
|
505 |
+
<!--
|
506 |
+
## Glossary
|
507 |
+
|
508 |
+
*Clearly define terms in order to be accessible across audiences.*
|
509 |
+
-->
|
510 |
+
|
511 |
+
<!--
|
512 |
+
## Model Card Authors
|
513 |
+
|
514 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
515 |
+
-->
|
516 |
+
|
517 |
+
<!--
|
518 |
+
## Model Card Contact
|
519 |
+
|
520 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
521 |
+
-->
|
config.json
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "./output/training_stsbenchmark_pierreinalco-distilbert-base-uncased-sts-2024-06-18_12-10-21/final",
|
3 |
+
"activation": "gelu",
|
4 |
+
"architectures": [
|
5 |
+
"DistilBertModel"
|
6 |
+
],
|
7 |
+
"attention_dropout": 0.1,
|
8 |
+
"dim": 768,
|
9 |
+
"dropout": 0.1,
|
10 |
+
"hidden_dim": 3072,
|
11 |
+
"initializer_range": 0.02,
|
12 |
+
"max_position_embeddings": 512,
|
13 |
+
"model_type": "distilbert",
|
14 |
+
"n_heads": 12,
|
15 |
+
"n_layers": 6,
|
16 |
+
"pad_token_id": 0,
|
17 |
+
"qa_dropout": 0.1,
|
18 |
+
"seq_classif_dropout": 0.2,
|
19 |
+
"sinusoidal_pos_embds": false,
|
20 |
+
"tie_weights_": true,
|
21 |
+
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.41.1",
|
23 |
+
"vocab_size": 30522
|
24 |
+
}
|
config_sentence_transformers.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "3.0.0",
|
4 |
+
"transformers": "4.41.1",
|
5 |
+
"pytorch": "2.3.0"
|
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:7fa8d03f1afd8a0203f39d7d34190aeff032f273edc7fbecf333e1b2104c7dc2
|
3 |
+
size 265462608
|
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 |
+
]
|
sentence_bert_config.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"max_seq_length": 512,
|
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,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_lower_case": true,
|
47 |
+
"mask_token": "[MASK]",
|
48 |
+
"max_length": 512,
|
49 |
+
"model_max_length": 512,
|
50 |
+
"pad_to_multiple_of": null,
|
51 |
+
"pad_token": "[PAD]",
|
52 |
+
"pad_token_type_id": 0,
|
53 |
+
"padding_side": "right",
|
54 |
+
"sep_token": "[SEP]",
|
55 |
+
"stride": 0,
|
56 |
+
"strip_accents": null,
|
57 |
+
"tokenize_chinese_chars": true,
|
58 |
+
"tokenizer_class": "DistilBertTokenizer",
|
59 |
+
"truncation_side": "right",
|
60 |
+
"truncation_strategy": "longest_first",
|
61 |
+
"unk_token": "[UNK]"
|
62 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|