Add new SentenceTransformer model.
Browse files- 1_Pooling/config.json +10 -0
- README.md +535 -0
- config.json +27 -0
- config_sentence_transformers.json +10 -0
- merges.txt +0 -0
- model.safetensors +3 -0
- modules.json +14 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +15 -0
- tokenizer.json +0 -0
- tokenizer_config.json +57 -0
- vocab.json +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,535 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
library_name: sentence-transformers
|
5 |
+
tags:
|
6 |
+
- sentence-transformers
|
7 |
+
- sentence-similarity
|
8 |
+
- feature-extraction
|
9 |
+
- loss:GISTEmbedLoss
|
10 |
+
base_model: distilbert/distilroberta-base
|
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: A woman sings.
|
24 |
+
sentences:
|
25 |
+
- The woman is singing.
|
26 |
+
- A story book is open.
|
27 |
+
- The men have blonde hair.
|
28 |
+
- source_sentence: a baby smiling
|
29 |
+
sentences:
|
30 |
+
- A baby is unhappy.
|
31 |
+
- a fireman on a ladder
|
32 |
+
- Five men stand on chairs.
|
33 |
+
- source_sentence: The boy scowls
|
34 |
+
sentences:
|
35 |
+
- A boy is outdoors.
|
36 |
+
- a man is wearing blue
|
37 |
+
- Two women are sleeping.
|
38 |
+
- source_sentence: There's a dock
|
39 |
+
sentences:
|
40 |
+
- A boat docked on a river.
|
41 |
+
- He is playing a song.
|
42 |
+
- The baby is in the crib.
|
43 |
+
- source_sentence: an eagle flies
|
44 |
+
sentences:
|
45 |
+
- A bird flying.
|
46 |
+
- The woman is outside.
|
47 |
+
- The people are sleeping.
|
48 |
+
pipeline_tag: sentence-similarity
|
49 |
+
co2_eq_emissions:
|
50 |
+
emissions: 1.6492452883656235
|
51 |
+
energy_consumed: 0.004242955498982829
|
52 |
+
source: codecarbon
|
53 |
+
training_type: fine-tuning
|
54 |
+
on_cloud: false
|
55 |
+
cpu_model: 13th Gen Intel(R) Core(TM) i7-13700K
|
56 |
+
ram_total_size: 31.777088165283203
|
57 |
+
hours_used: 0.021
|
58 |
+
hardware_used: 1 x NVIDIA GeForce RTX 3090
|
59 |
+
model-index:
|
60 |
+
- name: SentenceTransformer based on distilbert/distilroberta-base
|
61 |
+
results:
|
62 |
+
- task:
|
63 |
+
type: semantic-similarity
|
64 |
+
name: Semantic Similarity
|
65 |
+
dataset:
|
66 |
+
name: sts dev
|
67 |
+
type: sts-dev
|
68 |
+
metrics:
|
69 |
+
- type: pearson_cosine
|
70 |
+
value: 0.7695103533338594
|
71 |
+
name: Pearson Cosine
|
72 |
+
- type: spearman_cosine
|
73 |
+
value: 0.8046160770503588
|
74 |
+
name: Spearman Cosine
|
75 |
+
- type: pearson_manhattan
|
76 |
+
value: 0.7673329964610834
|
77 |
+
name: Pearson Manhattan
|
78 |
+
- type: spearman_manhattan
|
79 |
+
value: 0.7756781613323356
|
80 |
+
name: Spearman Manhattan
|
81 |
+
- type: pearson_euclidean
|
82 |
+
value: 0.7718833134570839
|
83 |
+
name: Pearson Euclidean
|
84 |
+
- type: spearman_euclidean
|
85 |
+
value: 0.7784941712509205
|
86 |
+
name: Spearman Euclidean
|
87 |
+
- type: pearson_dot
|
88 |
+
value: 0.22148844887336572
|
89 |
+
name: Pearson Dot
|
90 |
+
- type: spearman_dot
|
91 |
+
value: 0.2092109979282621
|
92 |
+
name: Spearman Dot
|
93 |
+
- type: pearson_max
|
94 |
+
value: 0.7718833134570839
|
95 |
+
name: Pearson Max
|
96 |
+
- type: spearman_max
|
97 |
+
value: 0.8046160770503588
|
98 |
+
name: Spearman Max
|
99 |
+
- task:
|
100 |
+
type: semantic-similarity
|
101 |
+
name: Semantic Similarity
|
102 |
+
dataset:
|
103 |
+
name: sts test
|
104 |
+
type: sts-test
|
105 |
+
metrics:
|
106 |
+
- type: pearson_cosine
|
107 |
+
value: 0.7270251484636511
|
108 |
+
name: Pearson Cosine
|
109 |
+
- type: spearman_cosine
|
110 |
+
value: 0.7463390012771995
|
111 |
+
name: Spearman Cosine
|
112 |
+
- type: pearson_manhattan
|
113 |
+
value: 0.7295418823252019
|
114 |
+
name: Pearson Manhattan
|
115 |
+
- type: spearman_manhattan
|
116 |
+
value: 0.7198414342133578
|
117 |
+
name: Spearman Manhattan
|
118 |
+
- type: pearson_euclidean
|
119 |
+
value: 0.7347198114628469
|
120 |
+
name: Pearson Euclidean
|
121 |
+
- type: spearman_euclidean
|
122 |
+
value: 0.724025904164009
|
123 |
+
name: Spearman Euclidean
|
124 |
+
- type: pearson_dot
|
125 |
+
value: 0.19404927455056548
|
126 |
+
name: Pearson Dot
|
127 |
+
- type: spearman_dot
|
128 |
+
value: 0.1791431711812991
|
129 |
+
name: Spearman Dot
|
130 |
+
- type: pearson_max
|
131 |
+
value: 0.7347198114628469
|
132 |
+
name: Pearson Max
|
133 |
+
- type: spearman_max
|
134 |
+
value: 0.7463390012771995
|
135 |
+
name: Spearman Max
|
136 |
+
---
|
137 |
+
|
138 |
+
# SentenceTransformer based on distilbert/distilroberta-base
|
139 |
+
|
140 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [distilbert/distilroberta-base](https://huggingface.co/distilbert/distilroberta-base) on the [sentence-transformers/all-nli](https://huggingface.co/datasets/sentence-transformers/all-nli) dataset. 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.
|
141 |
+
|
142 |
+
## Model Details
|
143 |
+
|
144 |
+
### Model Description
|
145 |
+
- **Model Type:** Sentence Transformer
|
146 |
+
- **Base model:** [distilbert/distilroberta-base](https://huggingface.co/distilbert/distilroberta-base) <!-- at revision fb53ab8802853c8e4fbdbcd0529f21fc6f459b2b -->
|
147 |
+
- **Maximum Sequence Length:** 512 tokens
|
148 |
+
- **Output Dimensionality:** 768 tokens
|
149 |
+
- **Similarity Function:** Cosine Similarity
|
150 |
+
- **Training Dataset:**
|
151 |
+
- [sentence-transformers/all-nli](https://huggingface.co/datasets/sentence-transformers/all-nli)
|
152 |
+
- **Language:** en
|
153 |
+
<!-- - **License:** Unknown -->
|
154 |
+
|
155 |
+
### Model Sources
|
156 |
+
|
157 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
158 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
159 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
160 |
+
|
161 |
+
### Full Model Architecture
|
162 |
+
|
163 |
+
```
|
164 |
+
SentenceTransformer(
|
165 |
+
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: RobertaModel
|
166 |
+
(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})
|
167 |
+
)
|
168 |
+
```
|
169 |
+
|
170 |
+
## Usage
|
171 |
+
|
172 |
+
### Direct Usage (Sentence Transformers)
|
173 |
+
|
174 |
+
First install the Sentence Transformers library:
|
175 |
+
|
176 |
+
```bash
|
177 |
+
pip install -U sentence-transformers
|
178 |
+
```
|
179 |
+
|
180 |
+
Then you can load this model and run inference.
|
181 |
+
```python
|
182 |
+
from sentence_transformers import SentenceTransformer
|
183 |
+
|
184 |
+
# Download from the 🤗 Hub
|
185 |
+
model = SentenceTransformer("tomaarsen/distilroberta-base-nli-v3")
|
186 |
+
# Run inference
|
187 |
+
sentences = [
|
188 |
+
'an eagle flies',
|
189 |
+
'A bird flying.',
|
190 |
+
'The woman is outside.',
|
191 |
+
]
|
192 |
+
embeddings = model.encode(sentences)
|
193 |
+
print(embeddings.shape)
|
194 |
+
# [3, 768]
|
195 |
+
|
196 |
+
# Get the similarity scores for the embeddings
|
197 |
+
similarities = model.similarity(embeddings)
|
198 |
+
print(similarities.shape)
|
199 |
+
# [3, 3]
|
200 |
+
```
|
201 |
+
|
202 |
+
<!--
|
203 |
+
### Direct Usage (Transformers)
|
204 |
+
|
205 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
206 |
+
|
207 |
+
</details>
|
208 |
+
-->
|
209 |
+
|
210 |
+
<!--
|
211 |
+
### Downstream Usage (Sentence Transformers)
|
212 |
+
|
213 |
+
You can finetune this model on your own dataset.
|
214 |
+
|
215 |
+
<details><summary>Click to expand</summary>
|
216 |
+
|
217 |
+
</details>
|
218 |
+
-->
|
219 |
+
|
220 |
+
<!--
|
221 |
+
### Out-of-Scope Use
|
222 |
+
|
223 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
224 |
+
-->
|
225 |
+
|
226 |
+
## Evaluation
|
227 |
+
|
228 |
+
### Metrics
|
229 |
+
|
230 |
+
#### Semantic Similarity
|
231 |
+
* Dataset: `sts-dev`
|
232 |
+
* Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
|
233 |
+
|
234 |
+
| Metric | Value |
|
235 |
+
|:--------------------|:-----------|
|
236 |
+
| pearson_cosine | 0.7695 |
|
237 |
+
| **spearman_cosine** | **0.8046** |
|
238 |
+
| pearson_manhattan | 0.7673 |
|
239 |
+
| spearman_manhattan | 0.7757 |
|
240 |
+
| pearson_euclidean | 0.7719 |
|
241 |
+
| spearman_euclidean | 0.7785 |
|
242 |
+
| pearson_dot | 0.2215 |
|
243 |
+
| spearman_dot | 0.2092 |
|
244 |
+
| pearson_max | 0.7719 |
|
245 |
+
| spearman_max | 0.8046 |
|
246 |
+
|
247 |
+
#### Semantic Similarity
|
248 |
+
* Dataset: `sts-test`
|
249 |
+
* Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
|
250 |
+
|
251 |
+
| Metric | Value |
|
252 |
+
|:--------------------|:-----------|
|
253 |
+
| pearson_cosine | 0.727 |
|
254 |
+
| **spearman_cosine** | **0.7463** |
|
255 |
+
| pearson_manhattan | 0.7295 |
|
256 |
+
| spearman_manhattan | 0.7198 |
|
257 |
+
| pearson_euclidean | 0.7347 |
|
258 |
+
| spearman_euclidean | 0.724 |
|
259 |
+
| pearson_dot | 0.194 |
|
260 |
+
| spearman_dot | 0.1791 |
|
261 |
+
| pearson_max | 0.7347 |
|
262 |
+
| spearman_max | 0.7463 |
|
263 |
+
|
264 |
+
<!--
|
265 |
+
## Bias, Risks and Limitations
|
266 |
+
|
267 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
268 |
+
-->
|
269 |
+
|
270 |
+
<!--
|
271 |
+
### Recommendations
|
272 |
+
|
273 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
274 |
+
-->
|
275 |
+
|
276 |
+
## Training Details
|
277 |
+
|
278 |
+
### Training Dataset
|
279 |
+
|
280 |
+
#### sentence-transformers/all-nli
|
281 |
+
|
282 |
+
* Dataset: [sentence-transformers/all-nli](https://huggingface.co/datasets/sentence-transformers/all-nli) at [cc6c526](https://huggingface.co/datasets/sentence-transformers/all-nli/tree/cc6c526380e29912b5c6fa03682da4daf773c013)
|
283 |
+
* Size: 10,000 training samples
|
284 |
+
* Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
|
285 |
+
* Approximate statistics based on the first 1000 samples:
|
286 |
+
| | anchor | positive | negative |
|
287 |
+
|:--------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|
|
288 |
+
| type | string | string | string |
|
289 |
+
| details | <ul><li>min: 7 tokens</li><li>mean: 10.38 tokens</li><li>max: 45 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 12.8 tokens</li><li>max: 39 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 13.4 tokens</li><li>max: 50 tokens</li></ul> |
|
290 |
+
* Samples:
|
291 |
+
| anchor | positive | negative |
|
292 |
+
|:---------------------------------------------------------------------------|:-------------------------------------------------|:-----------------------------------------------------------|
|
293 |
+
| <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> |
|
294 |
+
| <code>Children smiling and waving at camera</code> | <code>There are children present</code> | <code>The kids are frowning</code> |
|
295 |
+
| <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> |
|
296 |
+
* Loss: [<code>GISTEmbedLoss</code>](https://sbert.net/docs/package_reference/losses.html#gistembedloss) with these parameters:
|
297 |
+
```json
|
298 |
+
{'guide': SentenceTransformer(
|
299 |
+
(0): Transformer({'max_seq_length': 256, 'do_lower_case': False}) with Transformer model: BertModel
|
300 |
+
(1): Pooling({'word_embedding_dimension': 384, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
|
301 |
+
(2): Normalize()
|
302 |
+
), 'temperature': 0.01}
|
303 |
+
```
|
304 |
+
|
305 |
+
### Evaluation Dataset
|
306 |
+
|
307 |
+
#### sentence-transformers/all-nli
|
308 |
+
|
309 |
+
* Dataset: [sentence-transformers/all-nli](https://huggingface.co/datasets/sentence-transformers/all-nli) at [cc6c526](https://huggingface.co/datasets/sentence-transformers/all-nli/tree/cc6c526380e29912b5c6fa03682da4daf773c013)
|
310 |
+
* Size: 1,000 evaluation samples
|
311 |
+
* Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
|
312 |
+
* Approximate statistics based on the first 1000 samples:
|
313 |
+
| | anchor | positive | negative |
|
314 |
+
|:--------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
|
315 |
+
| type | string | string | string |
|
316 |
+
| details | <ul><li>min: 6 tokens</li><li>mean: 18.02 tokens</li><li>max: 66 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 9.81 tokens</li><li>max: 29 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 10.37 tokens</li><li>max: 29 tokens</li></ul> |
|
317 |
+
* Samples:
|
318 |
+
| anchor | positive | negative |
|
319 |
+
|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------|:--------------------------------------------------------|
|
320 |
+
| <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> |
|
321 |
+
| <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> |
|
322 |
+
| <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> |
|
323 |
+
* Loss: [<code>GISTEmbedLoss</code>](https://sbert.net/docs/package_reference/losses.html#gistembedloss) with these parameters:
|
324 |
+
```json
|
325 |
+
{'guide': SentenceTransformer(
|
326 |
+
(0): Transformer({'max_seq_length': 256, 'do_lower_case': False}) with Transformer model: BertModel
|
327 |
+
(1): Pooling({'word_embedding_dimension': 384, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
|
328 |
+
(2): Normalize()
|
329 |
+
), 'temperature': 0.01}
|
330 |
+
```
|
331 |
+
|
332 |
+
### Training Hyperparameters
|
333 |
+
#### Non-Default Hyperparameters
|
334 |
+
|
335 |
+
- `eval_strategy`: steps
|
336 |
+
- `per_device_train_batch_size`: 128
|
337 |
+
- `per_device_eval_batch_size`: 128
|
338 |
+
- `num_train_epochs`: 1
|
339 |
+
- `warmup_ratio`: 0.1
|
340 |
+
- `fp16`: True
|
341 |
+
- `batch_sampler`: no_duplicates
|
342 |
+
|
343 |
+
#### All Hyperparameters
|
344 |
+
<details><summary>Click to expand</summary>
|
345 |
+
|
346 |
+
- `overwrite_output_dir`: False
|
347 |
+
- `do_predict`: False
|
348 |
+
- `eval_strategy`: steps
|
349 |
+
- `prediction_loss_only`: False
|
350 |
+
- `per_device_train_batch_size`: 128
|
351 |
+
- `per_device_eval_batch_size`: 128
|
352 |
+
- `per_gpu_train_batch_size`: None
|
353 |
+
- `per_gpu_eval_batch_size`: None
|
354 |
+
- `gradient_accumulation_steps`: 1
|
355 |
+
- `eval_accumulation_steps`: None
|
356 |
+
- `learning_rate`: 5e-05
|
357 |
+
- `weight_decay`: 0.0
|
358 |
+
- `adam_beta1`: 0.9
|
359 |
+
- `adam_beta2`: 0.999
|
360 |
+
- `adam_epsilon`: 1e-08
|
361 |
+
- `max_grad_norm`: 1.0
|
362 |
+
- `num_train_epochs`: 1
|
363 |
+
- `max_steps`: -1
|
364 |
+
- `lr_scheduler_type`: linear
|
365 |
+
- `lr_scheduler_kwargs`: {}
|
366 |
+
- `warmup_ratio`: 0.1
|
367 |
+
- `warmup_steps`: 0
|
368 |
+
- `log_level`: passive
|
369 |
+
- `log_level_replica`: warning
|
370 |
+
- `log_on_each_node`: True
|
371 |
+
- `logging_nan_inf_filter`: True
|
372 |
+
- `save_safetensors`: True
|
373 |
+
- `save_on_each_node`: False
|
374 |
+
- `save_only_model`: False
|
375 |
+
- `no_cuda`: False
|
376 |
+
- `use_cpu`: False
|
377 |
+
- `use_mps_device`: False
|
378 |
+
- `seed`: 42
|
379 |
+
- `data_seed`: None
|
380 |
+
- `jit_mode_eval`: False
|
381 |
+
- `use_ipex`: False
|
382 |
+
- `bf16`: False
|
383 |
+
- `fp16`: True
|
384 |
+
- `fp16_opt_level`: O1
|
385 |
+
- `half_precision_backend`: auto
|
386 |
+
- `bf16_full_eval`: False
|
387 |
+
- `fp16_full_eval`: False
|
388 |
+
- `tf32`: None
|
389 |
+
- `local_rank`: 0
|
390 |
+
- `ddp_backend`: None
|
391 |
+
- `tpu_num_cores`: None
|
392 |
+
- `tpu_metrics_debug`: False
|
393 |
+
- `debug`: []
|
394 |
+
- `dataloader_drop_last`: False
|
395 |
+
- `dataloader_num_workers`: 0
|
396 |
+
- `dataloader_prefetch_factor`: None
|
397 |
+
- `past_index`: -1
|
398 |
+
- `disable_tqdm`: False
|
399 |
+
- `remove_unused_columns`: True
|
400 |
+
- `label_names`: None
|
401 |
+
- `load_best_model_at_end`: False
|
402 |
+
- `ignore_data_skip`: False
|
403 |
+
- `fsdp`: []
|
404 |
+
- `fsdp_min_num_params`: 0
|
405 |
+
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
406 |
+
- `fsdp_transformer_layer_cls_to_wrap`: None
|
407 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
408 |
+
- `deepspeed`: None
|
409 |
+
- `label_smoothing_factor`: 0.0
|
410 |
+
- `optim`: adamw_torch
|
411 |
+
- `optim_args`: None
|
412 |
+
- `adafactor`: False
|
413 |
+
- `group_by_length`: False
|
414 |
+
- `length_column_name`: length
|
415 |
+
- `ddp_find_unused_parameters`: None
|
416 |
+
- `ddp_bucket_cap_mb`: None
|
417 |
+
- `ddp_broadcast_buffers`: None
|
418 |
+
- `dataloader_pin_memory`: True
|
419 |
+
- `dataloader_persistent_workers`: False
|
420 |
+
- `skip_memory_metrics`: True
|
421 |
+
- `use_legacy_prediction_loop`: False
|
422 |
+
- `push_to_hub`: False
|
423 |
+
- `resume_from_checkpoint`: None
|
424 |
+
- `hub_model_id`: None
|
425 |
+
- `hub_strategy`: every_save
|
426 |
+
- `hub_private_repo`: False
|
427 |
+
- `hub_always_push`: False
|
428 |
+
- `gradient_checkpointing`: False
|
429 |
+
- `gradient_checkpointing_kwargs`: None
|
430 |
+
- `include_inputs_for_metrics`: False
|
431 |
+
- `eval_do_concat_batches`: True
|
432 |
+
- `fp16_backend`: auto
|
433 |
+
- `push_to_hub_model_id`: None
|
434 |
+
- `push_to_hub_organization`: None
|
435 |
+
- `mp_parameters`:
|
436 |
+
- `auto_find_batch_size`: False
|
437 |
+
- `full_determinism`: False
|
438 |
+
- `torchdynamo`: None
|
439 |
+
- `ray_scope`: last
|
440 |
+
- `ddp_timeout`: 1800
|
441 |
+
- `torch_compile`: False
|
442 |
+
- `torch_compile_backend`: None
|
443 |
+
- `torch_compile_mode`: None
|
444 |
+
- `dispatch_batches`: None
|
445 |
+
- `split_batches`: None
|
446 |
+
- `include_tokens_per_second`: False
|
447 |
+
- `include_num_input_tokens_seen`: False
|
448 |
+
- `neftune_noise_alpha`: None
|
449 |
+
- `optim_target_modules`: None
|
450 |
+
- `batch_sampler`: no_duplicates
|
451 |
+
- `multi_dataset_batch_sampler`: proportional
|
452 |
+
|
453 |
+
</details>
|
454 |
+
|
455 |
+
### Training Logs
|
456 |
+
| Epoch | Step | loss | sts-dev_spearman_cosine | sts-test_spearman_cosine |
|
457 |
+
|:------:|:----:|:------:|:-----------------------:|:------------------------:|
|
458 |
+
| 0 | 0 | - | 0.6375 | - |
|
459 |
+
| 0.1266 | 10 | 2.5172 | 0.7944 | - |
|
460 |
+
| 0.2532 | 20 | 1.8059 | 0.8061 | - |
|
461 |
+
| 0.3797 | 30 | 1.6805 | 0.8163 | - |
|
462 |
+
| 0.5063 | 40 | 1.8153 | 0.8167 | - |
|
463 |
+
| 0.6329 | 50 | 1.7177 | 0.8121 | - |
|
464 |
+
| 0.7595 | 60 | 1.8622 | 0.8031 | - |
|
465 |
+
| 0.8861 | 70 | 1.8056 | 0.8046 | - |
|
466 |
+
| 1.0 | 79 | - | - | 0.7463 |
|
467 |
+
|
468 |
+
|
469 |
+
### Environmental Impact
|
470 |
+
Carbon emissions were measured using [CodeCarbon](https://github.com/mlco2/codecarbon).
|
471 |
+
- **Energy Consumed**: 0.004 kWh
|
472 |
+
- **Carbon Emitted**: 0.002 kg of CO2
|
473 |
+
- **Hours Used**: 0.021 hours
|
474 |
+
|
475 |
+
### Training Hardware
|
476 |
+
- **On Cloud**: No
|
477 |
+
- **GPU Model**: 1 x NVIDIA GeForce RTX 3090
|
478 |
+
- **CPU Model**: 13th Gen Intel(R) Core(TM) i7-13700K
|
479 |
+
- **RAM Size**: 31.78 GB
|
480 |
+
|
481 |
+
### Framework Versions
|
482 |
+
- Python: 3.11.6
|
483 |
+
- Sentence Transformers: 3.0.0.dev0
|
484 |
+
- Transformers: 4.41.0.dev0
|
485 |
+
- PyTorch: 2.3.0+cu121
|
486 |
+
- Accelerate: 0.26.1
|
487 |
+
- Datasets: 2.18.0
|
488 |
+
- Tokenizers: 0.19.1
|
489 |
+
|
490 |
+
## Citation
|
491 |
+
|
492 |
+
### BibTeX
|
493 |
+
|
494 |
+
#### Sentence Transformers
|
495 |
+
```bibtex
|
496 |
+
@inproceedings{reimers-2019-sentence-bert,
|
497 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
498 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
499 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
500 |
+
month = "11",
|
501 |
+
year = "2019",
|
502 |
+
publisher = "Association for Computational Linguistics",
|
503 |
+
url = "https://arxiv.org/abs/1908.10084",
|
504 |
+
}
|
505 |
+
```
|
506 |
+
|
507 |
+
#### GISTEmbedLoss
|
508 |
+
```bibtex
|
509 |
+
@misc{solatorio2024gistembed,
|
510 |
+
title={GISTEmbed: Guided In-sample Selection of Training Negatives for Text Embedding Fine-tuning},
|
511 |
+
author={Aivin V. Solatorio},
|
512 |
+
year={2024},
|
513 |
+
eprint={2402.16829},
|
514 |
+
archivePrefix={arXiv},
|
515 |
+
primaryClass={cs.LG}
|
516 |
+
}
|
517 |
+
```
|
518 |
+
|
519 |
+
<!--
|
520 |
+
## Glossary
|
521 |
+
|
522 |
+
*Clearly define terms in order to be accessible across audiences.*
|
523 |
+
-->
|
524 |
+
|
525 |
+
<!--
|
526 |
+
## Model Card Authors
|
527 |
+
|
528 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
529 |
+
-->
|
530 |
+
|
531 |
+
<!--
|
532 |
+
## Model Card Contact
|
533 |
+
|
534 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
535 |
+
-->
|
config.json
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "distilroberta-base",
|
3 |
+
"architectures": [
|
4 |
+
"RobertaModel"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"bos_token_id": 0,
|
8 |
+
"classifier_dropout": null,
|
9 |
+
"eos_token_id": 2,
|
10 |
+
"hidden_act": "gelu",
|
11 |
+
"hidden_dropout_prob": 0.1,
|
12 |
+
"hidden_size": 768,
|
13 |
+
"initializer_range": 0.02,
|
14 |
+
"intermediate_size": 3072,
|
15 |
+
"layer_norm_eps": 1e-05,
|
16 |
+
"max_position_embeddings": 514,
|
17 |
+
"model_type": "roberta",
|
18 |
+
"num_attention_heads": 12,
|
19 |
+
"num_hidden_layers": 6,
|
20 |
+
"pad_token_id": 1,
|
21 |
+
"position_embedding_type": "absolute",
|
22 |
+
"torch_dtype": "float32",
|
23 |
+
"transformers_version": "4.41.0.dev0",
|
24 |
+
"type_vocab_size": 1,
|
25 |
+
"use_cache": true,
|
26 |
+
"vocab_size": 50265
|
27 |
+
}
|
config_sentence_transformers.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "3.0.0.dev0",
|
4 |
+
"transformers": "4.41.0.dev0",
|
5 |
+
"pytorch": "2.3.0+cu121"
|
6 |
+
},
|
7 |
+
"prompts": {},
|
8 |
+
"default_prompt_name": null,
|
9 |
+
"similarity_fn_name": null
|
10 |
+
}
|
merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:48a0145f07d9271b1d30e6130c312f64950ef20ec8908fc2b8b87ca4fa82f74b
|
3 |
+
size 328485128
|
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,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": "<s>",
|
3 |
+
"cls_token": "<s>",
|
4 |
+
"eos_token": "</s>",
|
5 |
+
"mask_token": {
|
6 |
+
"content": "<mask>",
|
7 |
+
"lstrip": true,
|
8 |
+
"normalized": false,
|
9 |
+
"rstrip": false,
|
10 |
+
"single_word": false
|
11 |
+
},
|
12 |
+
"pad_token": "<pad>",
|
13 |
+
"sep_token": "</s>",
|
14 |
+
"unk_token": "<unk>"
|
15 |
+
}
|
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 |
+
"add_prefix_space": false,
|
3 |
+
"added_tokens_decoder": {
|
4 |
+
"0": {
|
5 |
+
"content": "<s>",
|
6 |
+
"lstrip": false,
|
7 |
+
"normalized": true,
|
8 |
+
"rstrip": false,
|
9 |
+
"single_word": false,
|
10 |
+
"special": true
|
11 |
+
},
|
12 |
+
"1": {
|
13 |
+
"content": "<pad>",
|
14 |
+
"lstrip": false,
|
15 |
+
"normalized": true,
|
16 |
+
"rstrip": false,
|
17 |
+
"single_word": false,
|
18 |
+
"special": true
|
19 |
+
},
|
20 |
+
"2": {
|
21 |
+
"content": "</s>",
|
22 |
+
"lstrip": false,
|
23 |
+
"normalized": true,
|
24 |
+
"rstrip": false,
|
25 |
+
"single_word": false,
|
26 |
+
"special": true
|
27 |
+
},
|
28 |
+
"3": {
|
29 |
+
"content": "<unk>",
|
30 |
+
"lstrip": false,
|
31 |
+
"normalized": true,
|
32 |
+
"rstrip": false,
|
33 |
+
"single_word": false,
|
34 |
+
"special": true
|
35 |
+
},
|
36 |
+
"50264": {
|
37 |
+
"content": "<mask>",
|
38 |
+
"lstrip": true,
|
39 |
+
"normalized": false,
|
40 |
+
"rstrip": false,
|
41 |
+
"single_word": false,
|
42 |
+
"special": true
|
43 |
+
}
|
44 |
+
},
|
45 |
+
"bos_token": "<s>",
|
46 |
+
"clean_up_tokenization_spaces": true,
|
47 |
+
"cls_token": "<s>",
|
48 |
+
"eos_token": "</s>",
|
49 |
+
"errors": "replace",
|
50 |
+
"mask_token": "<mask>",
|
51 |
+
"model_max_length": 512,
|
52 |
+
"pad_token": "<pad>",
|
53 |
+
"sep_token": "</s>",
|
54 |
+
"tokenizer_class": "RobertaTokenizer",
|
55 |
+
"trim_offsets": true,
|
56 |
+
"unk_token": "<unk>"
|
57 |
+
}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|