Feature Extraction
sentence-transformers
Safetensors
English
distilbert
sparse-encoder
sparse
splade
Generated from Trainer
dataset_size:811257
loss:SpladeLoss
loss:SparseMultipleNegativesRankingLoss
loss:FlopsLoss
text-embeddings-inference
Instructions to use deter3/splade-distilbert-base-uncased-patentmatch-train-only with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use deter3/splade-distilbert-base-uncased-patentmatch-train-only with sentence-transformers:
from sentence_transformers import SparseEncoder model = SparseEncoder("deter3/splade-distilbert-base-uncased-patentmatch-train-only") queries = ["Which planet is known as the Red Planet?"] documents = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", ] query_embeddings = model.encode_query(queries) document_embeddings = model.encode_document(documents) similarities = model.similarity(query_embeddings, document_embeddings) print(similarities) - Notebooks
- Google Colab
- Kaggle
Add new SparseEncoder model
Browse files- 1_SpladePooling/config.json +5 -0
- README.md +480 -0
- config.json +23 -0
- config_sentence_transformers.json +14 -0
- model.safetensors +3 -0
- modules.json +14 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +56 -0
- vocab.txt +0 -0
1_SpladePooling/config.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"pooling_strategy": "max",
|
| 3 |
+
"activation_function": "relu",
|
| 4 |
+
"word_embedding_dimension": 30522
|
| 5 |
+
}
|
README.md
ADDED
|
@@ -0,0 +1,480 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
tags:
|
| 6 |
+
- sentence-transformers
|
| 7 |
+
- sparse-encoder
|
| 8 |
+
- sparse
|
| 9 |
+
- splade
|
| 10 |
+
- generated_from_trainer
|
| 11 |
+
- dataset_size:811257
|
| 12 |
+
- loss:SpladeLoss
|
| 13 |
+
- loss:SparseMultipleNegativesRankingLoss
|
| 14 |
+
- loss:FlopsLoss
|
| 15 |
+
base_model: distilbert/distilbert-base-uncased
|
| 16 |
+
widget:
|
| 17 |
+
- text: Turning now to FIG.1 an exemplary firewall sealing assembly 100 is shown mounted
|
| 18 |
+
between a firewall 102 and a duct 104.The firewall sealing assembly 100 allows
|
| 19 |
+
the duct 104 to extend through an opening 106 in the firewall 102 while minimizing
|
| 20 |
+
fluid flow communication between a first section 108 on one side of the firewall
|
| 21 |
+
102 and a second section 110 on another side of the firewall 102.It will be appreciated
|
| 22 |
+
that the duct 104 may alternatively be any one of numerous other components that
|
| 23 |
+
may need to extend through the firewall opening 106 such as for example piping
|
| 24 |
+
wires structural tubing and any other penetrating member.
|
| 25 |
+
- text: The inverter 22 comprises switching elements 61u 61v 61w 62u 62v 62w which
|
| 26 |
+
comprise MOSFETs IGBTs or the like respectively energizable by the ECU 40 and
|
| 27 |
+
diodes 53u 53v 53w 54u 54v 54w reverseconnected across the switching elements
|
| 28 |
+
61u 61v 61w 62u 62v 62w respectively.
|
| 29 |
+
- text: In this example a configuration general solution using an arbitrary number
|
| 30 |
+
N of antennas is considered.
|
| 31 |
+
- text: Each of the contact metal strips 7 includes an attachment fixture 7A mounted
|
| 32 |
+
at a strip mounting base 10 a horizontal portion 7B horizontally extended from
|
| 33 |
+
a bottom portion of the attachment fixture 7A a bending portion 7C elongated obliquely
|
| 34 |
+
upward from a leading end of the horizontal portion 7B and a contact portion 7D
|
| 35 |
+
provided at a leading end of the bending portion 7C so as to contact with the
|
| 36 |
+
terminal pin 6.The overall shape of the contact metal strips 7 is roughly a V
|
| 37 |
+
shape as can be seen from Fig.3.
|
| 38 |
+
- text: A client browser application for a user terminal the browser being capable
|
| 39 |
+
of recognising top level domain name parts of a network resource identifier said
|
| 40 |
+
browser being arranged to handle a network resource identifier in which a predetermined
|
| 41 |
+
top level domain name part is recognised differently from a network resource identifier
|
| 42 |
+
in which the top level domain name part is not recognised.
|
| 43 |
+
pipeline_tag: feature-extraction
|
| 44 |
+
library_name: sentence-transformers
|
| 45 |
+
---
|
| 46 |
+
|
| 47 |
+
# SPLADE model for patent matching
|
| 48 |
+
|
| 49 |
+
This is a [SPLADE Sparse Encoder](https://www.sbert.net/docs/sparse_encoder/usage/usage.html) model finetuned from [distilbert/distilbert-base-uncased](https://huggingface.co/distilbert/distilbert-base-uncased) on the json dataset using the [sentence-transformers](https://www.SBERT.net) library. It maps sentences & paragraphs to a 30522-dimensional sparse vector space and can be used for semantic search and sparse retrieval.
|
| 50 |
+
## Model Details
|
| 51 |
+
|
| 52 |
+
### Model Description
|
| 53 |
+
- **Model Type:** SPLADE Sparse Encoder
|
| 54 |
+
- **Base model:** [distilbert/distilbert-base-uncased](https://huggingface.co/distilbert/distilbert-base-uncased) <!-- at revision 12040accade4e8a0f71eabdb258fecc2e7e948be -->
|
| 55 |
+
- **Maximum Sequence Length:** 256 tokens
|
| 56 |
+
- **Output Dimensionality:** 30522 dimensions
|
| 57 |
+
- **Similarity Function:** Dot Product
|
| 58 |
+
- **Training Dataset:**
|
| 59 |
+
- json
|
| 60 |
+
- **Language:** en
|
| 61 |
+
- **License:** apache-2.0
|
| 62 |
+
|
| 63 |
+
### Model Sources
|
| 64 |
+
|
| 65 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
| 66 |
+
- **Documentation:** [Sparse Encoder Documentation](https://www.sbert.net/docs/sparse_encoder/usage/usage.html)
|
| 67 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
| 68 |
+
- **Hugging Face:** [Sparse Encoders on Hugging Face](https://huggingface.co/models?library=sentence-transformers&other=sparse-encoder)
|
| 69 |
+
|
| 70 |
+
### Full Model Architecture
|
| 71 |
+
|
| 72 |
+
```
|
| 73 |
+
SparseEncoder(
|
| 74 |
+
(0): MLMTransformer({'max_seq_length': 256, 'do_lower_case': False, 'architecture': 'DistilBertForMaskedLM'})
|
| 75 |
+
(1): SpladePooling({'pooling_strategy': 'max', 'activation_function': 'relu', 'word_embedding_dimension': 30522})
|
| 76 |
+
)
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
## Usage
|
| 80 |
+
|
| 81 |
+
### Direct Usage (Sentence Transformers)
|
| 82 |
+
|
| 83 |
+
First install the Sentence Transformers library:
|
| 84 |
+
|
| 85 |
+
```bash
|
| 86 |
+
pip install -U sentence-transformers
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
Then you can load this model and run inference.
|
| 90 |
+
```python
|
| 91 |
+
from sentence_transformers import SparseEncoder
|
| 92 |
+
|
| 93 |
+
# Download from the 🤗 Hub
|
| 94 |
+
model = SparseEncoder("deter3/splade-distilbert-base-uncased-patentmatch-train-only")
|
| 95 |
+
# Run inference
|
| 96 |
+
queries = [
|
| 97 |
+
"The mobile device as claimed in claim 11 or claim 12 further comprising a display for displaying a list of applicationspecific places that only contains the places that have been selected by a specific application.",
|
| 98 |
+
]
|
| 99 |
+
documents = [
|
| 100 |
+
'A client browser application for a user terminal the browser being capable of recognising top level domain name parts of a network resource identifier said browser being arranged to handle a network resource identifier in which a predetermined top level domain name part is recognised differently from a network resource identifier in which the top level domain name part is not recognised.',
|
| 101 |
+
'Other variations in the components of the lid 1200 are possible in other embodiments of the invention.',
|
| 102 |
+
'The cylinder servo motor according to the second embodiment is identical in operation with that described in connection with the first embodiment.By means of imparting a position instruction to the servo motor the ball screw shaft 50 corresponding to the ball screw shaft 5 is actuated to a predetermined position.',
|
| 103 |
+
]
|
| 104 |
+
query_embeddings = model.encode_query(queries)
|
| 105 |
+
document_embeddings = model.encode_document(documents)
|
| 106 |
+
print(query_embeddings.shape, document_embeddings.shape)
|
| 107 |
+
# [1, 30522] [3, 30522]
|
| 108 |
+
|
| 109 |
+
# Get the similarity scores for the embeddings
|
| 110 |
+
similarities = model.similarity(query_embeddings, document_embeddings)
|
| 111 |
+
print(similarities)
|
| 112 |
+
# tensor([[12.4191, 5.6239, 1.1307]])
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
<!--
|
| 116 |
+
### Direct Usage (Transformers)
|
| 117 |
+
|
| 118 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
| 119 |
+
|
| 120 |
+
</details>
|
| 121 |
+
-->
|
| 122 |
+
|
| 123 |
+
<!--
|
| 124 |
+
### Downstream Usage (Sentence Transformers)
|
| 125 |
+
|
| 126 |
+
You can finetune this model on your own dataset.
|
| 127 |
+
|
| 128 |
+
<details><summary>Click to expand</summary>
|
| 129 |
+
|
| 130 |
+
</details>
|
| 131 |
+
-->
|
| 132 |
+
|
| 133 |
+
<!--
|
| 134 |
+
### Out-of-Scope Use
|
| 135 |
+
|
| 136 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
| 137 |
+
-->
|
| 138 |
+
|
| 139 |
+
<!--
|
| 140 |
+
## Bias, Risks and Limitations
|
| 141 |
+
|
| 142 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
| 143 |
+
-->
|
| 144 |
+
|
| 145 |
+
<!--
|
| 146 |
+
### Recommendations
|
| 147 |
+
|
| 148 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
| 149 |
+
-->
|
| 150 |
+
|
| 151 |
+
## Training Details
|
| 152 |
+
|
| 153 |
+
### Training Dataset
|
| 154 |
+
|
| 155 |
+
#### json
|
| 156 |
+
|
| 157 |
+
* Dataset: json
|
| 158 |
+
* Size: 811,257 training samples
|
| 159 |
+
* Columns: <code>query</code> and <code>positive_passage</code>
|
| 160 |
+
* Approximate statistics based on the first 1000 samples:
|
| 161 |
+
| | query | positive_passage |
|
| 162 |
+
|:--------|:------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|
|
| 163 |
+
| type | string | string |
|
| 164 |
+
| details | <ul><li>min: 14 tokens</li><li>mean: 72.25 tokens</li><li>max: 256 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 111.83 tokens</li><li>max: 256 tokens</li></ul> |
|
| 165 |
+
* Samples:
|
| 166 |
+
| query | positive_passage |
|
| 167 |
+
|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
| 168 |
+
| <code>The method of claim 9 wherein the first area is located at an upper part of the screen and the second area is located at a lower part of the screen.</code> | <code>At this point the user can touch on a third icon 734 corresponding to a third application to select the third application.</code> |
|
| 169 |
+
| <code>The mobile terminal of claim 8 wherein the controller is further configured to receive information from the specific external device indicating that the allow device search feature is enabled in the specific external device via the wireless communication unit and to control the display unit to display information requesting a user research for the specific external device.</code> | <code>Thereupon in this embodiment the communication device the information processing method thereof and the information processing program thereof constitute an address book DB in the data base part 18 and is constituted so that when receiving owner information from a communication terminal X namely a device of the other party by Bluetooth a Bluetooth device address ofthe communication terminal X obtained at the time of communication is recorded in the address book DB by using an owners name included in the owner information as a key.</code> |
|
| 170 |
+
| <code>The container according to claim 1 characterized in that the angle formed by the first bar 1 and the second bar 2 in the gate closing position is an obtuse angle between 150 and 180 or an acute angle between 0 and 30.</code> | <code>The second hydraulic actuator 25 is activated this actuator by means of the mechanical actuator 22 rotates the levers 17 in such a way that the relative small tooth 18 moves up under the edge of ring 4.The hydraulic actuator 20 is activated in such a way that the piston 21 rests on the head of the pin 6 and at the same timemoves the body 16 upwards in such a way as to eliminate the clearance existing between the small teeth 18 and the edge of ring 4 a necessary clearance to place the small teeth 18 under the edge of the ring 4 in the phase of coupling.</code> |
|
| 171 |
+
* Loss: [<code>SpladeLoss</code>](https://sbert.net/docs/package_reference/sparse_encoder/losses.html#spladeloss) with these parameters:
|
| 172 |
+
```json
|
| 173 |
+
{
|
| 174 |
+
"loss": "SparseMultipleNegativesRankingLoss(scale=1.0, similarity_fct='dot_score')",
|
| 175 |
+
"document_regularizer_weight": 0.001,
|
| 176 |
+
"query_regularizer_weight": 5e-05
|
| 177 |
+
}
|
| 178 |
+
```
|
| 179 |
+
|
| 180 |
+
### Training Hyperparameters
|
| 181 |
+
#### Non-Default Hyperparameters
|
| 182 |
+
|
| 183 |
+
- `per_device_train_batch_size`: 24
|
| 184 |
+
- `gradient_accumulation_steps`: 8
|
| 185 |
+
- `learning_rate`: 2e-05
|
| 186 |
+
- `num_train_epochs`: 2
|
| 187 |
+
- `warmup_ratio`: 0.1
|
| 188 |
+
- `bf16`: True
|
| 189 |
+
- `batch_sampler`: no_duplicates
|
| 190 |
+
|
| 191 |
+
#### All Hyperparameters
|
| 192 |
+
<details><summary>Click to expand</summary>
|
| 193 |
+
|
| 194 |
+
- `overwrite_output_dir`: False
|
| 195 |
+
- `do_predict`: False
|
| 196 |
+
- `eval_strategy`: no
|
| 197 |
+
- `prediction_loss_only`: True
|
| 198 |
+
- `per_device_train_batch_size`: 24
|
| 199 |
+
- `per_device_eval_batch_size`: 8
|
| 200 |
+
- `per_gpu_train_batch_size`: None
|
| 201 |
+
- `per_gpu_eval_batch_size`: None
|
| 202 |
+
- `gradient_accumulation_steps`: 8
|
| 203 |
+
- `eval_accumulation_steps`: None
|
| 204 |
+
- `torch_empty_cache_steps`: None
|
| 205 |
+
- `learning_rate`: 2e-05
|
| 206 |
+
- `weight_decay`: 0.0
|
| 207 |
+
- `adam_beta1`: 0.9
|
| 208 |
+
- `adam_beta2`: 0.999
|
| 209 |
+
- `adam_epsilon`: 1e-08
|
| 210 |
+
- `max_grad_norm`: 1.0
|
| 211 |
+
- `num_train_epochs`: 2
|
| 212 |
+
- `max_steps`: -1
|
| 213 |
+
- `lr_scheduler_type`: linear
|
| 214 |
+
- `lr_scheduler_kwargs`: {}
|
| 215 |
+
- `warmup_ratio`: 0.1
|
| 216 |
+
- `warmup_steps`: 0
|
| 217 |
+
- `log_level`: passive
|
| 218 |
+
- `log_level_replica`: warning
|
| 219 |
+
- `log_on_each_node`: True
|
| 220 |
+
- `logging_nan_inf_filter`: True
|
| 221 |
+
- `save_safetensors`: True
|
| 222 |
+
- `save_on_each_node`: False
|
| 223 |
+
- `save_only_model`: False
|
| 224 |
+
- `restore_callback_states_from_checkpoint`: False
|
| 225 |
+
- `no_cuda`: False
|
| 226 |
+
- `use_cpu`: False
|
| 227 |
+
- `use_mps_device`: False
|
| 228 |
+
- `seed`: 42
|
| 229 |
+
- `data_seed`: None
|
| 230 |
+
- `jit_mode_eval`: False
|
| 231 |
+
- `use_ipex`: False
|
| 232 |
+
- `bf16`: True
|
| 233 |
+
- `fp16`: False
|
| 234 |
+
- `fp16_opt_level`: O1
|
| 235 |
+
- `half_precision_backend`: auto
|
| 236 |
+
- `bf16_full_eval`: False
|
| 237 |
+
- `fp16_full_eval`: False
|
| 238 |
+
- `tf32`: None
|
| 239 |
+
- `local_rank`: 0
|
| 240 |
+
- `ddp_backend`: None
|
| 241 |
+
- `tpu_num_cores`: None
|
| 242 |
+
- `tpu_metrics_debug`: False
|
| 243 |
+
- `debug`: []
|
| 244 |
+
- `dataloader_drop_last`: False
|
| 245 |
+
- `dataloader_num_workers`: 0
|
| 246 |
+
- `dataloader_prefetch_factor`: None
|
| 247 |
+
- `past_index`: -1
|
| 248 |
+
- `disable_tqdm`: False
|
| 249 |
+
- `remove_unused_columns`: True
|
| 250 |
+
- `label_names`: None
|
| 251 |
+
- `load_best_model_at_end`: False
|
| 252 |
+
- `ignore_data_skip`: False
|
| 253 |
+
- `fsdp`: []
|
| 254 |
+
- `fsdp_min_num_params`: 0
|
| 255 |
+
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
| 256 |
+
- `fsdp_transformer_layer_cls_to_wrap`: None
|
| 257 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
| 258 |
+
- `deepspeed`: None
|
| 259 |
+
- `label_smoothing_factor`: 0.0
|
| 260 |
+
- `optim`: adamw_torch
|
| 261 |
+
- `optim_args`: None
|
| 262 |
+
- `adafactor`: False
|
| 263 |
+
- `group_by_length`: False
|
| 264 |
+
- `length_column_name`: length
|
| 265 |
+
- `ddp_find_unused_parameters`: None
|
| 266 |
+
- `ddp_bucket_cap_mb`: None
|
| 267 |
+
- `ddp_broadcast_buffers`: False
|
| 268 |
+
- `dataloader_pin_memory`: True
|
| 269 |
+
- `dataloader_persistent_workers`: False
|
| 270 |
+
- `skip_memory_metrics`: True
|
| 271 |
+
- `use_legacy_prediction_loop`: False
|
| 272 |
+
- `push_to_hub`: False
|
| 273 |
+
- `resume_from_checkpoint`: None
|
| 274 |
+
- `hub_model_id`: None
|
| 275 |
+
- `hub_strategy`: every_save
|
| 276 |
+
- `hub_private_repo`: None
|
| 277 |
+
- `hub_always_push`: False
|
| 278 |
+
- `hub_revision`: None
|
| 279 |
+
- `gradient_checkpointing`: False
|
| 280 |
+
- `gradient_checkpointing_kwargs`: None
|
| 281 |
+
- `include_inputs_for_metrics`: False
|
| 282 |
+
- `include_for_metrics`: []
|
| 283 |
+
- `eval_do_concat_batches`: True
|
| 284 |
+
- `fp16_backend`: auto
|
| 285 |
+
- `push_to_hub_model_id`: None
|
| 286 |
+
- `push_to_hub_organization`: None
|
| 287 |
+
- `mp_parameters`:
|
| 288 |
+
- `auto_find_batch_size`: False
|
| 289 |
+
- `full_determinism`: False
|
| 290 |
+
- `torchdynamo`: None
|
| 291 |
+
- `ray_scope`: last
|
| 292 |
+
- `ddp_timeout`: 1800
|
| 293 |
+
- `torch_compile`: False
|
| 294 |
+
- `torch_compile_backend`: None
|
| 295 |
+
- `torch_compile_mode`: None
|
| 296 |
+
- `include_tokens_per_second`: False
|
| 297 |
+
- `include_num_input_tokens_seen`: False
|
| 298 |
+
- `neftune_noise_alpha`: None
|
| 299 |
+
- `optim_target_modules`: None
|
| 300 |
+
- `batch_eval_metrics`: False
|
| 301 |
+
- `eval_on_start`: False
|
| 302 |
+
- `use_liger_kernel`: False
|
| 303 |
+
- `liger_kernel_config`: None
|
| 304 |
+
- `eval_use_gather_object`: False
|
| 305 |
+
- `average_tokens_across_devices`: False
|
| 306 |
+
- `prompts`: None
|
| 307 |
+
- `batch_sampler`: no_duplicates
|
| 308 |
+
- `multi_dataset_batch_sampler`: proportional
|
| 309 |
+
- `router_mapping`: {}
|
| 310 |
+
- `learning_rate_mapping`: {}
|
| 311 |
+
|
| 312 |
+
</details>
|
| 313 |
+
|
| 314 |
+
### Training Logs
|
| 315 |
+
| Epoch | Step | Training Loss |
|
| 316 |
+
|:------:|:----:|:-------------:|
|
| 317 |
+
| 0.0237 | 100 | 3921.6512 |
|
| 318 |
+
| 0.0473 | 200 | 10.5268 |
|
| 319 |
+
| 0.0710 | 300 | 1.9553 |
|
| 320 |
+
| 0.0947 | 400 | 1.6494 |
|
| 321 |
+
| 0.1183 | 500 | 1.5371 |
|
| 322 |
+
| 0.1420 | 600 | 1.4252 |
|
| 323 |
+
| 0.1657 | 700 | 1.3429 |
|
| 324 |
+
| 0.1893 | 800 | 1.2958 |
|
| 325 |
+
| 0.2130 | 900 | 1.2307 |
|
| 326 |
+
| 0.2367 | 1000 | 1.1905 |
|
| 327 |
+
| 0.2603 | 1100 | 1.1774 |
|
| 328 |
+
| 0.2840 | 1200 | 1.1387 |
|
| 329 |
+
| 0.3077 | 1300 | 1.0852 |
|
| 330 |
+
| 0.3313 | 1400 | 1.0718 |
|
| 331 |
+
| 0.3550 | 1500 | 1.0435 |
|
| 332 |
+
| 0.3787 | 1600 | 1.0166 |
|
| 333 |
+
| 0.4023 | 1700 | 1.0151 |
|
| 334 |
+
| 0.4260 | 1800 | 0.9792 |
|
| 335 |
+
| 0.4497 | 1900 | 0.9725 |
|
| 336 |
+
| 0.4733 | 2000 | 0.9492 |
|
| 337 |
+
| 0.4970 | 2100 | 0.9253 |
|
| 338 |
+
| 0.5207 | 2200 | 0.9178 |
|
| 339 |
+
| 0.5443 | 2300 | 0.9252 |
|
| 340 |
+
| 0.5680 | 2400 | 0.912 |
|
| 341 |
+
| 0.5917 | 2500 | 0.8796 |
|
| 342 |
+
| 0.6153 | 2600 | 0.8631 |
|
| 343 |
+
| 0.6390 | 2700 | 0.8575 |
|
| 344 |
+
| 0.6627 | 2800 | 0.8361 |
|
| 345 |
+
| 0.6863 | 2900 | 0.8407 |
|
| 346 |
+
| 0.7100 | 3000 | 0.8296 |
|
| 347 |
+
| 0.7337 | 3100 | 0.818 |
|
| 348 |
+
| 0.7573 | 3200 | 0.813 |
|
| 349 |
+
| 0.7810 | 3300 | 0.8073 |
|
| 350 |
+
| 0.8047 | 3400 | 0.7929 |
|
| 351 |
+
| 0.8283 | 3500 | 0.7927 |
|
| 352 |
+
| 0.8520 | 3600 | 0.7718 |
|
| 353 |
+
| 0.8757 | 3700 | 0.7823 |
|
| 354 |
+
| 0.8993 | 3800 | 0.7607 |
|
| 355 |
+
| 0.9230 | 3900 | 0.7547 |
|
| 356 |
+
| 0.9467 | 4000 | 0.7547 |
|
| 357 |
+
| 0.9703 | 4100 | 0.7286 |
|
| 358 |
+
| 0.9940 | 4200 | 0.7269 |
|
| 359 |
+
| 1.0175 | 4300 | 0.7186 |
|
| 360 |
+
| 1.0412 | 4400 | 0.6988 |
|
| 361 |
+
| 1.0648 | 4500 | 0.6888 |
|
| 362 |
+
| 1.0885 | 4600 | 0.6971 |
|
| 363 |
+
| 1.1122 | 4700 | 0.6833 |
|
| 364 |
+
| 1.1358 | 4800 | 0.6854 |
|
| 365 |
+
| 1.1595 | 4900 | 0.6771 |
|
| 366 |
+
| 1.1832 | 5000 | 0.6798 |
|
| 367 |
+
| 1.2068 | 5100 | 0.6596 |
|
| 368 |
+
| 1.2305 | 5200 | 0.6344 |
|
| 369 |
+
| 1.2542 | 5300 | 0.6529 |
|
| 370 |
+
| 1.2778 | 5400 | 0.6569 |
|
| 371 |
+
| 1.3015 | 5500 | 0.6414 |
|
| 372 |
+
| 1.3252 | 5600 | 0.6386 |
|
| 373 |
+
| 1.3488 | 5700 | 0.6324 |
|
| 374 |
+
| 1.3725 | 5800 | 0.6478 |
|
| 375 |
+
| 1.3962 | 5900 | 0.6372 |
|
| 376 |
+
| 1.4198 | 6000 | 0.6292 |
|
| 377 |
+
| 1.4435 | 6100 | 0.6272 |
|
| 378 |
+
| 1.4672 | 6200 | 0.623 |
|
| 379 |
+
| 1.4908 | 6300 | 0.6215 |
|
| 380 |
+
| 1.5145 | 6400 | 0.6307 |
|
| 381 |
+
| 1.5382 | 6500 | 0.6256 |
|
| 382 |
+
| 1.5618 | 6600 | 0.6179 |
|
| 383 |
+
| 1.5855 | 6700 | 0.6089 |
|
| 384 |
+
| 1.6092 | 6800 | 0.6111 |
|
| 385 |
+
| 1.6328 | 6900 | 0.6036 |
|
| 386 |
+
| 1.6565 | 7000 | 0.6169 |
|
| 387 |
+
| 1.6802 | 7100 | 0.6152 |
|
| 388 |
+
| 1.7038 | 7200 | 0.6055 |
|
| 389 |
+
| 1.7275 | 7300 | 0.5846 |
|
| 390 |
+
| 1.7512 | 7400 | 0.5955 |
|
| 391 |
+
| 1.7748 | 7500 | 0.6083 |
|
| 392 |
+
| 1.7985 | 7600 | 0.6015 |
|
| 393 |
+
| 1.8222 | 7700 | 0.5871 |
|
| 394 |
+
| 1.8458 | 7800 | 0.5821 |
|
| 395 |
+
| 1.8695 | 7900 | 0.5941 |
|
| 396 |
+
| 1.8932 | 8000 | 0.5859 |
|
| 397 |
+
| 1.9168 | 8100 | 0.5974 |
|
| 398 |
+
| 1.9405 | 8200 | 0.5917 |
|
| 399 |
+
| 1.9642 | 8300 | 0.5787 |
|
| 400 |
+
| 1.9878 | 8400 | 0.5902 |
|
| 401 |
+
|
| 402 |
+
|
| 403 |
+
### Framework Versions
|
| 404 |
+
- Python: 3.11.10
|
| 405 |
+
- Sentence Transformers: 5.0.0
|
| 406 |
+
- Transformers: 4.53.0
|
| 407 |
+
- PyTorch: 2.4.1+cu124
|
| 408 |
+
- Accelerate: 1.8.1
|
| 409 |
+
- Datasets: 3.6.0
|
| 410 |
+
- Tokenizers: 0.21.2
|
| 411 |
+
|
| 412 |
+
## Citation
|
| 413 |
+
|
| 414 |
+
### BibTeX
|
| 415 |
+
|
| 416 |
+
#### Sentence Transformers
|
| 417 |
+
```bibtex
|
| 418 |
+
@inproceedings{reimers-2019-sentence-bert,
|
| 419 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
| 420 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
| 421 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
| 422 |
+
month = "11",
|
| 423 |
+
year = "2019",
|
| 424 |
+
publisher = "Association for Computational Linguistics",
|
| 425 |
+
url = "https://arxiv.org/abs/1908.10084",
|
| 426 |
+
}
|
| 427 |
+
```
|
| 428 |
+
|
| 429 |
+
#### SpladeLoss
|
| 430 |
+
```bibtex
|
| 431 |
+
@misc{formal2022distillationhardnegativesampling,
|
| 432 |
+
title={From Distillation to Hard Negative Sampling: Making Sparse Neural IR Models More Effective},
|
| 433 |
+
author={Thibault Formal and Carlos Lassance and Benjamin Piwowarski and Stéphane Clinchant},
|
| 434 |
+
year={2022},
|
| 435 |
+
eprint={2205.04733},
|
| 436 |
+
archivePrefix={arXiv},
|
| 437 |
+
primaryClass={cs.IR},
|
| 438 |
+
url={https://arxiv.org/abs/2205.04733},
|
| 439 |
+
}
|
| 440 |
+
```
|
| 441 |
+
|
| 442 |
+
#### SparseMultipleNegativesRankingLoss
|
| 443 |
+
```bibtex
|
| 444 |
+
@misc{henderson2017efficient,
|
| 445 |
+
title={Efficient Natural Language Response Suggestion for Smart Reply},
|
| 446 |
+
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},
|
| 447 |
+
year={2017},
|
| 448 |
+
eprint={1705.00652},
|
| 449 |
+
archivePrefix={arXiv},
|
| 450 |
+
primaryClass={cs.CL}
|
| 451 |
+
}
|
| 452 |
+
```
|
| 453 |
+
|
| 454 |
+
#### FlopsLoss
|
| 455 |
+
```bibtex
|
| 456 |
+
@article{paria2020minimizing,
|
| 457 |
+
title={Minimizing flops to learn efficient sparse representations},
|
| 458 |
+
author={Paria, Biswajit and Yeh, Chih-Kuan and Yen, Ian EH and Xu, Ning and Ravikumar, Pradeep and P{'o}czos, Barnab{'a}s},
|
| 459 |
+
journal={arXiv preprint arXiv:2004.05665},
|
| 460 |
+
year={2020}
|
| 461 |
+
}
|
| 462 |
+
```
|
| 463 |
+
|
| 464 |
+
<!--
|
| 465 |
+
## Glossary
|
| 466 |
+
|
| 467 |
+
*Clearly define terms in order to be accessible across audiences.*
|
| 468 |
+
-->
|
| 469 |
+
|
| 470 |
+
<!--
|
| 471 |
+
## Model Card Authors
|
| 472 |
+
|
| 473 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
| 474 |
+
-->
|
| 475 |
+
|
| 476 |
+
<!--
|
| 477 |
+
## Model Card Contact
|
| 478 |
+
|
| 479 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
| 480 |
+
-->
|
config.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation": "gelu",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"DistilBertForMaskedLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_dropout": 0.1,
|
| 7 |
+
"dim": 768,
|
| 8 |
+
"dropout": 0.1,
|
| 9 |
+
"hidden_dim": 3072,
|
| 10 |
+
"initializer_range": 0.02,
|
| 11 |
+
"max_position_embeddings": 512,
|
| 12 |
+
"model_type": "distilbert",
|
| 13 |
+
"n_heads": 12,
|
| 14 |
+
"n_layers": 6,
|
| 15 |
+
"pad_token_id": 0,
|
| 16 |
+
"qa_dropout": 0.1,
|
| 17 |
+
"seq_classif_dropout": 0.2,
|
| 18 |
+
"sinusoidal_pos_embds": false,
|
| 19 |
+
"tie_weights_": true,
|
| 20 |
+
"torch_dtype": "float32",
|
| 21 |
+
"transformers_version": "4.53.0",
|
| 22 |
+
"vocab_size": 30522
|
| 23 |
+
}
|
config_sentence_transformers.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "SparseEncoder",
|
| 3 |
+
"__version__": {
|
| 4 |
+
"sentence_transformers": "5.0.0",
|
| 5 |
+
"transformers": "4.53.0",
|
| 6 |
+
"pytorch": "2.4.1+cu124"
|
| 7 |
+
},
|
| 8 |
+
"prompts": {
|
| 9 |
+
"query": "",
|
| 10 |
+
"document": ""
|
| 11 |
+
},
|
| 12 |
+
"default_prompt_name": null,
|
| 13 |
+
"similarity_fn_name": "dot"
|
| 14 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7345cf42335b7eb37e4bd7ff132f65afa91821dcdc4f7649b89be1c184cda188
|
| 3 |
+
size 267954768
|
modules.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"idx": 0,
|
| 4 |
+
"name": "0",
|
| 5 |
+
"path": "",
|
| 6 |
+
"type": "sentence_transformers.sparse_encoder.models.MLMTransformer"
|
| 7 |
+
},
|
| 8 |
+
{
|
| 9 |
+
"idx": 1,
|
| 10 |
+
"name": "1",
|
| 11 |
+
"path": "1_SpladePooling",
|
| 12 |
+
"type": "sentence_transformers.sparse_encoder.models.SpladePooling"
|
| 13 |
+
}
|
| 14 |
+
]
|
sentence_bert_config.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"max_seq_length": 256,
|
| 3 |
+
"do_lower_case": false
|
| 4 |
+
}
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cls_token": "[CLS]",
|
| 3 |
+
"mask_token": "[MASK]",
|
| 4 |
+
"pad_token": "[PAD]",
|
| 5 |
+
"sep_token": "[SEP]",
|
| 6 |
+
"unk_token": "[UNK]"
|
| 7 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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_lower_case": true,
|
| 47 |
+
"extra_special_tokens": {},
|
| 48 |
+
"mask_token": "[MASK]",
|
| 49 |
+
"model_max_length": 512,
|
| 50 |
+
"pad_token": "[PAD]",
|
| 51 |
+
"sep_token": "[SEP]",
|
| 52 |
+
"strip_accents": null,
|
| 53 |
+
"tokenize_chinese_chars": true,
|
| 54 |
+
"tokenizer_class": "DistilBertTokenizer",
|
| 55 |
+
"unk_token": "[UNK]"
|
| 56 |
+
}
|
vocab.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|