ostoveland
commited on
Commit
•
8e76524
1
Parent(s):
43e4164
Add new SentenceTransformer model.
Browse files- 1_Pooling/config.json +10 -0
- README.md +530 -0
- config.json +32 -0
- config_sentence_transformers.json +10 -0
- modules.json +14 -0
- pytorch_model.bin +3 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +37 -0
- tokenizer.json +0 -0
- tokenizer_config.json +64 -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,530 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- sentence-transformers
|
4 |
+
- sentence-similarity
|
5 |
+
- feature-extraction
|
6 |
+
- generated_from_trainer
|
7 |
+
- dataset_size:96724
|
8 |
+
- loss:Matryoshka2dLoss
|
9 |
+
- loss:MatryoshkaLoss
|
10 |
+
- loss:TripletLoss
|
11 |
+
- loss:MultipleNegativesRankingLoss
|
12 |
+
- loss:CoSENTLoss
|
13 |
+
base_model: NbAiLab/nb-sbert-base
|
14 |
+
widget:
|
15 |
+
- source_sentence: installere nytt gulv i låve
|
16 |
+
sentences:
|
17 |
+
- sparkling av 130 kvm vegg på loft
|
18 |
+
- legge nytt gulv i låve
|
19 |
+
- plenanlegg
|
20 |
+
- source_sentence: Beskjæring av høy hekk
|
21 |
+
sentences:
|
22 |
+
- Beskjæring/ kapping av tre
|
23 |
+
- Fornyelse av fasade
|
24 |
+
- Bytting av garasjeport motor
|
25 |
+
- source_sentence: Søker takstmann til nyoppusset 3 roms leilighet på Nordnes/sentrum.
|
26 |
+
Hjørneleilighet, heis, stor altan på 11m2
|
27 |
+
sentences:
|
28 |
+
- Montering av nytt kjøkken
|
29 |
+
- Installere varmepumpe
|
30 |
+
- Tilstandsrapport med verdivurdering, enebolig, Bærum
|
31 |
+
- source_sentence: Skadedyrsokntroll
|
32 |
+
sentences:
|
33 |
+
- asfaltering
|
34 |
+
- Oppføring av garasje
|
35 |
+
- Veggedyr bekjempelse
|
36 |
+
- source_sentence: Støp og fliselegging av gang
|
37 |
+
sentences:
|
38 |
+
- Reparasjon av råteskader på hus
|
39 |
+
- hagearbeid i fellesområder
|
40 |
+
- Støp av gulv i kjeller
|
41 |
+
pipeline_tag: sentence-similarity
|
42 |
+
library_name: sentence-transformers
|
43 |
+
---
|
44 |
+
|
45 |
+
# SentenceTransformer based on NbAiLab/nb-sbert-base
|
46 |
+
|
47 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [NbAiLab/nb-sbert-base](https://huggingface.co/NbAiLab/nb-sbert-base). It maps sentences & paragraphs to a 64-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
|
48 |
+
|
49 |
+
## Model Details
|
50 |
+
|
51 |
+
### Model Description
|
52 |
+
- **Model Type:** Sentence Transformer
|
53 |
+
- **Base model:** [NbAiLab/nb-sbert-base](https://huggingface.co/NbAiLab/nb-sbert-base) <!-- at revision 26567595914b5f4b04ec871b5814db989ca261b9 -->
|
54 |
+
- **Maximum Sequence Length:** 75 tokens
|
55 |
+
- **Output Dimensionality:** 64 dimensions
|
56 |
+
- **Similarity Function:** Cosine Similarity
|
57 |
+
<!-- - **Training Dataset:** Unknown -->
|
58 |
+
<!-- - **Language:** Unknown -->
|
59 |
+
<!-- - **License:** Unknown -->
|
60 |
+
|
61 |
+
### Model Sources
|
62 |
+
|
63 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
64 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
65 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
66 |
+
|
67 |
+
### Full Model Architecture
|
68 |
+
|
69 |
+
```
|
70 |
+
SentenceTransformer(
|
71 |
+
(0): Transformer({'max_seq_length': 75, 'do_lower_case': False}) with Transformer model: BertModel
|
72 |
+
(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})
|
73 |
+
)
|
74 |
+
```
|
75 |
+
|
76 |
+
## Usage
|
77 |
+
|
78 |
+
### Direct Usage (Sentence Transformers)
|
79 |
+
|
80 |
+
First install the Sentence Transformers library:
|
81 |
+
|
82 |
+
```bash
|
83 |
+
pip install -U sentence-transformers
|
84 |
+
```
|
85 |
+
|
86 |
+
Then you can load this model and run inference.
|
87 |
+
```python
|
88 |
+
from sentence_transformers import SentenceTransformer
|
89 |
+
|
90 |
+
# Download from the 🤗 Hub
|
91 |
+
model = SentenceTransformer("ostoveland/SBertBaseMittanbudver3")
|
92 |
+
# Run inference
|
93 |
+
sentences = [
|
94 |
+
'Støp og fliselegging av gang',
|
95 |
+
'Støp av gulv i kjeller',
|
96 |
+
'Reparasjon av råteskader på hus',
|
97 |
+
]
|
98 |
+
embeddings = model.encode(sentences)
|
99 |
+
print(embeddings.shape)
|
100 |
+
# [3, 64]
|
101 |
+
|
102 |
+
# Get the similarity scores for the embeddings
|
103 |
+
similarities = model.similarity(embeddings, embeddings)
|
104 |
+
print(similarities.shape)
|
105 |
+
# [3, 3]
|
106 |
+
```
|
107 |
+
|
108 |
+
<!--
|
109 |
+
### Direct Usage (Transformers)
|
110 |
+
|
111 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
112 |
+
|
113 |
+
</details>
|
114 |
+
-->
|
115 |
+
|
116 |
+
<!--
|
117 |
+
### Downstream Usage (Sentence Transformers)
|
118 |
+
|
119 |
+
You can finetune this model on your own dataset.
|
120 |
+
|
121 |
+
<details><summary>Click to expand</summary>
|
122 |
+
|
123 |
+
</details>
|
124 |
+
-->
|
125 |
+
|
126 |
+
<!--
|
127 |
+
### Out-of-Scope Use
|
128 |
+
|
129 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
130 |
+
-->
|
131 |
+
|
132 |
+
<!--
|
133 |
+
## Bias, Risks and Limitations
|
134 |
+
|
135 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
136 |
+
-->
|
137 |
+
|
138 |
+
<!--
|
139 |
+
### Recommendations
|
140 |
+
|
141 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
142 |
+
-->
|
143 |
+
|
144 |
+
## Training Details
|
145 |
+
|
146 |
+
### Training Datasets
|
147 |
+
|
148 |
+
#### Unnamed Dataset
|
149 |
+
|
150 |
+
|
151 |
+
* Size: 55,426 training samples
|
152 |
+
* Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>sentence_2</code>
|
153 |
+
* Approximate statistics based on the first 1000 samples:
|
154 |
+
| | sentence_0 | sentence_1 | sentence_2 |
|
155 |
+
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
|
156 |
+
| type | string | string | string |
|
157 |
+
| details | <ul><li>min: 3 tokens</li><li>mean: 11.59 tokens</li><li>max: 49 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 10.69 tokens</li><li>max: 39 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 10.44 tokens</li><li>max: 39 tokens</li></ul> |
|
158 |
+
* Samples:
|
159 |
+
| sentence_0 | sentence_1 | sentence_2 |
|
160 |
+
|:------------------------------------------------------------------|:-----------------------------------------------------------------|:------------------------------------------------------|
|
161 |
+
| <code>Vaskerom</code> | <code>Ønsker tilbud på legging av våtromsbelegg lite bad:</code> | <code>Verdivurdering av 177 kvm stor enebolig.</code> |
|
162 |
+
| <code>Bytte lås i leilighet i Obos borettslag, Galgeberg. </code> | <code>Bytte postkasselås</code> | <code>Helsparkling av betongvegger med tapet</code> |
|
163 |
+
| <code>Legging av mikrosement</code> | <code>Ønsker tilbud på mikrosement</code> | <code>Betongsaging - 2 nye utvendige vinduer</code> |
|
164 |
+
* Loss: [<code>Matryoshka2dLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshka2dloss) with these parameters:
|
165 |
+
```json
|
166 |
+
{
|
167 |
+
"loss": "TripletLoss",
|
168 |
+
"n_layers_per_step": 1,
|
169 |
+
"last_layer_weight": 1.0,
|
170 |
+
"prior_layers_weight": 1.0,
|
171 |
+
"kl_div_weight": 1.0,
|
172 |
+
"kl_temperature": 0.3,
|
173 |
+
"matryoshka_dims": [
|
174 |
+
768,
|
175 |
+
512,
|
176 |
+
256,
|
177 |
+
128,
|
178 |
+
64
|
179 |
+
],
|
180 |
+
"matryoshka_weights": [
|
181 |
+
1,
|
182 |
+
1,
|
183 |
+
1,
|
184 |
+
1,
|
185 |
+
1
|
186 |
+
],
|
187 |
+
"n_dims_per_step": 1
|
188 |
+
}
|
189 |
+
```
|
190 |
+
|
191 |
+
#### Unnamed Dataset
|
192 |
+
|
193 |
+
|
194 |
+
* Size: 22,563 training samples
|
195 |
+
* Columns: <code>sentence_0</code> and <code>sentence_1</code>
|
196 |
+
* Approximate statistics based on the first 1000 samples:
|
197 |
+
| | sentence_0 | sentence_1 |
|
198 |
+
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
|
199 |
+
| type | string | string |
|
200 |
+
| details | <ul><li>min: 4 tokens</li><li>mean: 10.79 tokens</li><li>max: 37 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 10.17 tokens</li><li>max: 27 tokens</li></ul> |
|
201 |
+
* Samples:
|
202 |
+
| sentence_0 | sentence_1 |
|
203 |
+
|:----------------------------------------------------|:--------------------------------------------|
|
204 |
+
| <code>Trefelling - 1 stor gran og en osp</code> | <code>trefelling av stor gran og osp</code> |
|
205 |
+
| <code>Bærebjelker - vurdering</code> | <code>sjekk av bærebjelker</code> |
|
206 |
+
| <code>Mindre graveoppdrag - 30m2 x 40cm dypt</code> | <code>mindre gravearbeid</code> |
|
207 |
+
* Loss: [<code>Matryoshka2dLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshka2dloss) with these parameters:
|
208 |
+
```json
|
209 |
+
{
|
210 |
+
"loss": "MultipleNegativesRankingLoss",
|
211 |
+
"n_layers_per_step": 1,
|
212 |
+
"last_layer_weight": 1.0,
|
213 |
+
"prior_layers_weight": 1.0,
|
214 |
+
"kl_div_weight": 1.0,
|
215 |
+
"kl_temperature": 0.3,
|
216 |
+
"matryoshka_dims": [
|
217 |
+
768,
|
218 |
+
512,
|
219 |
+
256,
|
220 |
+
128,
|
221 |
+
64
|
222 |
+
],
|
223 |
+
"matryoshka_weights": [
|
224 |
+
1,
|
225 |
+
1,
|
226 |
+
1,
|
227 |
+
1,
|
228 |
+
1
|
229 |
+
],
|
230 |
+
"n_dims_per_step": 1
|
231 |
+
}
|
232 |
+
```
|
233 |
+
|
234 |
+
#### Unnamed Dataset
|
235 |
+
|
236 |
+
|
237 |
+
* Size: 18,735 training samples
|
238 |
+
* Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>label</code>
|
239 |
+
* Approximate statistics based on the first 1000 samples:
|
240 |
+
| | sentence_0 | sentence_1 | label |
|
241 |
+
|:--------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------|
|
242 |
+
| type | string | string | float |
|
243 |
+
| details | <ul><li>min: 4 tokens</li><li>mean: 13.64 tokens</li><li>max: 55 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 9.56 tokens</li><li>max: 27 tokens</li></ul> | <ul><li>min: 0.05</li><li>mean: 0.5</li><li>max: 0.95</li></ul> |
|
244 |
+
* Samples:
|
245 |
+
| sentence_0 | sentence_1 | label |
|
246 |
+
|:-----------------------------------------------|:-----------------------------------------------|:------------------|
|
247 |
+
| <code>Pusse murvegg</code> | <code>Pusse opp vegg</code> | <code>0.75</code> |
|
248 |
+
| <code>Flyttevask av leilighet på 35 kvm</code> | <code>Flyttevask av leilighet på 40 kvm</code> | <code>0.95</code> |
|
249 |
+
| <code>Flis 30x 60 - 40m2</code> | <code>Flislegging av gulv, 40m2</code> | <code>0.75</code> |
|
250 |
+
* Loss: [<code>Matryoshka2dLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshka2dloss) with these parameters:
|
251 |
+
```json
|
252 |
+
{
|
253 |
+
"loss": "CoSENTLoss",
|
254 |
+
"n_layers_per_step": 1,
|
255 |
+
"last_layer_weight": 1.0,
|
256 |
+
"prior_layers_weight": 1.0,
|
257 |
+
"kl_div_weight": 1.0,
|
258 |
+
"kl_temperature": 0.3,
|
259 |
+
"matryoshka_dims": [
|
260 |
+
768,
|
261 |
+
512,
|
262 |
+
256,
|
263 |
+
128,
|
264 |
+
64
|
265 |
+
],
|
266 |
+
"matryoshka_weights": [
|
267 |
+
1,
|
268 |
+
1,
|
269 |
+
1,
|
270 |
+
1,
|
271 |
+
1
|
272 |
+
],
|
273 |
+
"n_dims_per_step": 1
|
274 |
+
}
|
275 |
+
```
|
276 |
+
|
277 |
+
### Training Hyperparameters
|
278 |
+
#### Non-Default Hyperparameters
|
279 |
+
|
280 |
+
- `per_device_train_batch_size`: 32
|
281 |
+
- `per_device_eval_batch_size`: 32
|
282 |
+
- `num_train_epochs`: 4
|
283 |
+
- `multi_dataset_batch_sampler`: round_robin
|
284 |
+
|
285 |
+
#### All Hyperparameters
|
286 |
+
<details><summary>Click to expand</summary>
|
287 |
+
|
288 |
+
- `overwrite_output_dir`: False
|
289 |
+
- `do_predict`: False
|
290 |
+
- `eval_strategy`: no
|
291 |
+
- `prediction_loss_only`: True
|
292 |
+
- `per_device_train_batch_size`: 32
|
293 |
+
- `per_device_eval_batch_size`: 32
|
294 |
+
- `per_gpu_train_batch_size`: None
|
295 |
+
- `per_gpu_eval_batch_size`: None
|
296 |
+
- `gradient_accumulation_steps`: 1
|
297 |
+
- `eval_accumulation_steps`: None
|
298 |
+
- `torch_empty_cache_steps`: None
|
299 |
+
- `learning_rate`: 5e-05
|
300 |
+
- `weight_decay`: 0.0
|
301 |
+
- `adam_beta1`: 0.9
|
302 |
+
- `adam_beta2`: 0.999
|
303 |
+
- `adam_epsilon`: 1e-08
|
304 |
+
- `max_grad_norm`: 1
|
305 |
+
- `num_train_epochs`: 4
|
306 |
+
- `max_steps`: -1
|
307 |
+
- `lr_scheduler_type`: linear
|
308 |
+
- `lr_scheduler_kwargs`: {}
|
309 |
+
- `warmup_ratio`: 0.0
|
310 |
+
- `warmup_steps`: 0
|
311 |
+
- `log_level`: passive
|
312 |
+
- `log_level_replica`: warning
|
313 |
+
- `log_on_each_node`: True
|
314 |
+
- `logging_nan_inf_filter`: True
|
315 |
+
- `save_safetensors`: True
|
316 |
+
- `save_on_each_node`: False
|
317 |
+
- `save_only_model`: False
|
318 |
+
- `restore_callback_states_from_checkpoint`: False
|
319 |
+
- `no_cuda`: False
|
320 |
+
- `use_cpu`: False
|
321 |
+
- `use_mps_device`: False
|
322 |
+
- `seed`: 42
|
323 |
+
- `data_seed`: None
|
324 |
+
- `jit_mode_eval`: False
|
325 |
+
- `use_ipex`: False
|
326 |
+
- `bf16`: False
|
327 |
+
- `fp16`: False
|
328 |
+
- `fp16_opt_level`: O1
|
329 |
+
- `half_precision_backend`: auto
|
330 |
+
- `bf16_full_eval`: False
|
331 |
+
- `fp16_full_eval`: False
|
332 |
+
- `tf32`: None
|
333 |
+
- `local_rank`: 0
|
334 |
+
- `ddp_backend`: None
|
335 |
+
- `tpu_num_cores`: None
|
336 |
+
- `tpu_metrics_debug`: False
|
337 |
+
- `debug`: []
|
338 |
+
- `dataloader_drop_last`: False
|
339 |
+
- `dataloader_num_workers`: 0
|
340 |
+
- `dataloader_prefetch_factor`: None
|
341 |
+
- `past_index`: -1
|
342 |
+
- `disable_tqdm`: False
|
343 |
+
- `remove_unused_columns`: True
|
344 |
+
- `label_names`: None
|
345 |
+
- `load_best_model_at_end`: False
|
346 |
+
- `ignore_data_skip`: False
|
347 |
+
- `fsdp`: []
|
348 |
+
- `fsdp_min_num_params`: 0
|
349 |
+
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
350 |
+
- `fsdp_transformer_layer_cls_to_wrap`: None
|
351 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
352 |
+
- `deepspeed`: None
|
353 |
+
- `label_smoothing_factor`: 0.0
|
354 |
+
- `optim`: adamw_torch
|
355 |
+
- `optim_args`: None
|
356 |
+
- `adafactor`: False
|
357 |
+
- `group_by_length`: False
|
358 |
+
- `length_column_name`: length
|
359 |
+
- `ddp_find_unused_parameters`: None
|
360 |
+
- `ddp_bucket_cap_mb`: None
|
361 |
+
- `ddp_broadcast_buffers`: False
|
362 |
+
- `dataloader_pin_memory`: True
|
363 |
+
- `dataloader_persistent_workers`: False
|
364 |
+
- `skip_memory_metrics`: True
|
365 |
+
- `use_legacy_prediction_loop`: False
|
366 |
+
- `push_to_hub`: False
|
367 |
+
- `resume_from_checkpoint`: None
|
368 |
+
- `hub_model_id`: None
|
369 |
+
- `hub_strategy`: every_save
|
370 |
+
- `hub_private_repo`: False
|
371 |
+
- `hub_always_push`: False
|
372 |
+
- `gradient_checkpointing`: False
|
373 |
+
- `gradient_checkpointing_kwargs`: None
|
374 |
+
- `include_inputs_for_metrics`: False
|
375 |
+
- `include_for_metrics`: []
|
376 |
+
- `eval_do_concat_batches`: True
|
377 |
+
- `fp16_backend`: auto
|
378 |
+
- `push_to_hub_model_id`: None
|
379 |
+
- `push_to_hub_organization`: None
|
380 |
+
- `mp_parameters`:
|
381 |
+
- `auto_find_batch_size`: False
|
382 |
+
- `full_determinism`: False
|
383 |
+
- `torchdynamo`: None
|
384 |
+
- `ray_scope`: last
|
385 |
+
- `ddp_timeout`: 1800
|
386 |
+
- `torch_compile`: False
|
387 |
+
- `torch_compile_backend`: None
|
388 |
+
- `torch_compile_mode`: None
|
389 |
+
- `dispatch_batches`: None
|
390 |
+
- `split_batches`: None
|
391 |
+
- `include_tokens_per_second`: False
|
392 |
+
- `include_num_input_tokens_seen`: False
|
393 |
+
- `neftune_noise_alpha`: None
|
394 |
+
- `optim_target_modules`: None
|
395 |
+
- `batch_eval_metrics`: False
|
396 |
+
- `eval_on_start`: False
|
397 |
+
- `use_liger_kernel`: False
|
398 |
+
- `eval_use_gather_object`: False
|
399 |
+
- `average_tokens_across_devices`: False
|
400 |
+
- `prompts`: None
|
401 |
+
- `batch_sampler`: batch_sampler
|
402 |
+
- `multi_dataset_batch_sampler`: round_robin
|
403 |
+
|
404 |
+
</details>
|
405 |
+
|
406 |
+
### Training Logs
|
407 |
+
| Epoch | Step | Training Loss |
|
408 |
+
|:------:|:----:|:-------------:|
|
409 |
+
| 0.2844 | 500 | 6.7584 |
|
410 |
+
| 0.5688 | 1000 | 7.3305 |
|
411 |
+
| 0.8532 | 1500 | 7.3915 |
|
412 |
+
| 1.0006 | 1759 | - |
|
413 |
+
| 1.1371 | 2000 | 7.4073 |
|
414 |
+
| 1.4215 | 2500 | 7.0864 |
|
415 |
+
| 1.7059 | 3000 | 6.9577 |
|
416 |
+
| 1.9903 | 3500 | 7.0965 |
|
417 |
+
| 2.0006 | 3518 | - |
|
418 |
+
| 2.2742 | 4000 | 6.9915 |
|
419 |
+
| 2.5586 | 4500 | 6.9164 |
|
420 |
+
| 2.8430 | 5000 | 6.8257 |
|
421 |
+
| 3.0006 | 5277 | - |
|
422 |
+
| 3.1268 | 5500 | 7.0359 |
|
423 |
+
| 3.4113 | 6000 | 6.9761 |
|
424 |
+
| 3.6957 | 6500 | 6.9392 |
|
425 |
+
| 3.9801 | 7000 | 6.8352 |
|
426 |
+
| 3.9983 | 7032 | - |
|
427 |
+
|
428 |
+
|
429 |
+
### Framework Versions
|
430 |
+
- Python: 3.10.12
|
431 |
+
- Sentence Transformers: 3.3.1
|
432 |
+
- Transformers: 4.46.3
|
433 |
+
- PyTorch: 2.5.1+cu121
|
434 |
+
- Accelerate: 1.1.1
|
435 |
+
- Datasets: 3.1.0
|
436 |
+
- Tokenizers: 0.20.3
|
437 |
+
|
438 |
+
## Citation
|
439 |
+
|
440 |
+
### BibTeX
|
441 |
+
|
442 |
+
#### Sentence Transformers
|
443 |
+
```bibtex
|
444 |
+
@inproceedings{reimers-2019-sentence-bert,
|
445 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
446 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
447 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
448 |
+
month = "11",
|
449 |
+
year = "2019",
|
450 |
+
publisher = "Association for Computational Linguistics",
|
451 |
+
url = "https://arxiv.org/abs/1908.10084",
|
452 |
+
}
|
453 |
+
```
|
454 |
+
|
455 |
+
#### Matryoshka2dLoss
|
456 |
+
```bibtex
|
457 |
+
@misc{li20242d,
|
458 |
+
title={2D Matryoshka Sentence Embeddings},
|
459 |
+
author={Xianming Li and Zongxi Li and Jing Li and Haoran Xie and Qing Li},
|
460 |
+
year={2024},
|
461 |
+
eprint={2402.14776},
|
462 |
+
archivePrefix={arXiv},
|
463 |
+
primaryClass={cs.CL}
|
464 |
+
}
|
465 |
+
```
|
466 |
+
|
467 |
+
#### MatryoshkaLoss
|
468 |
+
```bibtex
|
469 |
+
@misc{kusupati2024matryoshka,
|
470 |
+
title={Matryoshka Representation Learning},
|
471 |
+
author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
|
472 |
+
year={2024},
|
473 |
+
eprint={2205.13147},
|
474 |
+
archivePrefix={arXiv},
|
475 |
+
primaryClass={cs.LG}
|
476 |
+
}
|
477 |
+
```
|
478 |
+
|
479 |
+
#### TripletLoss
|
480 |
+
```bibtex
|
481 |
+
@misc{hermans2017defense,
|
482 |
+
title={In Defense of the Triplet Loss for Person Re-Identification},
|
483 |
+
author={Alexander Hermans and Lucas Beyer and Bastian Leibe},
|
484 |
+
year={2017},
|
485 |
+
eprint={1703.07737},
|
486 |
+
archivePrefix={arXiv},
|
487 |
+
primaryClass={cs.CV}
|
488 |
+
}
|
489 |
+
```
|
490 |
+
|
491 |
+
#### MultipleNegativesRankingLoss
|
492 |
+
```bibtex
|
493 |
+
@misc{henderson2017efficient,
|
494 |
+
title={Efficient Natural Language Response Suggestion for Smart Reply},
|
495 |
+
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},
|
496 |
+
year={2017},
|
497 |
+
eprint={1705.00652},
|
498 |
+
archivePrefix={arXiv},
|
499 |
+
primaryClass={cs.CL}
|
500 |
+
}
|
501 |
+
```
|
502 |
+
|
503 |
+
#### CoSENTLoss
|
504 |
+
```bibtex
|
505 |
+
@online{kexuefm-8847,
|
506 |
+
title={CoSENT: A more efficient sentence vector scheme than Sentence-BERT},
|
507 |
+
author={Su Jianlin},
|
508 |
+
year={2022},
|
509 |
+
month={Jan},
|
510 |
+
url={https://kexue.fm/archives/8847},
|
511 |
+
}
|
512 |
+
```
|
513 |
+
|
514 |
+
<!--
|
515 |
+
## Glossary
|
516 |
+
|
517 |
+
*Clearly define terms in order to be accessible across audiences.*
|
518 |
+
-->
|
519 |
+
|
520 |
+
<!--
|
521 |
+
## Model Card Authors
|
522 |
+
|
523 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
524 |
+
-->
|
525 |
+
|
526 |
+
<!--
|
527 |
+
## Model Card Contact
|
528 |
+
|
529 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
530 |
+
-->
|
config.json
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "NbAiLab/nb-sbert-base",
|
3 |
+
"architectures": [
|
4 |
+
"BertModel"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"classifier_dropout": null,
|
8 |
+
"directionality": "bidi",
|
9 |
+
"gradient_checkpointing": false,
|
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-12,
|
16 |
+
"max_position_embeddings": 512,
|
17 |
+
"model_type": "bert",
|
18 |
+
"num_attention_heads": 12,
|
19 |
+
"num_hidden_layers": 12,
|
20 |
+
"pad_token_id": 0,
|
21 |
+
"pooler_fc_size": 768,
|
22 |
+
"pooler_num_attention_heads": 12,
|
23 |
+
"pooler_num_fc_layers": 3,
|
24 |
+
"pooler_size_per_head": 128,
|
25 |
+
"pooler_type": "first_token_transform",
|
26 |
+
"position_embedding_type": "absolute",
|
27 |
+
"torch_dtype": "float32",
|
28 |
+
"transformers_version": "4.46.3",
|
29 |
+
"type_vocab_size": 2,
|
30 |
+
"use_cache": true,
|
31 |
+
"vocab_size": 119547
|
32 |
+
}
|
config_sentence_transformers.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "3.3.1",
|
4 |
+
"transformers": "4.46.3",
|
5 |
+
"pytorch": "2.5.1+cu121"
|
6 |
+
},
|
7 |
+
"prompts": {},
|
8 |
+
"default_prompt_name": null,
|
9 |
+
"similarity_fn_name": "cosine"
|
10 |
+
}
|
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 |
+
]
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0a03b357c9323ccfb4d207f0ad09feed83b2286be30978de580108e51d6706a8
|
3 |
+
size 711480934
|
sentence_bert_config.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"max_seq_length": 75,
|
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,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "[PAD]",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"100": {
|
12 |
+
"content": "[UNK]",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"101": {
|
20 |
+
"content": "[CLS]",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"102": {
|
28 |
+
"content": "[SEP]",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"103": {
|
36 |
+
"content": "[MASK]",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
}
|
43 |
+
},
|
44 |
+
"clean_up_tokenization_spaces": false,
|
45 |
+
"cls_token": "[CLS]",
|
46 |
+
"do_basic_tokenize": true,
|
47 |
+
"do_lower_case": false,
|
48 |
+
"mask_token": "[MASK]",
|
49 |
+
"max_length": 75,
|
50 |
+
"model_max_length": 1000000000000000019884624838656,
|
51 |
+
"never_split": null,
|
52 |
+
"pad_to_multiple_of": null,
|
53 |
+
"pad_token": "[PAD]",
|
54 |
+
"pad_token_type_id": 0,
|
55 |
+
"padding_side": "right",
|
56 |
+
"sep_token": "[SEP]",
|
57 |
+
"stride": 0,
|
58 |
+
"strip_accents": null,
|
59 |
+
"tokenize_chinese_chars": true,
|
60 |
+
"tokenizer_class": "BertTokenizer",
|
61 |
+
"truncation_side": "right",
|
62 |
+
"truncation_strategy": "longest_first",
|
63 |
+
"unk_token": "[UNK]"
|
64 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|