add fine-tuned SPLADE v4 (occasion fix)
Browse files- splade_v4/1_SpladePooling/config.json +5 -0
- splade_v4/README.md +443 -0
- splade_v4/config.json +28 -0
- splade_v4/config_sentence_transformers.json +14 -0
- splade_v4/model.safetensors +3 -0
- splade_v4/modules.json +14 -0
- splade_v4/sentence_bert_config.json +10 -0
- splade_v4/tokenizer.json +0 -0
- splade_v4/tokenizer_config.json +15 -0
splade_v4/1_SpladePooling/config.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"pooling_strategy": "max",
|
| 3 |
+
"activation_function": "relu",
|
| 4 |
+
"embedding_dimension": 119547
|
| 5 |
+
}
|
splade_v4/README.md
ADDED
|
@@ -0,0 +1,443 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- sentence-transformers
|
| 4 |
+
- sparse-encoder
|
| 5 |
+
- sparse
|
| 6 |
+
- splade
|
| 7 |
+
- generated_from_trainer
|
| 8 |
+
- dataset_size:633174
|
| 9 |
+
- loss:SpladeLoss
|
| 10 |
+
- loss:SparseMultipleNegativesRankingLoss
|
| 11 |
+
- loss:FlopsLoss
|
| 12 |
+
base_model: distilbert/distilbert-base-multilingual-cased
|
| 13 |
+
widget:
|
| 14 |
+
- text: '[Styli] Wired Floral Lace Balconette Bra Pink (Pink) | حمالة صدر بالكونيت
|
| 15 |
+
دانتيل بتطريز زهري وحواف مقوسة بدون حشوة وسلكية مع لوحة مقصوصة مخيطة (وردي). Category:
|
| 16 |
+
Lingerie & Underwear > Bras.'
|
| 17 |
+
- text: '[SHAPES] OVERSIZED COMFORT HOODIE (Black) | هودي مريح كبير الحجم (أسود).
|
| 18 |
+
Category: > .'
|
| 19 |
+
- text: '[Splash] Linen Blend Polo T-shirt Blue (Blue) | Linen Blend Polo T-shirt
|
| 20 |
+
(أزرق). Category: Tops > Shirts & Button-Downs.'
|
| 21 |
+
- text: '[CAMPUS] Women''s Pastel Low Top Sneakers Beige (Beige) | أحذية رياضية نسائية
|
| 22 |
+
قصيرة بتدرجات الباستيل البارزة (بيج). Category: Shoes > Sneakers.'
|
| 23 |
+
- text: '[Karl Lagerfeld] Women''s Long Sleeve Printed Top Black (Black) | بلوزة مطبوعة
|
| 24 |
+
بالكامل بأكمام طويلة ورقبة دائرية للنساء، متعددة الألوان (أسود). Category: >
|
| 25 |
+
.'
|
| 26 |
+
pipeline_tag: feature-extraction
|
| 27 |
+
library_name: sentence-transformers
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
# SPLADE Sparse Encoder
|
| 31 |
+
|
| 32 |
+
This is a [SPLADE Sparse Encoder](https://www.sbert.net/docs/sparse_encoder/usage/usage.html) model finetuned from [distilbert/distilbert-base-multilingual-cased](https://huggingface.co/distilbert/distilbert-base-multilingual-cased) on the pairs and triplets datasets using the [sentence-transformers](https://www.SBERT.net) library. It maps sentences & paragraphs to a 119547-dimensional sparse vector space and can be used for semantic search and sparse retrieval.
|
| 33 |
+
## Model Details
|
| 34 |
+
|
| 35 |
+
### Model Description
|
| 36 |
+
- **Model Type:** SPLADE Sparse Encoder
|
| 37 |
+
- **Base model:** [distilbert/distilbert-base-multilingual-cased](https://huggingface.co/distilbert/distilbert-base-multilingual-cased) <!-- at revision 45c032ab32cc946ad88a166f7cb282f58c753c2e -->
|
| 38 |
+
- **Maximum Sequence Length:** 128 tokens
|
| 39 |
+
- **Output Dimensionality:** 119547 dimensions
|
| 40 |
+
- **Similarity Function:** Dot Product
|
| 41 |
+
- **Supported Modality:** Text
|
| 42 |
+
- **Training Datasets:**
|
| 43 |
+
- pairs
|
| 44 |
+
- triplets
|
| 45 |
+
<!-- - **Language:** Unknown -->
|
| 46 |
+
<!-- - **License:** Unknown -->
|
| 47 |
+
|
| 48 |
+
### Model Sources
|
| 49 |
+
|
| 50 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
| 51 |
+
- **Documentation:** [Sparse Encoder Documentation](https://www.sbert.net/docs/sparse_encoder/usage/usage.html)
|
| 52 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
|
| 53 |
+
- **Hugging Face:** [Sparse Encoders on Hugging Face](https://huggingface.co/models?library=sentence-transformers&other=sparse-encoder)
|
| 54 |
+
|
| 55 |
+
### Full Model Architecture
|
| 56 |
+
|
| 57 |
+
```
|
| 58 |
+
SparseEncoder(
|
| 59 |
+
(0): Transformer({'transformer_task': 'fill-mask', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'logits'}}, 'module_output_name': 'token_embeddings', 'architecture': 'DistilBertForMaskedLM'})
|
| 60 |
+
(1): SpladePooling({'pooling_strategy': 'max', 'activation_function': 'relu', 'embedding_dimension': 119547})
|
| 61 |
+
)
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
## Usage
|
| 65 |
+
|
| 66 |
+
### Direct Usage (Sentence Transformers)
|
| 67 |
+
|
| 68 |
+
First install the Sentence Transformers library:
|
| 69 |
+
|
| 70 |
+
```bash
|
| 71 |
+
pip install -U sentence-transformers
|
| 72 |
+
```
|
| 73 |
+
Then you can load this model and run inference.
|
| 74 |
+
```python
|
| 75 |
+
from sentence_transformers import SparseEncoder
|
| 76 |
+
|
| 77 |
+
# Download from the 🤗 Hub
|
| 78 |
+
model = SparseEncoder("sparse_encoder_model_id")
|
| 79 |
+
# Run inference
|
| 80 |
+
sentences = [
|
| 81 |
+
'كندرة طولية مطبوعة رجالي',
|
| 82 |
+
"[Karl Lagerfeld] Women's Long Sleeve Printed Top Black (Black) | بلوزة مطبوعة بالكامل بأكمام طويلة ورقبة دائرية للنساء، متعددة الألوان (أسود). Category: > .",
|
| 83 |
+
'[Splash Fav] Regular Fit Twill Blazer Cream (Cream) | Regular Fit Twill Blazer with Button Closure (كريمي). Category: Suits > Blazers.',
|
| 84 |
+
]
|
| 85 |
+
embeddings = model.encode(sentences)
|
| 86 |
+
print(embeddings.shape)
|
| 87 |
+
# [3, 119547]
|
| 88 |
+
|
| 89 |
+
# Get the similarity scores for the embeddings
|
| 90 |
+
similarities = model.similarity(embeddings, embeddings)
|
| 91 |
+
print(similarities)
|
| 92 |
+
# tensor([[ 30.1986, 30.1103, 15.3038],
|
| 93 |
+
# [ 30.1103, 193.7718, 59.9433],
|
| 94 |
+
# [ 15.3038, 59.9433, 248.5168]])
|
| 95 |
+
```
|
| 96 |
+
<!--
|
| 97 |
+
### Direct Usage (Transformers)
|
| 98 |
+
|
| 99 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
| 100 |
+
|
| 101 |
+
</details>
|
| 102 |
+
-->
|
| 103 |
+
|
| 104 |
+
<!--
|
| 105 |
+
### Downstream Usage (Sentence Transformers)
|
| 106 |
+
|
| 107 |
+
You can finetune this model on your own dataset.
|
| 108 |
+
|
| 109 |
+
<details><summary>Click to expand</summary>
|
| 110 |
+
|
| 111 |
+
</details>
|
| 112 |
+
-->
|
| 113 |
+
|
| 114 |
+
<!--
|
| 115 |
+
### Out-of-Scope Use
|
| 116 |
+
|
| 117 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
| 118 |
+
-->
|
| 119 |
+
|
| 120 |
+
<!--
|
| 121 |
+
## Bias, Risks and Limitations
|
| 122 |
+
|
| 123 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
| 124 |
+
-->
|
| 125 |
+
|
| 126 |
+
<!--
|
| 127 |
+
### Recommendations
|
| 128 |
+
|
| 129 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
| 130 |
+
-->
|
| 131 |
+
|
| 132 |
+
## Training Details
|
| 133 |
+
|
| 134 |
+
### Training Datasets
|
| 135 |
+
|
| 136 |
+
#### pairs
|
| 137 |
+
|
| 138 |
+
* Dataset: pairs
|
| 139 |
+
* Size: 605,436 training samples
|
| 140 |
+
* Columns: <code>query</code> and <code>positive</code>
|
| 141 |
+
* Approximate statistics based on the first 100 samples:
|
| 142 |
+
| | query | positive |
|
| 143 |
+
|:---------|:----------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|
|
| 144 |
+
| type | string | string |
|
| 145 |
+
| modality | text | text |
|
| 146 |
+
| details | <ul><li>min: 6 tokens</li><li>mean: 10.33 tokens</li><li>max: 20 tokens</li></ul> | <ul><li>min: 28 tokens</li><li>mean: 51.14 tokens</li><li>max: 124 tokens</li></ul> |
|
| 147 |
+
* Samples:
|
| 148 |
+
| query | positive |
|
| 149 |
+
|:--------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
| 150 |
+
| <code>men's watch analog</code> | <code>[CASIO] Leather Strap Analog Watch (Mint Green) \| ساعة انالوج جلد اصلي (أخضر نعناعي). Category: > .</code> |
|
| 151 |
+
| <code>black hoodie women</code> | <code>[Tribe of 6] Women's Logo Hooded Sweatshirt Black (Black) \| سويت شيرت نسائي سادة بأكمام طويلة وغطاء رأس، أسود (أسود). Category: Hoodies & Sweatshirt > Hoodies.</code> |
|
| 152 |
+
| <code>وشاح مخطط للنساء</code> | <code>[MANGO] Geometric Stripe Scarf Beige (Beige) \| وشاح بنقوش هندسية مخططة (بيج). Category: Accessories > Scarves.</code> |
|
| 153 |
+
* Loss: [<code>SpladeLoss</code>](https://sbert.net/docs/package_reference/sparse_encoder/losses.html#spladeloss) with these parameters:
|
| 154 |
+
```json
|
| 155 |
+
{
|
| 156 |
+
"loss": "SparseMultipleNegativesRankingLoss(scale=1.0, similarity_fct='dot_score', gather_across_devices=False, directions=('query_to_doc',), partition_mode='joint', hardness_mode=None, hardness_strength=0.0)",
|
| 157 |
+
"document_regularizer_weight": 3e-05,
|
| 158 |
+
"query_regularizer_weight": 5e-05
|
| 159 |
+
}
|
| 160 |
+
```
|
| 161 |
+
|
| 162 |
+
#### triplets
|
| 163 |
+
|
| 164 |
+
* Dataset: triplets
|
| 165 |
+
* Size: 27,738 training samples
|
| 166 |
+
* Columns: <code>query</code>, <code>positive</code>, and <code>negative</code>
|
| 167 |
+
* Approximate statistics based on the first 100 samples:
|
| 168 |
+
| | query | positive | negative |
|
| 169 |
+
|:---------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
|
| 170 |
+
| type | string | string | string |
|
| 171 |
+
| modality | text | text | text |
|
| 172 |
+
| details | <ul><li>min: 11 tokens</li><li>mean: 12.15 tokens</li><li>max: 14 tokens</li></ul> | <ul><li>min: 34 tokens</li><li>mean: 48.58 tokens</li><li>max: 61 tokens</li></ul> | <ul><li>min: 48 tokens</li><li>mean: 52.9 tokens</li><li>max: 62 tokens</li></ul> |
|
| 173 |
+
* Samples:
|
| 174 |
+
| query | positive | negative |
|
| 175 |
+
|:--------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
| 176 |
+
| <code>كندرة أونلاين بسروات زين</code> | <code>[Khizana] Denim A-line Skirt Steel Blue (Steel Blue) \| تنورة - من الدنيم (أزرق فولاذي). Category: Denim > Denim Skirts.</code> | <code>[Tchibo] Women's Checkered Pull-On Shorts Dark Blue (Dark Blue) \| شورت بنمط مربعات سهل الارتداء للنساء، أزرق (أزرق غامق). Category: > .</code> |
|
| 177 |
+
| <code>كندرة أونلاين بسروات زين</code> | <code>[Khizana] Denim A-line Skirt Steel Blue (Steel Blue) \| تنورة - من الدنيم (أزرق فولاذي). Category: Denim > Denim Skirts.</code> | <code>[Styli] Styli Set of 2 Ribbon Detail Socks Light Steel Blue (Light Steel Blue) \| طقم جوارب من قطعتين بتفاصيل شريط (أزرق فولاذي فاتح). Category: Shoes > Socks.</code> |
|
| 178 |
+
| <code>كندرة أونلاين بسروات زين</code> | <code>[Khizana] Denim A-line Skirt Steel Blue (Steel Blue) \| تنورة - من الدنيم (أزرق فولاذي). Category: Denim > Denim Skirts.</code> | <code>[Tchibo] Women's Checkered Pull-On Shorts Dark Blue (Dark Blue) \| شورت بنمط مربعات سهل الارتداء للنساء، أزرق (أزرق غامق). Category: > .</code> |
|
| 179 |
+
* Loss: [<code>SpladeLoss</code>](https://sbert.net/docs/package_reference/sparse_encoder/losses.html#spladeloss) with these parameters:
|
| 180 |
+
```json
|
| 181 |
+
{
|
| 182 |
+
"loss": "SparseMultipleNegativesRankingLoss(scale=1.0, similarity_fct='dot_score', gather_across_devices=False, directions=('query_to_doc',), partition_mode='joint', hardness_mode=None, hardness_strength=0.0)",
|
| 183 |
+
"document_regularizer_weight": 3e-05,
|
| 184 |
+
"query_regularizer_weight": 5e-05
|
| 185 |
+
}
|
| 186 |
+
```
|
| 187 |
+
|
| 188 |
+
### Training Hyperparameters
|
| 189 |
+
#### Non-Default Hyperparameters
|
| 190 |
+
|
| 191 |
+
- `per_device_train_batch_size`: 16
|
| 192 |
+
- `num_train_epochs`: 1
|
| 193 |
+
- `learning_rate`: 2e-05
|
| 194 |
+
- `warmup_steps`: 0.1
|
| 195 |
+
- `gradient_accumulation_steps`: 4
|
| 196 |
+
- `bf16`: True
|
| 197 |
+
- `dataloader_num_workers`: 2
|
| 198 |
+
|
| 199 |
+
#### All Hyperparameters
|
| 200 |
+
<details><summary>Click to expand</summary>
|
| 201 |
+
|
| 202 |
+
- `per_device_train_batch_size`: 16
|
| 203 |
+
- `num_train_epochs`: 1
|
| 204 |
+
- `max_steps`: -1
|
| 205 |
+
- `learning_rate`: 2e-05
|
| 206 |
+
- `lr_scheduler_type`: linear
|
| 207 |
+
- `lr_scheduler_kwargs`: None
|
| 208 |
+
- `warmup_steps`: 0.1
|
| 209 |
+
- `optim`: adamw_torch
|
| 210 |
+
- `optim_args`: None
|
| 211 |
+
- `weight_decay`: 0.0
|
| 212 |
+
- `adam_beta1`: 0.9
|
| 213 |
+
- `adam_beta2`: 0.999
|
| 214 |
+
- `adam_epsilon`: 1e-08
|
| 215 |
+
- `optim_target_modules`: None
|
| 216 |
+
- `gradient_accumulation_steps`: 4
|
| 217 |
+
- `average_tokens_across_devices`: True
|
| 218 |
+
- `max_grad_norm`: 1.0
|
| 219 |
+
- `label_smoothing_factor`: 0.0
|
| 220 |
+
- `bf16`: True
|
| 221 |
+
- `fp16`: False
|
| 222 |
+
- `bf16_full_eval`: False
|
| 223 |
+
- `fp16_full_eval`: False
|
| 224 |
+
- `tf32`: None
|
| 225 |
+
- `gradient_checkpointing`: False
|
| 226 |
+
- `gradient_checkpointing_kwargs`: None
|
| 227 |
+
- `torch_compile`: False
|
| 228 |
+
- `torch_compile_backend`: None
|
| 229 |
+
- `torch_compile_mode`: None
|
| 230 |
+
- `use_liger_kernel`: False
|
| 231 |
+
- `liger_kernel_config`: None
|
| 232 |
+
- `use_cache`: False
|
| 233 |
+
- `neftune_noise_alpha`: None
|
| 234 |
+
- `torch_empty_cache_steps`: None
|
| 235 |
+
- `auto_find_batch_size`: False
|
| 236 |
+
- `log_on_each_node`: True
|
| 237 |
+
- `logging_nan_inf_filter`: True
|
| 238 |
+
- `include_num_input_tokens_seen`: no
|
| 239 |
+
- `log_level`: passive
|
| 240 |
+
- `log_level_replica`: warning
|
| 241 |
+
- `disable_tqdm`: False
|
| 242 |
+
- `project`: huggingface
|
| 243 |
+
- `trackio_space_id`: None
|
| 244 |
+
- `trackio_bucket_id`: None
|
| 245 |
+
- `trackio_static_space_id`: None
|
| 246 |
+
- `per_device_eval_batch_size`: 8
|
| 247 |
+
- `prediction_loss_only`: True
|
| 248 |
+
- `eval_on_start`: False
|
| 249 |
+
- `eval_do_concat_batches`: True
|
| 250 |
+
- `eval_use_gather_object`: False
|
| 251 |
+
- `eval_accumulation_steps`: None
|
| 252 |
+
- `include_for_metrics`: []
|
| 253 |
+
- `batch_eval_metrics`: False
|
| 254 |
+
- `save_only_model`: False
|
| 255 |
+
- `save_on_each_node`: False
|
| 256 |
+
- `enable_jit_checkpoint`: False
|
| 257 |
+
- `push_to_hub`: False
|
| 258 |
+
- `hub_private_repo`: None
|
| 259 |
+
- `hub_model_id`: None
|
| 260 |
+
- `hub_strategy`: every_save
|
| 261 |
+
- `hub_always_push`: False
|
| 262 |
+
- `hub_revision`: None
|
| 263 |
+
- `load_best_model_at_end`: False
|
| 264 |
+
- `ignore_data_skip`: False
|
| 265 |
+
- `restore_callback_states_from_checkpoint`: False
|
| 266 |
+
- `full_determinism`: False
|
| 267 |
+
- `seed`: 42
|
| 268 |
+
- `data_seed`: None
|
| 269 |
+
- `use_cpu`: False
|
| 270 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
| 271 |
+
- `parallelism_config`: None
|
| 272 |
+
- `dataloader_drop_last`: False
|
| 273 |
+
- `dataloader_num_workers`: 2
|
| 274 |
+
- `dataloader_pin_memory`: True
|
| 275 |
+
- `dataloader_persistent_workers`: False
|
| 276 |
+
- `dataloader_prefetch_factor`: None
|
| 277 |
+
- `remove_unused_columns`: True
|
| 278 |
+
- `label_names`: None
|
| 279 |
+
- `train_sampling_strategy`: random
|
| 280 |
+
- `length_column_name`: length
|
| 281 |
+
- `ddp_find_unused_parameters`: None
|
| 282 |
+
- `ddp_bucket_cap_mb`: None
|
| 283 |
+
- `ddp_broadcast_buffers`: False
|
| 284 |
+
- `ddp_static_graph`: None
|
| 285 |
+
- `ddp_backend`: None
|
| 286 |
+
- `ddp_timeout`: 1800
|
| 287 |
+
- `fsdp`: None
|
| 288 |
+
- `fsdp_config`: None
|
| 289 |
+
- `deepspeed`: None
|
| 290 |
+
- `debug`: []
|
| 291 |
+
- `skip_memory_metrics`: True
|
| 292 |
+
- `do_predict`: False
|
| 293 |
+
- `resume_from_checkpoint`: None
|
| 294 |
+
- `warmup_ratio`: None
|
| 295 |
+
- `local_rank`: -1
|
| 296 |
+
- `prompts`: None
|
| 297 |
+
- `batch_sampler`: batch_sampler
|
| 298 |
+
- `multi_dataset_batch_sampler`: proportional
|
| 299 |
+
- `router_mapping`: {}
|
| 300 |
+
- `learning_rate_mapping`: {}
|
| 301 |
+
|
| 302 |
+
</details>
|
| 303 |
+
|
| 304 |
+
### Training Logs
|
| 305 |
+
| Epoch | Step | Training Loss |
|
| 306 |
+
|:------:|:----:|:-------------:|
|
| 307 |
+
| 0.0202 | 200 | 518.0875 |
|
| 308 |
+
| 0.0404 | 400 | 1.3120 |
|
| 309 |
+
| 0.0606 | 600 | 1.0065 |
|
| 310 |
+
| 0.0809 | 800 | 0.9330 |
|
| 311 |
+
| 0.1011 | 1000 | 0.8807 |
|
| 312 |
+
| 0.1213 | 1200 | 0.8054 |
|
| 313 |
+
| 0.1415 | 1400 | 0.7627 |
|
| 314 |
+
| 0.1617 | 1600 | 0.7404 |
|
| 315 |
+
| 0.1819 | 1800 | 0.7277 |
|
| 316 |
+
| 0.2022 | 2000 | 0.7013 |
|
| 317 |
+
| 0.2224 | 2200 | 0.6515 |
|
| 318 |
+
| 0.2426 | 2400 | 0.6359 |
|
| 319 |
+
| 0.2628 | 2600 | 0.6334 |
|
| 320 |
+
| 0.2830 | 2800 | 0.6284 |
|
| 321 |
+
| 0.3032 | 3000 | 0.6302 |
|
| 322 |
+
| 0.3234 | 3200 | 0.5996 |
|
| 323 |
+
| 0.3437 | 3400 | 0.5933 |
|
| 324 |
+
| 0.3639 | 3600 | 0.5846 |
|
| 325 |
+
| 0.3841 | 3800 | 0.5783 |
|
| 326 |
+
| 0.4043 | 4000 | 0.5907 |
|
| 327 |
+
| 0.4245 | 4200 | 0.5669 |
|
| 328 |
+
| 0.4447 | 4400 | 0.5768 |
|
| 329 |
+
| 0.4650 | 4600 | 0.5507 |
|
| 330 |
+
| 0.4852 | 4800 | 0.5403 |
|
| 331 |
+
| 0.5054 | 5000 | 0.5372 |
|
| 332 |
+
| 0.5256 | 5200 | 0.5382 |
|
| 333 |
+
| 0.5458 | 5400 | 0.5308 |
|
| 334 |
+
| 0.5660 | 5600 | 0.5453 |
|
| 335 |
+
| 0.5862 | 5800 | 0.5218 |
|
| 336 |
+
| 0.6065 | 6000 | 0.5058 |
|
| 337 |
+
| 0.6267 | 6200 | 0.5229 |
|
| 338 |
+
| 0.6469 | 6400 | 0.5245 |
|
| 339 |
+
| 0.6671 | 6600 | 0.5115 |
|
| 340 |
+
| 0.6873 | 6800 | 0.5023 |
|
| 341 |
+
| 0.7075 | 7000 | 0.5049 |
|
| 342 |
+
| 0.7278 | 7200 | 0.5155 |
|
| 343 |
+
| 0.7480 | 7400 | 0.4976 |
|
| 344 |
+
| 0.7682 | 7600 | 0.4965 |
|
| 345 |
+
| 0.7884 | 7800 | 0.4968 |
|
| 346 |
+
| 0.8086 | 8000 | 0.4950 |
|
| 347 |
+
| 0.8288 | 8200 | 0.4889 |
|
| 348 |
+
| 0.8490 | 8400 | 0.4918 |
|
| 349 |
+
| 0.8693 | 8600 | 0.4870 |
|
| 350 |
+
| 0.8895 | 8800 | 0.4723 |
|
| 351 |
+
| 0.9097 | 9000 | 0.4808 |
|
| 352 |
+
| 0.9299 | 9200 | 0.4791 |
|
| 353 |
+
| 0.9501 | 9400 | 0.4829 |
|
| 354 |
+
| 0.9703 | 9600 | 0.4654 |
|
| 355 |
+
| 0.9905 | 9800 | 0.4931 |
|
| 356 |
+
|
| 357 |
+
|
| 358 |
+
### Training Time
|
| 359 |
+
- **Training**: 37.1 minutes
|
| 360 |
+
|
| 361 |
+
### Framework Versions
|
| 362 |
+
- Python: 3.11.12
|
| 363 |
+
- Sentence Transformers: 5.6.0
|
| 364 |
+
- Transformers: 5.12.1
|
| 365 |
+
- PyTorch: 2.7.0+cu128
|
| 366 |
+
- Accelerate: 1.14.0
|
| 367 |
+
- Datasets: 5.0.0
|
| 368 |
+
- Tokenizers: 0.22.2
|
| 369 |
+
|
| 370 |
+
## Additional Resources
|
| 371 |
+
|
| 372 |
+
- [Training and Finetuning Sparse Embedding Models with Sentence Transformers](https://huggingface.co/blog/train-sparse-encoder): the end-to-end guide for training or finetuning SPLADE and other sparse encoder models.
|
| 373 |
+
|
| 374 |
+
## Citation
|
| 375 |
+
|
| 376 |
+
### BibTeX
|
| 377 |
+
|
| 378 |
+
#### Sentence Transformers
|
| 379 |
+
```bibtex
|
| 380 |
+
@inproceedings{reimers-2019-sentence-bert,
|
| 381 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
| 382 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
| 383 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
| 384 |
+
month = "11",
|
| 385 |
+
year = "2019",
|
| 386 |
+
publisher = "Association for Computational Linguistics",
|
| 387 |
+
url = "https://arxiv.org/abs/1908.10084",
|
| 388 |
+
}
|
| 389 |
+
```
|
| 390 |
+
|
| 391 |
+
#### SpladeLoss
|
| 392 |
+
```bibtex
|
| 393 |
+
@misc{formal2022distillationhardnegativesampling,
|
| 394 |
+
title={From Distillation to Hard Negative Sampling: Making Sparse Neural IR Models More Effective},
|
| 395 |
+
author={Thibault Formal and Carlos Lassance and Benjamin Piwowarski and Stéphane Clinchant},
|
| 396 |
+
year={2022},
|
| 397 |
+
eprint={2205.04733},
|
| 398 |
+
archivePrefix={arXiv},
|
| 399 |
+
primaryClass={cs.IR},
|
| 400 |
+
url={https://arxiv.org/abs/2205.04733},
|
| 401 |
+
}
|
| 402 |
+
```
|
| 403 |
+
|
| 404 |
+
#### SparseMultipleNegativesRankingLoss
|
| 405 |
+
```bibtex
|
| 406 |
+
@misc{oord2019representationlearningcontrastivepredictive,
|
| 407 |
+
title={Representation Learning with Contrastive Predictive Coding},
|
| 408 |
+
author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
|
| 409 |
+
year={2019},
|
| 410 |
+
eprint={1807.03748},
|
| 411 |
+
archivePrefix={arXiv},
|
| 412 |
+
primaryClass={cs.LG},
|
| 413 |
+
url={https://arxiv.org/abs/1807.03748},
|
| 414 |
+
}
|
| 415 |
+
```
|
| 416 |
+
|
| 417 |
+
#### FlopsLoss
|
| 418 |
+
```bibtex
|
| 419 |
+
@article{paria2020minimizing,
|
| 420 |
+
title={Minimizing flops to learn efficient sparse representations},
|
| 421 |
+
author={Paria, Biswajit and Yeh, Chih-Kuan and Yen, Ian EH and Xu, Ning and Ravikumar, Pradeep and P{'o}czos, Barnab{'a}s},
|
| 422 |
+
journal={arXiv preprint arXiv:2004.05665},
|
| 423 |
+
year={2020}
|
| 424 |
+
}
|
| 425 |
+
```
|
| 426 |
+
|
| 427 |
+
<!--
|
| 428 |
+
## Glossary
|
| 429 |
+
|
| 430 |
+
*Clearly define terms in order to be accessible across audiences.*
|
| 431 |
+
-->
|
| 432 |
+
|
| 433 |
+
<!--
|
| 434 |
+
## Model Card Authors
|
| 435 |
+
|
| 436 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
| 437 |
+
-->
|
| 438 |
+
|
| 439 |
+
<!--
|
| 440 |
+
## Model Card Contact
|
| 441 |
+
|
| 442 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
| 443 |
+
-->
|
splade_v4/config.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation": "gelu",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"DistilBertForMaskedLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_dropout": 0.1,
|
| 7 |
+
"bos_token_id": null,
|
| 8 |
+
"dim": 768,
|
| 9 |
+
"dropout": 0.1,
|
| 10 |
+
"dtype": "float32",
|
| 11 |
+
"eos_token_id": null,
|
| 12 |
+
"hidden_dim": 3072,
|
| 13 |
+
"initializer_range": 0.02,
|
| 14 |
+
"max_position_embeddings": 512,
|
| 15 |
+
"model_type": "distilbert",
|
| 16 |
+
"n_heads": 12,
|
| 17 |
+
"n_layers": 6,
|
| 18 |
+
"output_past": true,
|
| 19 |
+
"pad_token_id": 0,
|
| 20 |
+
"qa_dropout": 0.1,
|
| 21 |
+
"seq_classif_dropout": 0.2,
|
| 22 |
+
"sinusoidal_pos_embds": false,
|
| 23 |
+
"tie_weights_": true,
|
| 24 |
+
"tie_word_embeddings": true,
|
| 25 |
+
"transformers_version": "5.12.1",
|
| 26 |
+
"use_cache": false,
|
| 27 |
+
"vocab_size": 119547
|
| 28 |
+
}
|
splade_v4/config_sentence_transformers.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"__version__": {
|
| 3 |
+
"pytorch": "2.7.0+cu128",
|
| 4 |
+
"sentence_transformers": "5.6.0",
|
| 5 |
+
"transformers": "5.12.1"
|
| 6 |
+
},
|
| 7 |
+
"default_prompt_name": null,
|
| 8 |
+
"model_type": "SparseEncoder",
|
| 9 |
+
"prompts": {
|
| 10 |
+
"document": "",
|
| 11 |
+
"query": ""
|
| 12 |
+
},
|
| 13 |
+
"similarity_fn_name": null
|
| 14 |
+
}
|
splade_v4/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d9d6772d1f7cb5b61ab380c7cc3a917e3efd0fe8a70898cc207410e8fae9c8ac
|
| 3 |
+
size 541795684
|
splade_v4/modules.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"idx": 0,
|
| 4 |
+
"name": "0",
|
| 5 |
+
"path": "",
|
| 6 |
+
"type": "sentence_transformers.sparse_encoder.modules.mlm_transformer.MLMTransformer"
|
| 7 |
+
},
|
| 8 |
+
{
|
| 9 |
+
"idx": 1,
|
| 10 |
+
"name": "1",
|
| 11 |
+
"path": "1_SpladePooling",
|
| 12 |
+
"type": "sentence_transformers.sparse_encoder.modules.splade_pooling.SpladePooling"
|
| 13 |
+
}
|
| 14 |
+
]
|
splade_v4/sentence_bert_config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"transformer_task": "fill-mask",
|
| 3 |
+
"modality_config": {
|
| 4 |
+
"text": {
|
| 5 |
+
"method": "forward",
|
| 6 |
+
"method_output_name": "logits"
|
| 7 |
+
}
|
| 8 |
+
},
|
| 9 |
+
"module_output_name": "token_embeddings"
|
| 10 |
+
}
|
splade_v4/tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
splade_v4/tokenizer_config.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"cls_token": "[CLS]",
|
| 4 |
+
"do_lower_case": false,
|
| 5 |
+
"is_local": false,
|
| 6 |
+
"local_files_only": false,
|
| 7 |
+
"mask_token": "[MASK]",
|
| 8 |
+
"model_max_length": 128,
|
| 9 |
+
"pad_token": "[PAD]",
|
| 10 |
+
"sep_token": "[SEP]",
|
| 11 |
+
"strip_accents": null,
|
| 12 |
+
"tokenize_chinese_chars": true,
|
| 13 |
+
"tokenizer_class": "BertTokenizer",
|
| 14 |
+
"unk_token": "[UNK]"
|
| 15 |
+
}
|