Add new SentenceTransformer model.
Browse files- 1_Pooling/config.json +10 -0
- README.md +382 -0
- added_tokens.json +8 -0
- config.json +26 -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 +110 -0
- vocab.txt +0 -0
1_Pooling/config.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"word_embedding_dimension": 1024,
|
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,382 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: UKPLab/triple-encoders-dailydialog
|
3 |
+
datasets: []
|
4 |
+
language: []
|
5 |
+
library_name: sentence-transformers
|
6 |
+
pipeline_tag: sentence-similarity
|
7 |
+
tags:
|
8 |
+
- sentence-transformers
|
9 |
+
- sentence-similarity
|
10 |
+
- feature-extraction
|
11 |
+
- generated_from_trainer
|
12 |
+
- dataset_size:985575
|
13 |
+
- loss:CosineSimilarityTripleEncoderLoss
|
14 |
+
- loss:ContrastiveLoss
|
15 |
+
widget:
|
16 |
+
- source_sentence: A small white and tan dog licking up peanut butter.
|
17 |
+
sentences:
|
18 |
+
- Someone is making dinner in the kitchen.
|
19 |
+
- Someone put peanut butter on the dog's nose because that's always good for a laugh.
|
20 |
+
- Two dogs are eating food from a bowl in a kitchen
|
21 |
+
- source_sentence: A person in a heavy coat shoveling snow.
|
22 |
+
sentences:
|
23 |
+
- Someone is holding a rocket launcher.
|
24 |
+
- An old person is shoveling snow.
|
25 |
+
- The private bar's pro bono work was supported by the judges.
|
26 |
+
- source_sentence: '[B1] [O] [BEFORE] '
|
27 |
+
sentences:
|
28 |
+
- '[B2] [E] [BEFORE] '
|
29 |
+
- '[B2] [O] [BEFORE] e'
|
30 |
+
- '[AFTER] u'
|
31 |
+
- source_sentence: '[B1] [E] [BEFORE] e'
|
32 |
+
sentences:
|
33 |
+
- '[B2] [O] [BEFORE] :'
|
34 |
+
- '[B2] [O] [BEFORE] t'
|
35 |
+
- '[AFTER] C'
|
36 |
+
- source_sentence: '[B1] [O] [BEFORE] s'
|
37 |
+
sentences:
|
38 |
+
- '[B2] [O] [BEFORE] o'
|
39 |
+
- '[B2] [E] [BEFORE] '
|
40 |
+
- '[AFTER] u'
|
41 |
+
---
|
42 |
+
|
43 |
+
# SentenceTransformer based on UKPLab/triple-encoders-dailydialog
|
44 |
+
|
45 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [UKPLab/triple-encoders-dailydialog](https://huggingface.co/UKPLab/triple-encoders-dailydialog). It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
|
46 |
+
|
47 |
+
## Model Details
|
48 |
+
|
49 |
+
### Model Description
|
50 |
+
- **Model Type:** Sentence Transformer
|
51 |
+
- **Base model:** [UKPLab/triple-encoders-dailydialog](https://huggingface.co/UKPLab/triple-encoders-dailydialog) <!-- at revision 390bfe14e21b0eb89068887d1032afcb4f2a1b27 -->
|
52 |
+
- **Maximum Sequence Length:** 512 tokens
|
53 |
+
- **Output Dimensionality:** 1024 tokens
|
54 |
+
- **Similarity Function:** Cosine Similarity
|
55 |
+
<!-- - **Training Dataset:** Unknown -->
|
56 |
+
<!-- - **Language:** Unknown -->
|
57 |
+
<!-- - **License:** Unknown -->
|
58 |
+
|
59 |
+
### Model Sources
|
60 |
+
|
61 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
62 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
63 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
64 |
+
|
65 |
+
### Full Model Architecture
|
66 |
+
|
67 |
+
```
|
68 |
+
SentenceTransformer(
|
69 |
+
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
|
70 |
+
(1): Pooling({'word_embedding_dimension': 1024, '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})
|
71 |
+
)
|
72 |
+
```
|
73 |
+
|
74 |
+
## Usage
|
75 |
+
|
76 |
+
### Direct Usage (Sentence Transformers)
|
77 |
+
|
78 |
+
First install the Sentence Transformers library:
|
79 |
+
|
80 |
+
```bash
|
81 |
+
pip install -U sentence-transformers
|
82 |
+
```
|
83 |
+
|
84 |
+
Then you can load this model and run inference.
|
85 |
+
```python
|
86 |
+
from sentence_transformers import SentenceTransformer
|
87 |
+
|
88 |
+
# Download from the 🤗 Hub
|
89 |
+
model = SentenceTransformer("abhiraj1/eval_triple_encoder")
|
90 |
+
# Run inference
|
91 |
+
sentences = [
|
92 |
+
'[B1] [O] [BEFORE] s',
|
93 |
+
'[B2] [E] [BEFORE] ',
|
94 |
+
'[AFTER] u',
|
95 |
+
]
|
96 |
+
embeddings = model.encode(sentences)
|
97 |
+
print(embeddings.shape)
|
98 |
+
# [3, 1024]
|
99 |
+
|
100 |
+
# Get the similarity scores for the embeddings
|
101 |
+
similarities = model.similarity(embeddings, embeddings)
|
102 |
+
print(similarities.shape)
|
103 |
+
# [3, 3]
|
104 |
+
```
|
105 |
+
|
106 |
+
<!--
|
107 |
+
### Direct Usage (Transformers)
|
108 |
+
|
109 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
110 |
+
|
111 |
+
</details>
|
112 |
+
-->
|
113 |
+
|
114 |
+
<!--
|
115 |
+
### Downstream Usage (Sentence Transformers)
|
116 |
+
|
117 |
+
You can finetune this model on your own dataset.
|
118 |
+
|
119 |
+
<details><summary>Click to expand</summary>
|
120 |
+
|
121 |
+
</details>
|
122 |
+
-->
|
123 |
+
|
124 |
+
<!--
|
125 |
+
### Out-of-Scope Use
|
126 |
+
|
127 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
128 |
+
-->
|
129 |
+
|
130 |
+
<!--
|
131 |
+
## Bias, Risks and Limitations
|
132 |
+
|
133 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
134 |
+
-->
|
135 |
+
|
136 |
+
<!--
|
137 |
+
### Recommendations
|
138 |
+
|
139 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
140 |
+
-->
|
141 |
+
|
142 |
+
## Training Details
|
143 |
+
|
144 |
+
### Training Datasets
|
145 |
+
|
146 |
+
#### Unnamed Dataset
|
147 |
+
|
148 |
+
|
149 |
+
* Size: 43,506 training samples
|
150 |
+
* Columns: <code>sentence_0</code>, <code>sentence_1</code>, <code>sentence_2</code>, and <code>label</code>
|
151 |
+
* Approximate statistics based on the first 1000 samples:
|
152 |
+
| | sentence_0 | sentence_1 | sentence_2 | label |
|
153 |
+
|:--------|:--------------------------------------------------------------------------------|:--------------------------------------------------------------------------------|:--------------------------------------------------------------------------------|:--------------------------------------------------------------|
|
154 |
+
| type | string | string | string | float |
|
155 |
+
| details | <ul><li>min: 5 tokens</li><li>mean: 5.86 tokens</li><li>max: 6 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 5.84 tokens</li><li>max: 6 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 3.81 tokens</li><li>max: 4 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.2</li><li>max: 1.0</li></ul> |
|
156 |
+
* Samples:
|
157 |
+
| sentence_0 | sentence_1 | sentence_2 | label |
|
158 |
+
|:---------------------------------|:---------------------------------|:-----------------------|:--------------------------------|
|
159 |
+
| <code>[B1] [O] [BEFORE] </code> | <code>[B2] [E] [BEFORE] </code> | <code>[AFTER] u</code> | <code>0.0</code> |
|
160 |
+
| <code>[B1] [E] [BEFORE] e</code> | <code>[B2] [O] [BEFORE] :</code> | <code>[AFTER] C</code> | <code>0.0</code> |
|
161 |
+
| <code>[B1] [O] [BEFORE] s</code> | <code>[B2] [E] [BEFORE] </code> | <code>[AFTER] u</code> | <code>0.6000000000000001</code> |
|
162 |
+
* Loss: <code>triple_encoders.losses.CosineSimilarityTripleEncoderLoss.CosineSimilarityTripleEncoderLoss</code>
|
163 |
+
|
164 |
+
#### Unnamed Dataset
|
165 |
+
|
166 |
+
|
167 |
+
* Size: 942,069 training samples
|
168 |
+
* Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>label</code>
|
169 |
+
* Approximate statistics based on the first 1000 samples:
|
170 |
+
| | sentence_0 | sentence_1 | label |
|
171 |
+
|:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:-------------------------------------------------------------------|
|
172 |
+
| type | string | string | int |
|
173 |
+
| details | <ul><li>min: 5 tokens</li><li>mean: 20.26 tokens</li><li>max: 182 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 11.94 tokens</li><li>max: 31 tokens</li></ul> | <ul><li>0: ~32.40%</li><li>1: ~33.70%</li><li>2: ~33.90%</li></ul> |
|
174 |
+
* Samples:
|
175 |
+
| sentence_0 | sentence_1 | label |
|
176 |
+
|:---------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:---------------|
|
177 |
+
| <code>And the reason Lincoln and his goons had shown up? Well, not everybody was full of respect.</code> | <code>Lincoln didn't show up.</code> | <code>0</code> |
|
178 |
+
| <code>a rally car driving down a roadway with people on the side taking pictures</code> | <code>People on the side of road taking picture of a rally car driving down</code> | <code>1</code> |
|
179 |
+
| <code>The dog is wearing a purple cape.</code> | <code>THE ANIMAL IS IN A PAGEANT</code> | <code>2</code> |
|
180 |
+
* Loss: [<code>ContrastiveLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#contrastiveloss) with these parameters:
|
181 |
+
```json
|
182 |
+
{
|
183 |
+
"distance_metric": "SiameseDistanceMetric.COSINE_DISTANCE",
|
184 |
+
"margin": 0.5,
|
185 |
+
"size_average": true
|
186 |
+
}
|
187 |
+
```
|
188 |
+
|
189 |
+
### Training Hyperparameters
|
190 |
+
#### Non-Default Hyperparameters
|
191 |
+
|
192 |
+
- `per_device_train_batch_size`: 16
|
193 |
+
- `per_device_eval_batch_size`: 16
|
194 |
+
- `num_train_epochs`: 1
|
195 |
+
- `multi_dataset_batch_sampler`: round_robin
|
196 |
+
|
197 |
+
#### All Hyperparameters
|
198 |
+
<details><summary>Click to expand</summary>
|
199 |
+
|
200 |
+
- `overwrite_output_dir`: False
|
201 |
+
- `do_predict`: False
|
202 |
+
- `eval_strategy`: no
|
203 |
+
- `prediction_loss_only`: True
|
204 |
+
- `per_device_train_batch_size`: 16
|
205 |
+
- `per_device_eval_batch_size`: 16
|
206 |
+
- `per_gpu_train_batch_size`: None
|
207 |
+
- `per_gpu_eval_batch_size`: None
|
208 |
+
- `gradient_accumulation_steps`: 1
|
209 |
+
- `eval_accumulation_steps`: None
|
210 |
+
- `learning_rate`: 5e-05
|
211 |
+
- `weight_decay`: 0.0
|
212 |
+
- `adam_beta1`: 0.9
|
213 |
+
- `adam_beta2`: 0.999
|
214 |
+
- `adam_epsilon`: 1e-08
|
215 |
+
- `max_grad_norm`: 1
|
216 |
+
- `num_train_epochs`: 1
|
217 |
+
- `max_steps`: -1
|
218 |
+
- `lr_scheduler_type`: linear
|
219 |
+
- `lr_scheduler_kwargs`: {}
|
220 |
+
- `warmup_ratio`: 0.0
|
221 |
+
- `warmup_steps`: 0
|
222 |
+
- `log_level`: passive
|
223 |
+
- `log_level_replica`: warning
|
224 |
+
- `log_on_each_node`: True
|
225 |
+
- `logging_nan_inf_filter`: True
|
226 |
+
- `save_safetensors`: True
|
227 |
+
- `save_on_each_node`: False
|
228 |
+
- `save_only_model`: False
|
229 |
+
- `restore_callback_states_from_checkpoint`: False
|
230 |
+
- `no_cuda`: False
|
231 |
+
- `use_cpu`: False
|
232 |
+
- `use_mps_device`: False
|
233 |
+
- `seed`: 42
|
234 |
+
- `data_seed`: None
|
235 |
+
- `jit_mode_eval`: False
|
236 |
+
- `use_ipex`: False
|
237 |
+
- `bf16`: False
|
238 |
+
- `fp16`: False
|
239 |
+
- `fp16_opt_level`: O1
|
240 |
+
- `half_precision_backend`: auto
|
241 |
+
- `bf16_full_eval`: False
|
242 |
+
- `fp16_full_eval`: False
|
243 |
+
- `tf32`: None
|
244 |
+
- `local_rank`: 0
|
245 |
+
- `ddp_backend`: None
|
246 |
+
- `tpu_num_cores`: None
|
247 |
+
- `tpu_metrics_debug`: False
|
248 |
+
- `debug`: []
|
249 |
+
- `dataloader_drop_last`: False
|
250 |
+
- `dataloader_num_workers`: 0
|
251 |
+
- `dataloader_prefetch_factor`: None
|
252 |
+
- `past_index`: -1
|
253 |
+
- `disable_tqdm`: False
|
254 |
+
- `remove_unused_columns`: True
|
255 |
+
- `label_names`: None
|
256 |
+
- `load_best_model_at_end`: False
|
257 |
+
- `ignore_data_skip`: False
|
258 |
+
- `fsdp`: []
|
259 |
+
- `fsdp_min_num_params`: 0
|
260 |
+
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
261 |
+
- `fsdp_transformer_layer_cls_to_wrap`: None
|
262 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
263 |
+
- `deepspeed`: None
|
264 |
+
- `label_smoothing_factor`: 0.0
|
265 |
+
- `optim`: adamw_torch
|
266 |
+
- `optim_args`: None
|
267 |
+
- `adafactor`: False
|
268 |
+
- `group_by_length`: False
|
269 |
+
- `length_column_name`: length
|
270 |
+
- `ddp_find_unused_parameters`: None
|
271 |
+
- `ddp_bucket_cap_mb`: None
|
272 |
+
- `ddp_broadcast_buffers`: False
|
273 |
+
- `dataloader_pin_memory`: True
|
274 |
+
- `dataloader_persistent_workers`: False
|
275 |
+
- `skip_memory_metrics`: True
|
276 |
+
- `use_legacy_prediction_loop`: False
|
277 |
+
- `push_to_hub`: False
|
278 |
+
- `resume_from_checkpoint`: None
|
279 |
+
- `hub_model_id`: None
|
280 |
+
- `hub_strategy`: every_save
|
281 |
+
- `hub_private_repo`: False
|
282 |
+
- `hub_always_push`: False
|
283 |
+
- `gradient_checkpointing`: False
|
284 |
+
- `gradient_checkpointing_kwargs`: None
|
285 |
+
- `include_inputs_for_metrics`: False
|
286 |
+
- `eval_do_concat_batches`: True
|
287 |
+
- `fp16_backend`: auto
|
288 |
+
- `push_to_hub_model_id`: None
|
289 |
+
- `push_to_hub_organization`: None
|
290 |
+
- `mp_parameters`:
|
291 |
+
- `auto_find_batch_size`: False
|
292 |
+
- `full_determinism`: False
|
293 |
+
- `torchdynamo`: None
|
294 |
+
- `ray_scope`: last
|
295 |
+
- `ddp_timeout`: 1800
|
296 |
+
- `torch_compile`: False
|
297 |
+
- `torch_compile_backend`: None
|
298 |
+
- `torch_compile_mode`: None
|
299 |
+
- `dispatch_batches`: None
|
300 |
+
- `split_batches`: None
|
301 |
+
- `include_tokens_per_second`: False
|
302 |
+
- `include_num_input_tokens_seen`: False
|
303 |
+
- `neftune_noise_alpha`: None
|
304 |
+
- `optim_target_modules`: None
|
305 |
+
- `batch_eval_metrics`: False
|
306 |
+
- `batch_sampler`: batch_sampler
|
307 |
+
- `multi_dataset_batch_sampler`: round_robin
|
308 |
+
|
309 |
+
</details>
|
310 |
+
|
311 |
+
### Training Logs
|
312 |
+
| Epoch | Step | Training Loss |
|
313 |
+
|:------:|:----:|:-------------:|
|
314 |
+
| 0.0919 | 500 | 0.0838 |
|
315 |
+
| 0.1838 | 1000 | 0.0474 |
|
316 |
+
| 0.2757 | 1500 | 0.0414 |
|
317 |
+
| 0.3676 | 2000 | 0.0417 |
|
318 |
+
| 0.4596 | 2500 | 0.042 |
|
319 |
+
| 0.5515 | 3000 | 0.0423 |
|
320 |
+
| 0.6434 | 3500 | 0.0408 |
|
321 |
+
| 0.7353 | 4000 | 0.0427 |
|
322 |
+
| 0.8272 | 4500 | 0.0414 |
|
323 |
+
| 0.9191 | 5000 | 0.0415 |
|
324 |
+
|
325 |
+
|
326 |
+
### Framework Versions
|
327 |
+
- Python: 3.10.12
|
328 |
+
- Sentence Transformers: 3.0.1
|
329 |
+
- Transformers: 4.41.2
|
330 |
+
- PyTorch: 2.3.0+cu121
|
331 |
+
- Accelerate: 0.32.1
|
332 |
+
- Datasets: 2.20.0
|
333 |
+
- Tokenizers: 0.19.1
|
334 |
+
|
335 |
+
## Citation
|
336 |
+
|
337 |
+
### BibTeX
|
338 |
+
|
339 |
+
#### Sentence Transformers
|
340 |
+
```bibtex
|
341 |
+
@inproceedings{reimers-2019-sentence-bert,
|
342 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
343 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
344 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
345 |
+
month = "11",
|
346 |
+
year = "2019",
|
347 |
+
publisher = "Association for Computational Linguistics",
|
348 |
+
url = "https://arxiv.org/abs/1908.10084",
|
349 |
+
}
|
350 |
+
```
|
351 |
+
|
352 |
+
#### ContrastiveLoss
|
353 |
+
```bibtex
|
354 |
+
@inproceedings{hadsell2006dimensionality,
|
355 |
+
author={Hadsell, R. and Chopra, S. and LeCun, Y.},
|
356 |
+
booktitle={2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'06)},
|
357 |
+
title={Dimensionality Reduction by Learning an Invariant Mapping},
|
358 |
+
year={2006},
|
359 |
+
volume={2},
|
360 |
+
number={},
|
361 |
+
pages={1735-1742},
|
362 |
+
doi={10.1109/CVPR.2006.100}
|
363 |
+
}
|
364 |
+
```
|
365 |
+
|
366 |
+
<!--
|
367 |
+
## Glossary
|
368 |
+
|
369 |
+
*Clearly define terms in order to be accessible across audiences.*
|
370 |
+
-->
|
371 |
+
|
372 |
+
<!--
|
373 |
+
## Model Card Authors
|
374 |
+
|
375 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
376 |
+
-->
|
377 |
+
|
378 |
+
<!--
|
379 |
+
## Model Card Contact
|
380 |
+
|
381 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
382 |
+
-->
|
added_tokens.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"[AFTER]": 30523,
|
3 |
+
"[B1]": 30526,
|
4 |
+
"[B2]": 30527,
|
5 |
+
"[BEFORE]": 30522,
|
6 |
+
"[E]": 30525,
|
7 |
+
"[O]": 30524
|
8 |
+
}
|
config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "UKPLab/triple-encoders-dailydialog",
|
3 |
+
"architectures": [
|
4 |
+
"BertModel"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"classifier_dropout": null,
|
8 |
+
"gradient_checkpointing": false,
|
9 |
+
"hidden_act": "gelu",
|
10 |
+
"hidden_dropout_prob": 0.1,
|
11 |
+
"hidden_size": 1024,
|
12 |
+
"initializer_range": 0.02,
|
13 |
+
"intermediate_size": 4096,
|
14 |
+
"layer_norm_eps": 1e-12,
|
15 |
+
"max_position_embeddings": 512,
|
16 |
+
"model_type": "bert",
|
17 |
+
"num_attention_heads": 16,
|
18 |
+
"num_hidden_layers": 24,
|
19 |
+
"pad_token_id": 0,
|
20 |
+
"position_embedding_type": "absolute",
|
21 |
+
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.41.2",
|
23 |
+
"type_vocab_size": 2,
|
24 |
+
"use_cache": true,
|
25 |
+
"vocab_size": 30528
|
26 |
+
}
|
config_sentence_transformers.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "3.0.1",
|
4 |
+
"transformers": "4.41.2",
|
5 |
+
"pytorch": "2.3.0+cu121"
|
6 |
+
},
|
7 |
+
"prompts": {},
|
8 |
+
"default_prompt_name": null,
|
9 |
+
"similarity_fn_name": null
|
10 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:85793980bc29faf4c04d76aa0af00c2a4a64588d56e93e1e1949716298acaf70
|
3 |
+
size 1340637008
|
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,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"30522": {
|
44 |
+
"content": "[BEFORE]",
|
45 |
+
"lstrip": false,
|
46 |
+
"normalized": false,
|
47 |
+
"rstrip": false,
|
48 |
+
"single_word": false,
|
49 |
+
"special": true
|
50 |
+
},
|
51 |
+
"30523": {
|
52 |
+
"content": "[AFTER]",
|
53 |
+
"lstrip": false,
|
54 |
+
"normalized": false,
|
55 |
+
"rstrip": false,
|
56 |
+
"single_word": false,
|
57 |
+
"special": true
|
58 |
+
},
|
59 |
+
"30524": {
|
60 |
+
"content": "[O]",
|
61 |
+
"lstrip": false,
|
62 |
+
"normalized": false,
|
63 |
+
"rstrip": false,
|
64 |
+
"single_word": false,
|
65 |
+
"special": true
|
66 |
+
},
|
67 |
+
"30525": {
|
68 |
+
"content": "[E]",
|
69 |
+
"lstrip": false,
|
70 |
+
"normalized": false,
|
71 |
+
"rstrip": false,
|
72 |
+
"single_word": false,
|
73 |
+
"special": true
|
74 |
+
},
|
75 |
+
"30526": {
|
76 |
+
"content": "[B1]",
|
77 |
+
"lstrip": false,
|
78 |
+
"normalized": false,
|
79 |
+
"rstrip": false,
|
80 |
+
"single_word": false,
|
81 |
+
"special": true
|
82 |
+
},
|
83 |
+
"30527": {
|
84 |
+
"content": "[B2]",
|
85 |
+
"lstrip": false,
|
86 |
+
"normalized": false,
|
87 |
+
"rstrip": false,
|
88 |
+
"single_word": false,
|
89 |
+
"special": true
|
90 |
+
}
|
91 |
+
},
|
92 |
+
"clean_up_tokenization_spaces": true,
|
93 |
+
"cls_token": "[CLS]",
|
94 |
+
"do_lower_case": true,
|
95 |
+
"mask_token": "[MASK]",
|
96 |
+
"max_length": 512,
|
97 |
+
"model_max_length": 1000000000000000019884624838656,
|
98 |
+
"pad_to_multiple_of": null,
|
99 |
+
"pad_token": "[PAD]",
|
100 |
+
"pad_token_type_id": 0,
|
101 |
+
"padding_side": "right",
|
102 |
+
"sep_token": "[SEP]",
|
103 |
+
"stride": 0,
|
104 |
+
"strip_accents": null,
|
105 |
+
"tokenize_chinese_chars": true,
|
106 |
+
"tokenizer_class": "BertTokenizer",
|
107 |
+
"truncation_side": "right",
|
108 |
+
"truncation_strategy": "longest_first",
|
109 |
+
"unk_token": "[UNK]"
|
110 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|