Sentence Similarity
sentence-transformers
Safetensors
bert
feature-extraction
dense
Generated from Trainer
dataset_size:4096000
loss:MultipleNegativesRankingLoss
Eval Results (legacy)
text-embeddings-inference
Instructions to use seanfarrell/icd11_ner_model_small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use seanfarrell/icd11_ner_model_small with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("seanfarrell/icd11_ner_model_small") sentences = [ "vascular disorders of the stomach", "vascular disorders of the stomach, unspecified", "ringworm of the hand", "anogenital herpes" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Add new SentenceTransformer model
Browse files- 1_Pooling/config.json +5 -0
- README.md +632 -0
- config.json +35 -0
- config_sentence_transformers.json +14 -0
- model.safetensors +3 -0
- modules.json +20 -0
- sentence_bert_config.json +10 -0
- tokenizer.json +0 -0
- tokenizer_config.json +25 -0
1_Pooling/config.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"embedding_dimension": 384,
|
| 3 |
+
"pooling_mode": "cls",
|
| 4 |
+
"include_prompt": true
|
| 5 |
+
}
|
README.md
ADDED
|
@@ -0,0 +1,632 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- sentence-transformers
|
| 4 |
+
- sentence-similarity
|
| 5 |
+
- feature-extraction
|
| 6 |
+
- dense
|
| 7 |
+
- generated_from_trainer
|
| 8 |
+
- dataset_size:4096000
|
| 9 |
+
- loss:MultipleNegativesRankingLoss
|
| 10 |
+
base_model: BAAI/bge-small-en-v1.5
|
| 11 |
+
widget:
|
| 12 |
+
- source_sentence: vascular disorders of the stomach
|
| 13 |
+
sentences:
|
| 14 |
+
- vascular disorders of the stomach, unspecified
|
| 15 |
+
- ringworm of the hand
|
| 16 |
+
- anogenital herpes
|
| 17 |
+
- source_sentence: neonatal malabsorption secondary to defect in carbohydrate metabolism
|
| 18 |
+
sentences:
|
| 19 |
+
- overfeeding problem of newborn
|
| 20 |
+
- other specified neonatal malabsorption syndromes
|
| 21 |
+
- bronchial asthma
|
| 22 |
+
- source_sentence: white matter disorder due to carbon monoxide toxicity
|
| 23 |
+
sentences:
|
| 24 |
+
- white matter disorder due to nitrous oxide toxicity
|
| 25 |
+
- neonatal dehydration
|
| 26 |
+
- moerman lethal chondrodysplasia
|
| 27 |
+
- source_sentence: chronic myelogenous leukaemia, bcr-abl1-positive in complete remission
|
| 28 |
+
sentences:
|
| 29 |
+
- chronic myeloid leukaemia, bcr-abl-positive in complete remission
|
| 30 |
+
- lesion of sciatic nerve
|
| 31 |
+
- tooth injury
|
| 32 |
+
- source_sentence: metabolic or transporter liver disease, unspecified
|
| 33 |
+
sentences:
|
| 34 |
+
- metabolic or transporter liver disease
|
| 35 |
+
- staphyloma of cornea
|
| 36 |
+
- spontaneous rupture of synovium or tendon, unspecified
|
| 37 |
+
pipeline_tag: sentence-similarity
|
| 38 |
+
library_name: sentence-transformers
|
| 39 |
+
metrics:
|
| 40 |
+
- cosine_accuracy@1
|
| 41 |
+
- cosine_accuracy@5
|
| 42 |
+
- cosine_accuracy@10
|
| 43 |
+
- cosine_precision@1
|
| 44 |
+
- cosine_precision@3
|
| 45 |
+
- cosine_precision@5
|
| 46 |
+
- cosine_precision@10
|
| 47 |
+
- cosine_recall@1
|
| 48 |
+
- cosine_recall@3
|
| 49 |
+
- cosine_recall@5
|
| 50 |
+
- cosine_recall@10
|
| 51 |
+
- cosine_ndcg@10
|
| 52 |
+
- cosine_mrr@10
|
| 53 |
+
- cosine_map@10
|
| 54 |
+
model-index:
|
| 55 |
+
- name: SentenceTransformer based on BAAI/bge-small-en-v1.5
|
| 56 |
+
results:
|
| 57 |
+
- task:
|
| 58 |
+
type: information-retrieval
|
| 59 |
+
name: Information Retrieval
|
| 60 |
+
dataset:
|
| 61 |
+
name: icd11 val
|
| 62 |
+
type: icd11-val
|
| 63 |
+
metrics:
|
| 64 |
+
- type: cosine_accuracy@1
|
| 65 |
+
value: 0.7478448275862069
|
| 66 |
+
name: Cosine Accuracy@1
|
| 67 |
+
- type: cosine_accuracy@5
|
| 68 |
+
value: 0.8717672413793104
|
| 69 |
+
name: Cosine Accuracy@5
|
| 70 |
+
- type: cosine_accuracy@10
|
| 71 |
+
value: 0.896551724137931
|
| 72 |
+
name: Cosine Accuracy@10
|
| 73 |
+
- type: cosine_precision@1
|
| 74 |
+
value: 0.7478448275862069
|
| 75 |
+
name: Cosine Precision@1
|
| 76 |
+
- type: cosine_precision@3
|
| 77 |
+
value: 0.6253591954022988
|
| 78 |
+
name: Cosine Precision@3
|
| 79 |
+
- type: cosine_precision@5
|
| 80 |
+
value: 0.5258620689655173
|
| 81 |
+
name: Cosine Precision@5
|
| 82 |
+
- type: cosine_precision@10
|
| 83 |
+
value: 0.3786637931034483
|
| 84 |
+
name: Cosine Precision@10
|
| 85 |
+
- type: cosine_recall@1
|
| 86 |
+
value: 0.1588556265383415
|
| 87 |
+
name: Cosine Recall@1
|
| 88 |
+
- type: cosine_recall@3
|
| 89 |
+
value: 0.37728305808648516
|
| 90 |
+
name: Cosine Recall@3
|
| 91 |
+
- type: cosine_recall@5
|
| 92 |
+
value: 0.4796248471294223
|
| 93 |
+
name: Cosine Recall@5
|
| 94 |
+
- type: cosine_recall@10
|
| 95 |
+
value: 0.6031417673743621
|
| 96 |
+
name: Cosine Recall@10
|
| 97 |
+
- type: cosine_ndcg@10
|
| 98 |
+
value: 0.6649315033350626
|
| 99 |
+
name: Cosine Ndcg@10
|
| 100 |
+
- type: cosine_mrr@10
|
| 101 |
+
value: 0.8006516830870286
|
| 102 |
+
name: Cosine Mrr@10
|
| 103 |
+
- type: cosine_map@10
|
| 104 |
+
value: 0.5745241229374094
|
| 105 |
+
name: Cosine Map@10
|
| 106 |
+
---
|
| 107 |
+
|
| 108 |
+
# SentenceTransformer based on BAAI/bge-small-en-v1.5
|
| 109 |
+
|
| 110 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [BAAI/bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5). It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, classification, clustering, and more.
|
| 111 |
+
|
| 112 |
+
## Model Details
|
| 113 |
+
|
| 114 |
+
### Model Description
|
| 115 |
+
- **Model Type:** Sentence Transformer
|
| 116 |
+
- **Base model:** [BAAI/bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5) <!-- at revision 5c38ec7c405ec4b44b94cc5a9bb96e735b38267a -->
|
| 117 |
+
- **Maximum Sequence Length:** 30 tokens
|
| 118 |
+
- **Output Dimensionality:** 384 dimensions
|
| 119 |
+
- **Similarity Function:** Cosine Similarity
|
| 120 |
+
- **Supported Modality:** Text
|
| 121 |
+
<!-- - **Training Dataset:** Unknown -->
|
| 122 |
+
<!-- - **Language:** Unknown -->
|
| 123 |
+
<!-- - **License:** Unknown -->
|
| 124 |
+
|
| 125 |
+
### Model Sources
|
| 126 |
+
|
| 127 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
| 128 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
|
| 129 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
| 130 |
+
|
| 131 |
+
### Full Model Architecture
|
| 132 |
+
|
| 133 |
+
```
|
| 134 |
+
SentenceTransformer(
|
| 135 |
+
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'BertModel'})
|
| 136 |
+
(1): Pooling({'embedding_dimension': 384, 'pooling_mode': 'cls', 'include_prompt': True})
|
| 137 |
+
(2): Normalize({})
|
| 138 |
+
)
|
| 139 |
+
```
|
| 140 |
+
|
| 141 |
+
## Usage
|
| 142 |
+
|
| 143 |
+
### Direct Usage (Sentence Transformers)
|
| 144 |
+
|
| 145 |
+
First install the Sentence Transformers library:
|
| 146 |
+
|
| 147 |
+
```bash
|
| 148 |
+
pip install -U sentence-transformers
|
| 149 |
+
```
|
| 150 |
+
Then you can load this model and run inference.
|
| 151 |
+
```python
|
| 152 |
+
from sentence_transformers import SentenceTransformer
|
| 153 |
+
|
| 154 |
+
# Download from the 🤗 Hub
|
| 155 |
+
model = SentenceTransformer("seanfarrell/icd11_ner_model_small")
|
| 156 |
+
# Run inference
|
| 157 |
+
queries = [
|
| 158 |
+
'metabolic or transporter liver disease, unspecified',
|
| 159 |
+
]
|
| 160 |
+
documents = [
|
| 161 |
+
'metabolic or transporter liver disease',
|
| 162 |
+
'spontaneous rupture of synovium or tendon, unspecified',
|
| 163 |
+
'staphyloma of cornea',
|
| 164 |
+
]
|
| 165 |
+
query_embeddings = model.encode_query(queries)
|
| 166 |
+
document_embeddings = model.encode_document(documents)
|
| 167 |
+
print(query_embeddings.shape, document_embeddings.shape)
|
| 168 |
+
# [1, 384] [3, 384]
|
| 169 |
+
|
| 170 |
+
# Get the similarity scores for the embeddings
|
| 171 |
+
similarities = model.similarity(query_embeddings, document_embeddings)
|
| 172 |
+
print(similarities)
|
| 173 |
+
# tensor([[ 0.9840, -0.1296, -0.1292]])
|
| 174 |
+
```
|
| 175 |
+
<!--
|
| 176 |
+
### Direct Usage (Transformers)
|
| 177 |
+
|
| 178 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
| 179 |
+
|
| 180 |
+
</details>
|
| 181 |
+
-->
|
| 182 |
+
|
| 183 |
+
<!--
|
| 184 |
+
### Downstream Usage (Sentence Transformers)
|
| 185 |
+
|
| 186 |
+
You can finetune this model on your own dataset.
|
| 187 |
+
|
| 188 |
+
<details><summary>Click to expand</summary>
|
| 189 |
+
|
| 190 |
+
</details>
|
| 191 |
+
-->
|
| 192 |
+
|
| 193 |
+
<!--
|
| 194 |
+
### Out-of-Scope Use
|
| 195 |
+
|
| 196 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
| 197 |
+
-->
|
| 198 |
+
|
| 199 |
+
## Evaluation
|
| 200 |
+
|
| 201 |
+
### Metrics
|
| 202 |
+
|
| 203 |
+
#### Information Retrieval
|
| 204 |
+
|
| 205 |
+
* Dataset: `icd11-val`
|
| 206 |
+
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.sentence_transformer.evaluation.InformationRetrievalEvaluator)
|
| 207 |
+
|
| 208 |
+
| Metric | Value |
|
| 209 |
+
|:--------------------|:-----------|
|
| 210 |
+
| cosine_accuracy@1 | 0.7478 |
|
| 211 |
+
| cosine_accuracy@5 | 0.8718 |
|
| 212 |
+
| cosine_accuracy@10 | 0.8966 |
|
| 213 |
+
| cosine_precision@1 | 0.7478 |
|
| 214 |
+
| cosine_precision@3 | 0.6254 |
|
| 215 |
+
| cosine_precision@5 | 0.5259 |
|
| 216 |
+
| cosine_precision@10 | 0.3787 |
|
| 217 |
+
| cosine_recall@1 | 0.1589 |
|
| 218 |
+
| cosine_recall@3 | 0.3773 |
|
| 219 |
+
| cosine_recall@5 | 0.4796 |
|
| 220 |
+
| cosine_recall@10 | 0.6031 |
|
| 221 |
+
| **cosine_ndcg@10** | **0.6649** |
|
| 222 |
+
| cosine_mrr@10 | 0.8007 |
|
| 223 |
+
| cosine_map@10 | 0.5745 |
|
| 224 |
+
|
| 225 |
+
<!--
|
| 226 |
+
## Bias, Risks and Limitations
|
| 227 |
+
|
| 228 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
| 229 |
+
-->
|
| 230 |
+
|
| 231 |
+
<!--
|
| 232 |
+
### Recommendations
|
| 233 |
+
|
| 234 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
| 235 |
+
-->
|
| 236 |
+
|
| 237 |
+
## Training Details
|
| 238 |
+
|
| 239 |
+
### Training Dataset
|
| 240 |
+
|
| 241 |
+
#### Unnamed Dataset
|
| 242 |
+
|
| 243 |
+
* Size: 4,096,000 training samples
|
| 244 |
+
* Columns: <code>anchor</code> and <code>positive</code>
|
| 245 |
+
* Approximate statistics based on the first 100 samples:
|
| 246 |
+
| | anchor | positive |
|
| 247 |
+
|:---------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
|
| 248 |
+
| type | string | string |
|
| 249 |
+
| modality | text | text |
|
| 250 |
+
| details | <ul><li>min: 4 tokens</li><li>mean: 11.07 tokens</li><li>max: 30 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 11.07 tokens</li><li>max: 28 tokens</li></ul> |
|
| 251 |
+
* Samples:
|
| 252 |
+
| anchor | positive |
|
| 253 |
+
|:-------------------------------------------------------------|:-----------------------------------------------------------------|
|
| 254 |
+
| <code>duodenal adenoma in familial polyposis</code> | <code>benign duodenal neoplasm</code> |
|
| 255 |
+
| <code>congenital unilateral hip dislocation</code> | <code>developmental dysplasia of hip, unilateral</code> |
|
| 256 |
+
| <code>postprocedural pulmonary arterial tree disorder</code> | <code>postprocedural pulmonary arterial tree complication</code> |
|
| 257 |
+
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
|
| 258 |
+
```json
|
| 259 |
+
{
|
| 260 |
+
"scale": 20.0,
|
| 261 |
+
"similarity_fct": "cos_sim",
|
| 262 |
+
"gather_across_devices": false,
|
| 263 |
+
"directions": [
|
| 264 |
+
"query_to_doc"
|
| 265 |
+
],
|
| 266 |
+
"partition_mode": "joint",
|
| 267 |
+
"hardness_mode": null,
|
| 268 |
+
"hardness_strength": 0.0
|
| 269 |
+
}
|
| 270 |
+
```
|
| 271 |
+
|
| 272 |
+
### Training Hyperparameters
|
| 273 |
+
#### Non-Default Hyperparameters
|
| 274 |
+
|
| 275 |
+
- `per_device_train_batch_size`: 512
|
| 276 |
+
- `num_train_epochs`: 1
|
| 277 |
+
- `learning_rate`: 2e-05
|
| 278 |
+
- `lr_scheduler_type`: cosine
|
| 279 |
+
- `warmup_steps`: 800
|
| 280 |
+
- `weight_decay`: 0.01
|
| 281 |
+
- `bf16`: True
|
| 282 |
+
- `per_device_eval_batch_size`: 256
|
| 283 |
+
- `eval_on_start`: True
|
| 284 |
+
- `load_best_model_at_end`: True
|
| 285 |
+
- `dataloader_drop_last`: True
|
| 286 |
+
|
| 287 |
+
#### All Hyperparameters
|
| 288 |
+
<details><summary>Click to expand</summary>
|
| 289 |
+
|
| 290 |
+
- `per_device_train_batch_size`: 512
|
| 291 |
+
- `num_train_epochs`: 1
|
| 292 |
+
- `max_steps`: -1
|
| 293 |
+
- `learning_rate`: 2e-05
|
| 294 |
+
- `lr_scheduler_type`: cosine
|
| 295 |
+
- `lr_scheduler_kwargs`: None
|
| 296 |
+
- `warmup_steps`: 800
|
| 297 |
+
- `optim`: adamw_torch_fused
|
| 298 |
+
- `optim_args`: None
|
| 299 |
+
- `weight_decay`: 0.01
|
| 300 |
+
- `adam_beta1`: 0.9
|
| 301 |
+
- `adam_beta2`: 0.999
|
| 302 |
+
- `adam_epsilon`: 1e-08
|
| 303 |
+
- `optim_target_modules`: None
|
| 304 |
+
- `gradient_accumulation_steps`: 1
|
| 305 |
+
- `average_tokens_across_devices`: True
|
| 306 |
+
- `max_grad_norm`: 1.0
|
| 307 |
+
- `label_smoothing_factor`: 0.0
|
| 308 |
+
- `bf16`: True
|
| 309 |
+
- `fp16`: False
|
| 310 |
+
- `bf16_full_eval`: False
|
| 311 |
+
- `fp16_full_eval`: False
|
| 312 |
+
- `tf32`: None
|
| 313 |
+
- `gradient_checkpointing`: False
|
| 314 |
+
- `gradient_checkpointing_kwargs`: None
|
| 315 |
+
- `torch_compile`: False
|
| 316 |
+
- `torch_compile_backend`: None
|
| 317 |
+
- `torch_compile_mode`: None
|
| 318 |
+
- `use_liger_kernel`: False
|
| 319 |
+
- `liger_kernel_config`: None
|
| 320 |
+
- `use_cache`: False
|
| 321 |
+
- `neftune_noise_alpha`: None
|
| 322 |
+
- `torch_empty_cache_steps`: None
|
| 323 |
+
- `auto_find_batch_size`: False
|
| 324 |
+
- `log_on_each_node`: True
|
| 325 |
+
- `logging_nan_inf_filter`: True
|
| 326 |
+
- `include_num_input_tokens_seen`: no
|
| 327 |
+
- `log_level`: passive
|
| 328 |
+
- `log_level_replica`: warning
|
| 329 |
+
- `disable_tqdm`: False
|
| 330 |
+
- `project`: huggingface
|
| 331 |
+
- `trackio_space_id`: None
|
| 332 |
+
- `trackio_bucket_id`: None
|
| 333 |
+
- `trackio_static_space_id`: None
|
| 334 |
+
- `per_device_eval_batch_size`: 256
|
| 335 |
+
- `prediction_loss_only`: True
|
| 336 |
+
- `eval_on_start`: True
|
| 337 |
+
- `eval_do_concat_batches`: True
|
| 338 |
+
- `eval_use_gather_object`: False
|
| 339 |
+
- `eval_accumulation_steps`: None
|
| 340 |
+
- `include_for_metrics`: []
|
| 341 |
+
- `batch_eval_metrics`: False
|
| 342 |
+
- `save_only_model`: False
|
| 343 |
+
- `save_on_each_node`: False
|
| 344 |
+
- `enable_jit_checkpoint`: False
|
| 345 |
+
- `push_to_hub`: False
|
| 346 |
+
- `hub_private_repo`: None
|
| 347 |
+
- `hub_model_id`: None
|
| 348 |
+
- `hub_strategy`: every_save
|
| 349 |
+
- `hub_always_push`: False
|
| 350 |
+
- `hub_revision`: None
|
| 351 |
+
- `load_best_model_at_end`: True
|
| 352 |
+
- `ignore_data_skip`: False
|
| 353 |
+
- `restore_callback_states_from_checkpoint`: False
|
| 354 |
+
- `full_determinism`: False
|
| 355 |
+
- `seed`: 42
|
| 356 |
+
- `data_seed`: None
|
| 357 |
+
- `use_cpu`: False
|
| 358 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
| 359 |
+
- `parallelism_config`: None
|
| 360 |
+
- `dataloader_drop_last`: True
|
| 361 |
+
- `dataloader_num_workers`: 0
|
| 362 |
+
- `dataloader_pin_memory`: True
|
| 363 |
+
- `dataloader_persistent_workers`: False
|
| 364 |
+
- `dataloader_prefetch_factor`: None
|
| 365 |
+
- `dataloader_multiprocessing_context`: None
|
| 366 |
+
- `dataloader_in_order`: True
|
| 367 |
+
- `remove_unused_columns`: True
|
| 368 |
+
- `label_names`: None
|
| 369 |
+
- `train_sampling_strategy`: random
|
| 370 |
+
- `length_column_name`: length
|
| 371 |
+
- `ddp_find_unused_parameters`: None
|
| 372 |
+
- `ddp_bucket_cap_mb`: None
|
| 373 |
+
- `ddp_broadcast_buffers`: False
|
| 374 |
+
- `ddp_static_graph`: None
|
| 375 |
+
- `ddp_backend`: None
|
| 376 |
+
- `ddp_timeout`: 1800
|
| 377 |
+
- `fsdp`: None
|
| 378 |
+
- `fsdp_config`: None
|
| 379 |
+
- `deepspeed`: None
|
| 380 |
+
- `debug`: []
|
| 381 |
+
- `skip_memory_metrics`: True
|
| 382 |
+
- `do_predict`: False
|
| 383 |
+
- `resume_from_checkpoint`: None
|
| 384 |
+
- `local_rank`: -1
|
| 385 |
+
- `prompts`: None
|
| 386 |
+
- `batch_sampler`: batch_sampler
|
| 387 |
+
- `multi_dataset_batch_sampler`: proportional
|
| 388 |
+
- `router_mapping`: {}
|
| 389 |
+
- `learning_rate_mapping`: {}
|
| 390 |
+
- `warmup_ratio`: None
|
| 391 |
+
|
| 392 |
+
</details>
|
| 393 |
+
|
| 394 |
+
### Training Logs
|
| 395 |
+
<details><summary>Click to expand</summary>
|
| 396 |
+
|
| 397 |
+
| Epoch | Step | Training Loss | icd11-val_cosine_ndcg@10 |
|
| 398 |
+
|:----------:|:--------:|:-------------:|:------------------------:|
|
| 399 |
+
| 0 | 0 | - | 0.4871 |
|
| 400 |
+
| 0.0063 | 50 | 2.5057 | - |
|
| 401 |
+
| 0.0125 | 100 | 2.1921 | - |
|
| 402 |
+
| 0.0187 | 150 | 1.6707 | - |
|
| 403 |
+
| 0.025 | 200 | 1.4270 | - |
|
| 404 |
+
| 0.0312 | 250 | 1.3379 | - |
|
| 405 |
+
| 0.0375 | 300 | 1.2811 | - |
|
| 406 |
+
| 0.0437 | 350 | 1.2222 | - |
|
| 407 |
+
| 0.05 | 400 | 1.1848 | - |
|
| 408 |
+
| 0.0563 | 450 | 1.1484 | - |
|
| 409 |
+
| 0.0625 | 500 | 1.1260 | 0.5411 |
|
| 410 |
+
| 0.0688 | 550 | 1.0856 | - |
|
| 411 |
+
| 0.075 | 600 | 1.0654 | - |
|
| 412 |
+
| 0.0813 | 650 | 1.0247 | - |
|
| 413 |
+
| 0.0875 | 700 | 1.0050 | - |
|
| 414 |
+
| 0.0938 | 750 | 0.9669 | - |
|
| 415 |
+
| 0.1 | 800 | 0.9515 | - |
|
| 416 |
+
| 0.1062 | 850 | 0.9404 | - |
|
| 417 |
+
| 0.1125 | 900 | 0.8906 | - |
|
| 418 |
+
| 0.1187 | 950 | 0.8692 | - |
|
| 419 |
+
| 0.125 | 1000 | 0.8413 | 0.5746 |
|
| 420 |
+
| 0.1313 | 1050 | 0.8439 | - |
|
| 421 |
+
| 0.1375 | 1100 | 0.8270 | - |
|
| 422 |
+
| 0.1437 | 1150 | 0.8128 | - |
|
| 423 |
+
| 0.15 | 1200 | 0.7762 | - |
|
| 424 |
+
| 0.1562 | 1250 | 0.7666 | - |
|
| 425 |
+
| 0.1625 | 1300 | 0.7555 | - |
|
| 426 |
+
| 0.1688 | 1350 | 0.7562 | - |
|
| 427 |
+
| 0.175 | 1400 | 0.7180 | - |
|
| 428 |
+
| 0.1812 | 1450 | 0.6945 | - |
|
| 429 |
+
| 0.1875 | 1500 | 0.7032 | 0.6002 |
|
| 430 |
+
| 0.1938 | 1550 | 0.6747 | - |
|
| 431 |
+
| 0.2 | 1600 | 0.6729 | - |
|
| 432 |
+
| 0.2062 | 1650 | 0.6604 | - |
|
| 433 |
+
| 0.2125 | 1700 | 0.6644 | - |
|
| 434 |
+
| 0.2188 | 1750 | 0.6556 | - |
|
| 435 |
+
| 0.225 | 1800 | 0.6440 | - |
|
| 436 |
+
| 0.2313 | 1850 | 0.6284 | - |
|
| 437 |
+
| 0.2375 | 1900 | 0.6105 | - |
|
| 438 |
+
| 0.2437 | 1950 | 0.5935 | - |
|
| 439 |
+
| 0.25 | 2000 | 0.5923 | 0.6120 |
|
| 440 |
+
| 0.2562 | 2050 | 0.5850 | - |
|
| 441 |
+
| 0.2625 | 2100 | 0.5787 | - |
|
| 442 |
+
| 0.2687 | 2150 | 0.5764 | - |
|
| 443 |
+
| 0.275 | 2200 | 0.5643 | - |
|
| 444 |
+
| 0.2812 | 2250 | 0.5655 | - |
|
| 445 |
+
| 0.2875 | 2300 | 0.5463 | - |
|
| 446 |
+
| 0.2938 | 2350 | 0.5414 | - |
|
| 447 |
+
| 0.3 | 2400 | 0.5368 | - |
|
| 448 |
+
| 0.3063 | 2450 | 0.5236 | - |
|
| 449 |
+
| 0.3125 | 2500 | 0.5109 | 0.6230 |
|
| 450 |
+
| 0.3187 | 2550 | 0.5308 | - |
|
| 451 |
+
| 0.325 | 2600 | 0.5000 | - |
|
| 452 |
+
| 0.3312 | 2650 | 0.5069 | - |
|
| 453 |
+
| 0.3375 | 2700 | 0.5120 | - |
|
| 454 |
+
| 0.3438 | 2750 | 0.4853 | - |
|
| 455 |
+
| 0.35 | 2800 | 0.4877 | - |
|
| 456 |
+
| 0.3563 | 2850 | 0.4786 | - |
|
| 457 |
+
| 0.3625 | 2900 | 0.4869 | - |
|
| 458 |
+
| 0.3688 | 2950 | 0.4865 | - |
|
| 459 |
+
| 0.375 | 3000 | 0.4561 | 0.6332 |
|
| 460 |
+
| 0.3812 | 3050 | 0.4640 | - |
|
| 461 |
+
| 0.3875 | 3100 | 0.4629 | - |
|
| 462 |
+
| 0.3937 | 3150 | 0.4575 | - |
|
| 463 |
+
| 0.4 | 3200 | 0.4493 | - |
|
| 464 |
+
| 0.4062 | 3250 | 0.4503 | - |
|
| 465 |
+
| 0.4125 | 3300 | 0.4301 | - |
|
| 466 |
+
| 0.4188 | 3350 | 0.4410 | - |
|
| 467 |
+
| 0.425 | 3400 | 0.4415 | - |
|
| 468 |
+
| 0.4313 | 3450 | 0.4316 | - |
|
| 469 |
+
| 0.4375 | 3500 | 0.4359 | 0.6441 |
|
| 470 |
+
| 0.4437 | 3550 | 0.4147 | - |
|
| 471 |
+
| 0.45 | 3600 | 0.4028 | - |
|
| 472 |
+
| 0.4562 | 3650 | 0.4002 | - |
|
| 473 |
+
| 0.4625 | 3700 | 0.4132 | - |
|
| 474 |
+
| 0.4688 | 3750 | 0.4021 | - |
|
| 475 |
+
| 0.475 | 3800 | 0.4058 | - |
|
| 476 |
+
| 0.4813 | 3850 | 0.4023 | - |
|
| 477 |
+
| 0.4875 | 3900 | 0.4038 | - |
|
| 478 |
+
| 0.4938 | 3950 | 0.4007 | - |
|
| 479 |
+
| 0.5 | 4000 | 0.3894 | 0.6501 |
|
| 480 |
+
| 0.5062 | 4050 | 0.3856 | - |
|
| 481 |
+
| 0.5125 | 4100 | 0.3879 | - |
|
| 482 |
+
| 0.5188 | 4150 | 0.3758 | - |
|
| 483 |
+
| 0.525 | 4200 | 0.3796 | - |
|
| 484 |
+
| 0.5312 | 4250 | 0.3890 | - |
|
| 485 |
+
| 0.5375 | 4300 | 0.3831 | - |
|
| 486 |
+
| 0.5437 | 4350 | 0.3806 | - |
|
| 487 |
+
| 0.55 | 4400 | 0.3781 | - |
|
| 488 |
+
| 0.5563 | 4450 | 0.3761 | - |
|
| 489 |
+
| 0.5625 | 4500 | 0.3723 | 0.6551 |
|
| 490 |
+
| 0.5687 | 4550 | 0.3603 | - |
|
| 491 |
+
| 0.575 | 4600 | 0.3595 | - |
|
| 492 |
+
| 0.5813 | 4650 | 0.3524 | - |
|
| 493 |
+
| 0.5875 | 4700 | 0.3695 | - |
|
| 494 |
+
| 0.5938 | 4750 | 0.3552 | - |
|
| 495 |
+
| 0.6 | 4800 | 0.3521 | - |
|
| 496 |
+
| 0.6062 | 4850 | 0.3459 | - |
|
| 497 |
+
| 0.6125 | 4900 | 0.3472 | - |
|
| 498 |
+
| 0.6188 | 4950 | 0.3511 | - |
|
| 499 |
+
| 0.625 | 5000 | 0.3537 | 0.6589 |
|
| 500 |
+
| 0.6312 | 5050 | 0.3490 | - |
|
| 501 |
+
| 0.6375 | 5100 | 0.3428 | - |
|
| 502 |
+
| 0.6438 | 5150 | 0.3492 | - |
|
| 503 |
+
| 0.65 | 5200 | 0.3471 | - |
|
| 504 |
+
| 0.6562 | 5250 | 0.3348 | - |
|
| 505 |
+
| 0.6625 | 5300 | 0.3404 | - |
|
| 506 |
+
| 0.6687 | 5350 | 0.3442 | - |
|
| 507 |
+
| 0.675 | 5400 | 0.3494 | - |
|
| 508 |
+
| 0.6813 | 5450 | 0.3306 | - |
|
| 509 |
+
| 0.6875 | 5500 | 0.3349 | 0.6598 |
|
| 510 |
+
| 0.6937 | 5550 | 0.3401 | - |
|
| 511 |
+
| 0.7 | 5600 | 0.3374 | - |
|
| 512 |
+
| 0.7063 | 5650 | 0.3306 | - |
|
| 513 |
+
| 0.7125 | 5700 | 0.3277 | - |
|
| 514 |
+
| 0.7188 | 5750 | 0.3274 | - |
|
| 515 |
+
| 0.725 | 5800 | 0.3318 | - |
|
| 516 |
+
| 0.7312 | 5850 | 0.3316 | - |
|
| 517 |
+
| 0.7375 | 5900 | 0.3273 | - |
|
| 518 |
+
| 0.7438 | 5950 | 0.3252 | - |
|
| 519 |
+
| 0.75 | 6000 | 0.3306 | 0.6636 |
|
| 520 |
+
| 0.7562 | 6050 | 0.3347 | - |
|
| 521 |
+
| 0.7625 | 6100 | 0.3186 | - |
|
| 522 |
+
| 0.7688 | 6150 | 0.3301 | - |
|
| 523 |
+
| 0.775 | 6200 | 0.3203 | - |
|
| 524 |
+
| 0.7812 | 6250 | 0.3234 | - |
|
| 525 |
+
| 0.7875 | 6300 | 0.3134 | - |
|
| 526 |
+
| 0.7937 | 6350 | 0.3175 | - |
|
| 527 |
+
| 0.8 | 6400 | 0.3312 | - |
|
| 528 |
+
| 0.8063 | 6450 | 0.3302 | - |
|
| 529 |
+
| 0.8125 | 6500 | 0.3189 | 0.6644 |
|
| 530 |
+
| 0.8187 | 6550 | 0.3191 | - |
|
| 531 |
+
| 0.825 | 6600 | 0.3265 | - |
|
| 532 |
+
| 0.8313 | 6650 | 0.3192 | - |
|
| 533 |
+
| 0.8375 | 6700 | 0.3111 | - |
|
| 534 |
+
| 0.8438 | 6750 | 0.3124 | - |
|
| 535 |
+
| 0.85 | 6800 | 0.3101 | - |
|
| 536 |
+
| 0.8562 | 6850 | 0.3188 | - |
|
| 537 |
+
| 0.8625 | 6900 | 0.3180 | - |
|
| 538 |
+
| 0.8688 | 6950 | 0.3153 | - |
|
| 539 |
+
| 0.875 | 7000 | 0.3159 | 0.6646 |
|
| 540 |
+
| 0.8812 | 7050 | 0.3132 | - |
|
| 541 |
+
| 0.8875 | 7100 | 0.3168 | - |
|
| 542 |
+
| 0.8938 | 7150 | 0.3227 | - |
|
| 543 |
+
| 0.9 | 7200 | 0.3121 | - |
|
| 544 |
+
| 0.9062 | 7250 | 0.3212 | - |
|
| 545 |
+
| 0.9125 | 7300 | 0.3195 | - |
|
| 546 |
+
| 0.9187 | 7350 | 0.3177 | - |
|
| 547 |
+
| 0.925 | 7400 | 0.3228 | - |
|
| 548 |
+
| 0.9313 | 7450 | 0.3172 | - |
|
| 549 |
+
| **0.9375** | **7500** | **0.3045** | **0.6652** |
|
| 550 |
+
| 0.9437 | 7550 | 0.3052 | - |
|
| 551 |
+
| 0.95 | 7600 | 0.3273 | - |
|
| 552 |
+
| 0.9563 | 7650 | 0.3163 | - |
|
| 553 |
+
| 0.9625 | 7700 | 0.3138 | - |
|
| 554 |
+
| 0.9688 | 7750 | 0.3280 | - |
|
| 555 |
+
| 0.975 | 7800 | 0.3074 | - |
|
| 556 |
+
| 0.9812 | 7850 | 0.3266 | - |
|
| 557 |
+
| 0.9875 | 7900 | 0.3214 | - |
|
| 558 |
+
| 0.9938 | 7950 | 0.3240 | - |
|
| 559 |
+
| 1.0 | 8000 | 0.3141 | 0.6649 |
|
| 560 |
+
|
| 561 |
+
* The bold row denotes the saved checkpoint.
|
| 562 |
+
</details>
|
| 563 |
+
|
| 564 |
+
### Training Time
|
| 565 |
+
- **Training**: 8.9 minutes
|
| 566 |
+
- **Evaluation**: 45.4 seconds
|
| 567 |
+
- **Total**: 9.7 minutes
|
| 568 |
+
|
| 569 |
+
### Framework Versions
|
| 570 |
+
- Python: 3.13.15
|
| 571 |
+
- Sentence Transformers: 5.7.0
|
| 572 |
+
- Transformers: 5.18.0
|
| 573 |
+
- PyTorch: 2.11.0+cu130
|
| 574 |
+
- Accelerate: 1.15.0
|
| 575 |
+
- Datasets: 4.8.5
|
| 576 |
+
- Tokenizers: 0.23.2
|
| 577 |
+
|
| 578 |
+
## Additional Resources
|
| 579 |
+
|
| 580 |
+
- [Training and Finetuning Embedding Models with Sentence Transformers](https://huggingface.co/blog/train-sentence-transformers): the end-to-end guide for training or finetuning Sentence Transformer models.
|
| 581 |
+
- [Introduction to Matryoshka Embedding Models](https://huggingface.co/blog/matryoshka): variable-size embeddings that can be truncated with minimal quality loss.
|
| 582 |
+
- [Binary and Scalar Embedding Quantization for Significantly Faster & Cheaper Retrieval](https://huggingface.co/blog/embedding-quantization): post-training compression of embedding vectors.
|
| 583 |
+
- [Multimodal Embedding & Reranker Models with Sentence Transformers](https://huggingface.co/blog/multimodal-sentence-transformers): use text, image, audio, and video models through the same API.
|
| 584 |
+
- [Training and Finetuning Multimodal Embedding & Reranker Models with Sentence Transformers](https://huggingface.co/blog/train-multimodal-sentence-transformers): train multimodal embedding models, with a Visual Document Retrieval walkthrough.
|
| 585 |
+
|
| 586 |
+
## Citation
|
| 587 |
+
|
| 588 |
+
### BibTeX
|
| 589 |
+
|
| 590 |
+
#### Sentence Transformers
|
| 591 |
+
```bibtex
|
| 592 |
+
@inproceedings{reimers-2019-sentence-bert,
|
| 593 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
| 594 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
| 595 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
| 596 |
+
month = "11",
|
| 597 |
+
year = "2019",
|
| 598 |
+
publisher = "Association for Computational Linguistics",
|
| 599 |
+
url = "https://arxiv.org/abs/1908.10084",
|
| 600 |
+
}
|
| 601 |
+
```
|
| 602 |
+
|
| 603 |
+
#### MultipleNegativesRankingLoss
|
| 604 |
+
```bibtex
|
| 605 |
+
@misc{oord2019representationlearningcontrastivepredictive,
|
| 606 |
+
title={Representation Learning with Contrastive Predictive Coding},
|
| 607 |
+
author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
|
| 608 |
+
year={2019},
|
| 609 |
+
eprint={1807.03748},
|
| 610 |
+
archivePrefix={arXiv},
|
| 611 |
+
primaryClass={cs.LG},
|
| 612 |
+
url={https://arxiv.org/abs/1807.03748},
|
| 613 |
+
}
|
| 614 |
+
```
|
| 615 |
+
|
| 616 |
+
<!--
|
| 617 |
+
## Glossary
|
| 618 |
+
|
| 619 |
+
*Clearly define terms in order to be accessible across audiences.*
|
| 620 |
+
-->
|
| 621 |
+
|
| 622 |
+
<!--
|
| 623 |
+
## Model Card Authors
|
| 624 |
+
|
| 625 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
| 626 |
+
-->
|
| 627 |
+
|
| 628 |
+
<!--
|
| 629 |
+
## Model Card Contact
|
| 630 |
+
|
| 631 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
| 632 |
+
-->
|
config.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_cross_attention": false,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"BertModel"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"bos_token_id": null,
|
| 8 |
+
"classifier_dropout": null,
|
| 9 |
+
"dtype": "float32",
|
| 10 |
+
"eos_token_id": null,
|
| 11 |
+
"hidden_act": "gelu",
|
| 12 |
+
"hidden_dropout_prob": 0.1,
|
| 13 |
+
"hidden_size": 384,
|
| 14 |
+
"id2label": {
|
| 15 |
+
"0": "LABEL_0"
|
| 16 |
+
},
|
| 17 |
+
"initializer_range": 0.02,
|
| 18 |
+
"intermediate_size": 1536,
|
| 19 |
+
"is_decoder": false,
|
| 20 |
+
"label2id": {
|
| 21 |
+
"LABEL_0": 0
|
| 22 |
+
},
|
| 23 |
+
"layer_norm_eps": 1e-12,
|
| 24 |
+
"max_position_embeddings": 512,
|
| 25 |
+
"model_type": "bert",
|
| 26 |
+
"num_attention_heads": 12,
|
| 27 |
+
"num_hidden_layers": 12,
|
| 28 |
+
"pad_token_id": 0,
|
| 29 |
+
"position_embedding_type": "absolute",
|
| 30 |
+
"tie_word_embeddings": true,
|
| 31 |
+
"transformers_version": "5.18.0",
|
| 32 |
+
"type_vocab_size": 2,
|
| 33 |
+
"use_cache": false,
|
| 34 |
+
"vocab_size": 30522
|
| 35 |
+
}
|
config_sentence_transformers.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"__version__": {
|
| 3 |
+
"pytorch": "2.11.0+cu130",
|
| 4 |
+
"sentence_transformers": "5.7.0",
|
| 5 |
+
"transformers": "5.18.0"
|
| 6 |
+
},
|
| 7 |
+
"default_prompt_name": null,
|
| 8 |
+
"model_type": "SentenceTransformer",
|
| 9 |
+
"prompts": {
|
| 10 |
+
"document": "",
|
| 11 |
+
"query": ""
|
| 12 |
+
},
|
| 13 |
+
"similarity_fn_name": "cosine"
|
| 14 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:65f3aa1f420dab2017d62bd3eacbc4882dbf70d631f8246d6fb0d5adae855c37
|
| 3 |
+
size 133462128
|
modules.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"idx": 0,
|
| 4 |
+
"name": "0",
|
| 5 |
+
"path": "",
|
| 6 |
+
"type": "sentence_transformers.base.modules.transformer.Transformer"
|
| 7 |
+
},
|
| 8 |
+
{
|
| 9 |
+
"idx": 1,
|
| 10 |
+
"name": "1",
|
| 11 |
+
"path": "1_Pooling",
|
| 12 |
+
"type": "sentence_transformers.sentence_transformer.modules.pooling.Pooling"
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"idx": 2,
|
| 16 |
+
"name": "2",
|
| 17 |
+
"path": "2_Normalize",
|
| 18 |
+
"type": "sentence_transformers.sentence_transformer.modules.normalize.Normalize"
|
| 19 |
+
}
|
| 20 |
+
]
|
sentence_bert_config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"transformer_task": "feature-extraction",
|
| 3 |
+
"modality_config": {
|
| 4 |
+
"text": {
|
| 5 |
+
"method": "forward",
|
| 6 |
+
"method_output_name": "last_hidden_state"
|
| 7 |
+
}
|
| 8 |
+
},
|
| 9 |
+
"module_output_name": "token_embeddings"
|
| 10 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"clean_up_tokenization_spaces": true,
|
| 4 |
+
"cls_token": "[CLS]",
|
| 5 |
+
"do_basic_tokenize": true,
|
| 6 |
+
"do_lower_case": true,
|
| 7 |
+
"is_local": true,
|
| 8 |
+
"local_files_only": false,
|
| 9 |
+
"mask_token": "[MASK]",
|
| 10 |
+
"max_length": 30,
|
| 11 |
+
"model_max_length": 30,
|
| 12 |
+
"never_split": null,
|
| 13 |
+
"pad_to_multiple_of": null,
|
| 14 |
+
"pad_token": "[PAD]",
|
| 15 |
+
"pad_token_type_id": 0,
|
| 16 |
+
"padding_side": "right",
|
| 17 |
+
"sep_token": "[SEP]",
|
| 18 |
+
"stride": 0,
|
| 19 |
+
"strip_accents": null,
|
| 20 |
+
"tokenize_chinese_chars": true,
|
| 21 |
+
"tokenizer_class": "BertTokenizer",
|
| 22 |
+
"truncation_side": "right",
|
| 23 |
+
"truncation_strategy": "longest_first",
|
| 24 |
+
"unk_token": "[UNK]"
|
| 25 |
+
}
|