Sentence Similarity
sentence-transformers
Safetensors
bert
feature-extraction
dense
Generated from Trainer
dataset_size:90000
loss:MultipleNegativesRankingLoss
Eval Results (legacy)
text-embeddings-inference
Instructions to use redis/model-a-baseline with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use redis/model-a-baseline with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("redis/model-a-baseline") sentences = [ "who is the publisher of the norton anthology american literature", "W. W. Norton & Company W. W. Norton & Company is an American publishing company based in New York City. It has been owned wholly by its employees since the early 1960s. The company is known for its \"Norton Anthologies\" (particularly The Norton Anthology of English Literature) and its texts in the Norton Critical Editions series, the latter of which are frequently assigned in university literature courses.", "New Orleans La Nouvelle-Orléans (New Orleans) was founded in Spring of 1718 (7 May has become the traditional date to mark the anniversary, but the actual day is unknown[25]) by the French Mississippi Company, under the direction of Jean-Baptiste Le Moyne de Bienville, on land inhabited by the Chitimacha. It was named for Philippe II, Duke of Orléans, who was Regent of the Kingdom of France at the time. His title came from the French city of Orléans.", "I Really Like You The music video was directed by Peter Glanz. Jepsen filmed part of the song's music video on 16 February 2015, in front of the Mondrian Hotel in Manhattan alongside Tom Hanks, Justin Bieber and a troupe of dancers. Also making cameo appearances in the video are Rudy Mancuso and Andrew B. Bachelor (A.K.A. King Bach), well-known users of the short-form video sharing application Vine. The video was released on 6 March 2015.[15] CBC Music's Nicolle Weeks described it as \"a more affable version\" of the music video for The Verve's \"Bitter Sweet Symphony\" (1997).[16] The music video has been rated as one of 10 Best Music Videos of 2015 (So Far) by the readers of Billboard.[17]" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Training in progress, step 3510
Browse files- Information-Retrieval_evaluation_val_results.csv +2 -0
- README.md +74 -213
- eval/Information-Retrieval_evaluation_val_results.csv +36 -0
- final_metrics.json +16 -0
- model.safetensors +1 -1
- training_args.bin +1 -1
Information-Retrieval_evaluation_val_results.csv
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,steps,cosine-Accuracy@1,cosine-Accuracy@3,cosine-Accuracy@5,cosine-Precision@1,cosine-Recall@1,cosine-Precision@3,cosine-Recall@3,cosine-Precision@5,cosine-Recall@5,cosine-MRR@1,cosine-MRR@5,cosine-MRR@10,cosine-NDCG@10,cosine-MAP@100
|
| 2 |
+
-1,-1,0.9208,0.9698,0.9842,0.9208,0.9208,0.3232666666666667,0.9698,0.19684,0.9842,0.9208,0.9460899999999998,0.9476021428571432,0.9593212690041523,0.9479260307963899
|
README.md
CHANGED
|
@@ -5,109 +5,38 @@ tags:
|
|
| 5 |
- feature-extraction
|
| 6 |
- dense
|
| 7 |
- generated_from_trainer
|
| 8 |
-
- dataset_size:
|
| 9 |
- loss:MultipleNegativesRankingLoss
|
| 10 |
base_model: prajjwal1/bert-small
|
| 11 |
widget:
|
| 12 |
-
- source_sentence: How do I
|
| 13 |
sentences:
|
| 14 |
-
- How
|
| 15 |
-
-
|
| 16 |
-
- What
|
| 17 |
-
- source_sentence:
|
| 18 |
sentences:
|
| 19 |
-
-
|
| 20 |
-
-
|
| 21 |
-
|
| 22 |
-
-
|
| 23 |
-
- source_sentence:
|
| 24 |
sentences:
|
| 25 |
-
- What
|
| 26 |
-
-
|
| 27 |
-
-
|
| 28 |
-
|
| 29 |
-
- source_sentence: What are the differences between eccentric and concentric contraction?
|
| 30 |
-
What are some examples?
|
| 31 |
sentences:
|
| 32 |
-
-
|
| 33 |
-
- How
|
| 34 |
-
-
|
| 35 |
-
- source_sentence:
|
| 36 |
-
app. Is it necessary to use that coupon only when I order online?
|
| 37 |
sentences:
|
| 38 |
-
-
|
| 39 |
-
-
|
| 40 |
-
-
|
| 41 |
-
necessary to use that coupon only when I order online?
|
| 42 |
pipeline_tag: sentence-similarity
|
| 43 |
library_name: sentence-transformers
|
| 44 |
-
metrics:
|
| 45 |
-
- cosine_accuracy@1
|
| 46 |
-
- cosine_accuracy@3
|
| 47 |
-
- cosine_accuracy@5
|
| 48 |
-
- cosine_precision@1
|
| 49 |
-
- cosine_precision@3
|
| 50 |
-
- cosine_precision@5
|
| 51 |
-
- cosine_recall@1
|
| 52 |
-
- cosine_recall@3
|
| 53 |
-
- cosine_recall@5
|
| 54 |
-
- cosine_ndcg@10
|
| 55 |
-
- cosine_mrr@1
|
| 56 |
-
- cosine_mrr@5
|
| 57 |
-
- cosine_mrr@10
|
| 58 |
-
- cosine_map@100
|
| 59 |
-
model-index:
|
| 60 |
-
- name: SentenceTransformer based on prajjwal1/bert-small
|
| 61 |
-
results:
|
| 62 |
-
- task:
|
| 63 |
-
type: information-retrieval
|
| 64 |
-
name: Information Retrieval
|
| 65 |
-
dataset:
|
| 66 |
-
name: val
|
| 67 |
-
type: val
|
| 68 |
-
metrics:
|
| 69 |
-
- type: cosine_accuracy@1
|
| 70 |
-
value: 0.9156
|
| 71 |
-
name: Cosine Accuracy@1
|
| 72 |
-
- type: cosine_accuracy@3
|
| 73 |
-
value: 0.9674
|
| 74 |
-
name: Cosine Accuracy@3
|
| 75 |
-
- type: cosine_accuracy@5
|
| 76 |
-
value: 0.9828
|
| 77 |
-
name: Cosine Accuracy@5
|
| 78 |
-
- type: cosine_precision@1
|
| 79 |
-
value: 0.9156
|
| 80 |
-
name: Cosine Precision@1
|
| 81 |
-
- type: cosine_precision@3
|
| 82 |
-
value: 0.3224666666666667
|
| 83 |
-
name: Cosine Precision@3
|
| 84 |
-
- type: cosine_precision@5
|
| 85 |
-
value: 0.19655999999999996
|
| 86 |
-
name: Cosine Precision@5
|
| 87 |
-
- type: cosine_recall@1
|
| 88 |
-
value: 0.9156
|
| 89 |
-
name: Cosine Recall@1
|
| 90 |
-
- type: cosine_recall@3
|
| 91 |
-
value: 0.9674
|
| 92 |
-
name: Cosine Recall@3
|
| 93 |
-
- type: cosine_recall@5
|
| 94 |
-
value: 0.9828
|
| 95 |
-
name: Cosine Recall@5
|
| 96 |
-
- type: cosine_ndcg@10
|
| 97 |
-
value: 0.9557389379924726
|
| 98 |
-
name: Cosine Ndcg@10
|
| 99 |
-
- type: cosine_mrr@1
|
| 100 |
-
value: 0.9156
|
| 101 |
-
name: Cosine Mrr@1
|
| 102 |
-
- type: cosine_mrr@5
|
| 103 |
-
value: 0.9418899999999998
|
| 104 |
-
name: Cosine Mrr@5
|
| 105 |
-
- type: cosine_mrr@10
|
| 106 |
-
value: 0.9433757142857143
|
| 107 |
-
name: Cosine Mrr@10
|
| 108 |
-
- type: cosine_map@100
|
| 109 |
-
value: 0.9437967311048533
|
| 110 |
-
name: Cosine Map@100
|
| 111 |
---
|
| 112 |
|
| 113 |
# SentenceTransformer based on prajjwal1/bert-small
|
|
@@ -156,12 +85,12 @@ Then you can load this model and run inference.
|
|
| 156 |
from sentence_transformers import SentenceTransformer
|
| 157 |
|
| 158 |
# Download from the 🤗 Hub
|
| 159 |
-
model = SentenceTransformer("
|
| 160 |
# Run inference
|
| 161 |
sentences = [
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
'
|
| 165 |
]
|
| 166 |
embeddings = model.encode(sentences)
|
| 167 |
print(embeddings.shape)
|
|
@@ -170,9 +99,9 @@ print(embeddings.shape)
|
|
| 170 |
# Get the similarity scores for the embeddings
|
| 171 |
similarities = model.similarity(embeddings, embeddings)
|
| 172 |
print(similarities)
|
| 173 |
-
# tensor([[1.0000,
|
| 174 |
-
# [
|
| 175 |
-
# [0.
|
| 176 |
```
|
| 177 |
|
| 178 |
<!--
|
|
@@ -199,32 +128,6 @@ You can finetune this model on your own dataset.
|
|
| 199 |
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
| 200 |
-->
|
| 201 |
|
| 202 |
-
## Evaluation
|
| 203 |
-
|
| 204 |
-
### Metrics
|
| 205 |
-
|
| 206 |
-
#### Information Retrieval
|
| 207 |
-
|
| 208 |
-
* Dataset: `val`
|
| 209 |
-
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
|
| 210 |
-
|
| 211 |
-
| Metric | Value |
|
| 212 |
-
|:-------------------|:-----------|
|
| 213 |
-
| cosine_accuracy@1 | 0.9156 |
|
| 214 |
-
| cosine_accuracy@3 | 0.9674 |
|
| 215 |
-
| cosine_accuracy@5 | 0.9828 |
|
| 216 |
-
| cosine_precision@1 | 0.9156 |
|
| 217 |
-
| cosine_precision@3 | 0.3225 |
|
| 218 |
-
| cosine_precision@5 | 0.1966 |
|
| 219 |
-
| cosine_recall@1 | 0.9156 |
|
| 220 |
-
| cosine_recall@3 | 0.9674 |
|
| 221 |
-
| cosine_recall@5 | 0.9828 |
|
| 222 |
-
| **cosine_ndcg@10** | **0.9557** |
|
| 223 |
-
| cosine_mrr@1 | 0.9156 |
|
| 224 |
-
| cosine_mrr@5 | 0.9419 |
|
| 225 |
-
| cosine_mrr@10 | 0.9434 |
|
| 226 |
-
| cosine_map@100 | 0.9438 |
|
| 227 |
-
|
| 228 |
<!--
|
| 229 |
## Bias, Risks and Limitations
|
| 230 |
|
|
@@ -243,45 +146,19 @@ You can finetune this model on your own dataset.
|
|
| 243 |
|
| 244 |
#### Unnamed Dataset
|
| 245 |
|
| 246 |
-
* Size:
|
| 247 |
-
* Columns: <code>
|
| 248 |
-
* Approximate statistics based on the first 1000 samples:
|
| 249 |
-
| | anchor | positive | negative |
|
| 250 |
-
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|
|
| 251 |
-
| type | string | string | string |
|
| 252 |
-
| details | <ul><li>min: 6 tokens</li><li>mean: 15.63 tokens</li><li>max: 75 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 15.77 tokens</li><li>max: 75 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 16.5 tokens</li><li>max: 67 tokens</li></ul> |
|
| 253 |
-
* Samples:
|
| 254 |
-
| anchor | positive | negative |
|
| 255 |
-
|:---------------------------------------------------------|:---------------------------------------------------------|:----------------------------------------------------------------------------|
|
| 256 |
-
| <code>How long did it take to develop Pokémon GO?</code> | <code>How long did it take to develop Pokémon GO?</code> | <code>Can I take more than one gym in Pokémon GO?</code> |
|
| 257 |
-
| <code>How bad is 6/18 eyesight?</code> | <code>How bad is 6/18 eyesight?</code> | <code>How was bad eyesight dealt with in ancient and medieval times?</code> |
|
| 258 |
-
| <code>How can I do learn speaking English easily?</code> | <code>How can I learn speaking English easily?</code> | <code>How do you hack an Instagram account?</code> |
|
| 259 |
-
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
|
| 260 |
-
```json
|
| 261 |
-
{
|
| 262 |
-
"scale": 20.0,
|
| 263 |
-
"similarity_fct": "cos_sim",
|
| 264 |
-
"gather_across_devices": false
|
| 265 |
-
}
|
| 266 |
-
```
|
| 267 |
-
|
| 268 |
-
### Evaluation Dataset
|
| 269 |
-
|
| 270 |
-
#### Unnamed Dataset
|
| 271 |
-
|
| 272 |
-
* Size: 5,000 evaluation samples
|
| 273 |
-
* Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
|
| 274 |
* Approximate statistics based on the first 1000 samples:
|
| 275 |
-
| |
|
| 276 |
-
|:--------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------
|
| 277 |
-
| type | string | string
|
| 278 |
-
| details | <ul><li>min:
|
| 279 |
* Samples:
|
| 280 |
-
|
|
| 281 |
-
|:----------------------------------------------------------------------------------------
|
| 282 |
-
| <code>
|
| 283 |
-
| <code>
|
| 284 |
-
| <code>
|
| 285 |
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
|
| 286 |
```json
|
| 287 |
{
|
|
@@ -294,49 +171,36 @@ You can finetune this model on your own dataset.
|
|
| 294 |
### Training Hyperparameters
|
| 295 |
#### Non-Default Hyperparameters
|
| 296 |
|
| 297 |
-
- `
|
| 298 |
-
- `
|
| 299 |
-
- `per_device_eval_batch_size`: 256
|
| 300 |
-
- `learning_rate`: 2e-05
|
| 301 |
-
- `weight_decay`: 0.001
|
| 302 |
-
- `max_steps`: 1053
|
| 303 |
-
- `warmup_ratio`: 0.1
|
| 304 |
- `fp16`: True
|
| 305 |
-
- `
|
| 306 |
-
- `dataloader_num_workers`: 1
|
| 307 |
-
- `dataloader_prefetch_factor`: 1
|
| 308 |
-
- `load_best_model_at_end`: True
|
| 309 |
-
- `optim`: adamw_torch
|
| 310 |
-
- `ddp_find_unused_parameters`: False
|
| 311 |
-
- `push_to_hub`: True
|
| 312 |
-
- `hub_model_id`: redis/model-a-baseline
|
| 313 |
-
- `eval_on_start`: True
|
| 314 |
|
| 315 |
#### All Hyperparameters
|
| 316 |
<details><summary>Click to expand</summary>
|
| 317 |
|
| 318 |
- `overwrite_output_dir`: False
|
| 319 |
- `do_predict`: False
|
| 320 |
-
- `eval_strategy`:
|
| 321 |
- `prediction_loss_only`: True
|
| 322 |
-
- `per_device_train_batch_size`:
|
| 323 |
-
- `per_device_eval_batch_size`:
|
| 324 |
- `per_gpu_train_batch_size`: None
|
| 325 |
- `per_gpu_eval_batch_size`: None
|
| 326 |
- `gradient_accumulation_steps`: 1
|
| 327 |
- `eval_accumulation_steps`: None
|
| 328 |
- `torch_empty_cache_steps`: None
|
| 329 |
-
- `learning_rate`:
|
| 330 |
-
- `weight_decay`: 0.
|
| 331 |
- `adam_beta1`: 0.9
|
| 332 |
- `adam_beta2`: 0.999
|
| 333 |
- `adam_epsilon`: 1e-08
|
| 334 |
-
- `max_grad_norm`: 1
|
| 335 |
-
- `num_train_epochs`: 3
|
| 336 |
-
- `max_steps`:
|
| 337 |
- `lr_scheduler_type`: linear
|
| 338 |
- `lr_scheduler_kwargs`: {}
|
| 339 |
-
- `warmup_ratio`: 0.
|
| 340 |
- `warmup_steps`: 0
|
| 341 |
- `log_level`: passive
|
| 342 |
- `log_level_replica`: warning
|
|
@@ -364,14 +228,14 @@ You can finetune this model on your own dataset.
|
|
| 364 |
- `tpu_num_cores`: None
|
| 365 |
- `tpu_metrics_debug`: False
|
| 366 |
- `debug`: []
|
| 367 |
-
- `dataloader_drop_last`:
|
| 368 |
-
- `dataloader_num_workers`:
|
| 369 |
-
- `dataloader_prefetch_factor`:
|
| 370 |
- `past_index`: -1
|
| 371 |
- `disable_tqdm`: False
|
| 372 |
- `remove_unused_columns`: True
|
| 373 |
- `label_names`: None
|
| 374 |
-
- `load_best_model_at_end`:
|
| 375 |
- `ignore_data_skip`: False
|
| 376 |
- `fsdp`: []
|
| 377 |
- `fsdp_min_num_params`: 0
|
|
@@ -381,23 +245,23 @@ You can finetune this model on your own dataset.
|
|
| 381 |
- `parallelism_config`: None
|
| 382 |
- `deepspeed`: None
|
| 383 |
- `label_smoothing_factor`: 0.0
|
| 384 |
-
- `optim`:
|
| 385 |
- `optim_args`: None
|
| 386 |
- `adafactor`: False
|
| 387 |
- `group_by_length`: False
|
| 388 |
- `length_column_name`: length
|
| 389 |
- `project`: huggingface
|
| 390 |
- `trackio_space_id`: trackio
|
| 391 |
-
- `ddp_find_unused_parameters`:
|
| 392 |
- `ddp_bucket_cap_mb`: None
|
| 393 |
- `ddp_broadcast_buffers`: False
|
| 394 |
- `dataloader_pin_memory`: True
|
| 395 |
- `dataloader_persistent_workers`: False
|
| 396 |
- `skip_memory_metrics`: True
|
| 397 |
- `use_legacy_prediction_loop`: False
|
| 398 |
-
- `push_to_hub`:
|
| 399 |
- `resume_from_checkpoint`: None
|
| 400 |
-
- `hub_model_id`:
|
| 401 |
- `hub_strategy`: every_save
|
| 402 |
- `hub_private_repo`: None
|
| 403 |
- `hub_always_push`: False
|
|
@@ -424,35 +288,32 @@ You can finetune this model on your own dataset.
|
|
| 424 |
- `neftune_noise_alpha`: None
|
| 425 |
- `optim_target_modules`: None
|
| 426 |
- `batch_eval_metrics`: False
|
| 427 |
-
- `eval_on_start`:
|
| 428 |
- `use_liger_kernel`: False
|
| 429 |
- `liger_kernel_config`: None
|
| 430 |
- `eval_use_gather_object`: False
|
| 431 |
- `average_tokens_across_devices`: True
|
| 432 |
- `prompts`: None
|
| 433 |
- `batch_sampler`: batch_sampler
|
| 434 |
-
- `multi_dataset_batch_sampler`:
|
| 435 |
- `router_mapping`: {}
|
| 436 |
- `learning_rate_mapping`: {}
|
| 437 |
|
| 438 |
</details>
|
| 439 |
|
| 440 |
### Training Logs
|
| 441 |
-
| Epoch
|
| 442 |
-
|:------
|
| 443 |
-
| 0
|
| 444 |
-
| 0.
|
| 445 |
-
| 0.
|
| 446 |
-
|
|
| 447 |
-
| 1.
|
| 448 |
-
| 1.
|
| 449 |
-
|
|
| 450 |
-
|
|
| 451 |
-
| 2.
|
| 452 |
-
|
| 453 |
-
| **2.849** | **1000** | **0.0792** | **0.046** | **0.9557** |
|
| 454 |
-
|
| 455 |
-
* The bold row denotes the saved checkpoint.
|
| 456 |
|
| 457 |
### Framework Versions
|
| 458 |
- Python: 3.10.18
|
|
|
|
| 5 |
- feature-extraction
|
| 6 |
- dense
|
| 7 |
- generated_from_trainer
|
| 8 |
+
- dataset_size:100000
|
| 9 |
- loss:MultipleNegativesRankingLoss
|
| 10 |
base_model: prajjwal1/bert-small
|
| 11 |
widget:
|
| 12 |
+
- source_sentence: How do I polish my English skills?
|
| 13 |
sentences:
|
| 14 |
+
- How can we polish English skills?
|
| 15 |
+
- Why should I move to Israel as a Jew?
|
| 16 |
+
- What are vitamins responsible for?
|
| 17 |
+
- source_sentence: Can I use the Kozuka Gothic Pro font as a font-face on my web site?
|
| 18 |
sentences:
|
| 19 |
+
- Can I use the Kozuka Gothic Pro font as a font-face on my web site?
|
| 20 |
+
- Why are Google, Facebook, YouTube and other social networking sites banned in
|
| 21 |
+
China?
|
| 22 |
+
- What font is used in Bloomberg Terminal?
|
| 23 |
+
- source_sentence: Is Quora the best Q&A site?
|
| 24 |
sentences:
|
| 25 |
+
- What was the best Quora question ever?
|
| 26 |
+
- Is Quora the best inquiry site?
|
| 27 |
+
- Where do I buy Oway hair products online?
|
| 28 |
+
- source_sentence: How can I customize my walking speed on Google Maps?
|
|
|
|
|
|
|
| 29 |
sentences:
|
| 30 |
+
- How do I bring back Google maps icon in my home screen?
|
| 31 |
+
- How many pages are there in all the Harry Potter books combined?
|
| 32 |
+
- How can I customize my walking speed on Google Maps?
|
| 33 |
+
- source_sentence: DId something exist before the Big Bang?
|
|
|
|
| 34 |
sentences:
|
| 35 |
+
- How can I improve my memory problem?
|
| 36 |
+
- Where can I buy Fairy Tail Manga?
|
| 37 |
+
- Is there a scientific name for what existed before the Big Bang?
|
|
|
|
| 38 |
pipeline_tag: sentence-similarity
|
| 39 |
library_name: sentence-transformers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
---
|
| 41 |
|
| 42 |
# SentenceTransformer based on prajjwal1/bert-small
|
|
|
|
| 85 |
from sentence_transformers import SentenceTransformer
|
| 86 |
|
| 87 |
# Download from the 🤗 Hub
|
| 88 |
+
model = SentenceTransformer("sentence_transformers_model_id")
|
| 89 |
# Run inference
|
| 90 |
sentences = [
|
| 91 |
+
'DId something exist before the Big Bang?',
|
| 92 |
+
'Is there a scientific name for what existed before the Big Bang?',
|
| 93 |
+
'Where can I buy Fairy Tail Manga?',
|
| 94 |
]
|
| 95 |
embeddings = model.encode(sentences)
|
| 96 |
print(embeddings.shape)
|
|
|
|
| 99 |
# Get the similarity scores for the embeddings
|
| 100 |
similarities = model.similarity(embeddings, embeddings)
|
| 101 |
print(similarities)
|
| 102 |
+
# tensor([[ 1.0000, 0.7596, -0.0398],
|
| 103 |
+
# [ 0.7596, 1.0000, -0.0308],
|
| 104 |
+
# [-0.0398, -0.0308, 1.0000]])
|
| 105 |
```
|
| 106 |
|
| 107 |
<!--
|
|
|
|
| 128 |
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
| 129 |
-->
|
| 130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
<!--
|
| 132 |
## Bias, Risks and Limitations
|
| 133 |
|
|
|
|
| 146 |
|
| 147 |
#### Unnamed Dataset
|
| 148 |
|
| 149 |
+
* Size: 100,000 training samples
|
| 150 |
+
* Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>sentence_2</code>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
* Approximate statistics based on the first 1000 samples:
|
| 152 |
+
| | sentence_0 | sentence_1 | sentence_2 |
|
| 153 |
+
|:--------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|
|
| 154 |
+
| type | string | string | string |
|
| 155 |
+
| details | <ul><li>min: 3 tokens</li><li>mean: 15.53 tokens</li><li>max: 59 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 15.5 tokens</li><li>max: 59 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 16.87 tokens</li><li>max: 128 tokens</li></ul> |
|
| 156 |
* Samples:
|
| 157 |
+
| sentence_0 | sentence_1 | sentence_2 |
|
| 158 |
+
|:----------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------|:-----------------------------------------------------------------------|
|
| 159 |
+
| <code>Is there visitor entry facility in Jaipur airport. How much is the ticket?</code> | <code>Is there visitor entry facility in Jaipur airport. How much is the ticket?</code> | <code>How much is the airport tax in bogota?</code> |
|
| 160 |
+
| <code>Which concept is more important: good planning or hard work?</code> | <code>Which concept is more important: good planning or hard work?</code> | <code>What is important in life: luck or hard work?</code> |
|
| 161 |
+
| <code>What is the most efficient way to make money?</code> | <code>How can I make my money make money?</code> | <code>What can one learn about Quantum Mechanics in 10 minutes?</code> |
|
| 162 |
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
|
| 163 |
```json
|
| 164 |
{
|
|
|
|
| 171 |
### Training Hyperparameters
|
| 172 |
#### Non-Default Hyperparameters
|
| 173 |
|
| 174 |
+
- `per_device_train_batch_size`: 64
|
| 175 |
+
- `per_device_eval_batch_size`: 64
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
- `fp16`: True
|
| 177 |
+
- `multi_dataset_batch_sampler`: round_robin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
|
| 179 |
#### All Hyperparameters
|
| 180 |
<details><summary>Click to expand</summary>
|
| 181 |
|
| 182 |
- `overwrite_output_dir`: False
|
| 183 |
- `do_predict`: False
|
| 184 |
+
- `eval_strategy`: no
|
| 185 |
- `prediction_loss_only`: True
|
| 186 |
+
- `per_device_train_batch_size`: 64
|
| 187 |
+
- `per_device_eval_batch_size`: 64
|
| 188 |
- `per_gpu_train_batch_size`: None
|
| 189 |
- `per_gpu_eval_batch_size`: None
|
| 190 |
- `gradient_accumulation_steps`: 1
|
| 191 |
- `eval_accumulation_steps`: None
|
| 192 |
- `torch_empty_cache_steps`: None
|
| 193 |
+
- `learning_rate`: 5e-05
|
| 194 |
+
- `weight_decay`: 0.0
|
| 195 |
- `adam_beta1`: 0.9
|
| 196 |
- `adam_beta2`: 0.999
|
| 197 |
- `adam_epsilon`: 1e-08
|
| 198 |
+
- `max_grad_norm`: 1
|
| 199 |
+
- `num_train_epochs`: 3
|
| 200 |
+
- `max_steps`: -1
|
| 201 |
- `lr_scheduler_type`: linear
|
| 202 |
- `lr_scheduler_kwargs`: {}
|
| 203 |
+
- `warmup_ratio`: 0.0
|
| 204 |
- `warmup_steps`: 0
|
| 205 |
- `log_level`: passive
|
| 206 |
- `log_level_replica`: warning
|
|
|
|
| 228 |
- `tpu_num_cores`: None
|
| 229 |
- `tpu_metrics_debug`: False
|
| 230 |
- `debug`: []
|
| 231 |
+
- `dataloader_drop_last`: False
|
| 232 |
+
- `dataloader_num_workers`: 0
|
| 233 |
+
- `dataloader_prefetch_factor`: None
|
| 234 |
- `past_index`: -1
|
| 235 |
- `disable_tqdm`: False
|
| 236 |
- `remove_unused_columns`: True
|
| 237 |
- `label_names`: None
|
| 238 |
+
- `load_best_model_at_end`: False
|
| 239 |
- `ignore_data_skip`: False
|
| 240 |
- `fsdp`: []
|
| 241 |
- `fsdp_min_num_params`: 0
|
|
|
|
| 245 |
- `parallelism_config`: None
|
| 246 |
- `deepspeed`: None
|
| 247 |
- `label_smoothing_factor`: 0.0
|
| 248 |
+
- `optim`: adamw_torch_fused
|
| 249 |
- `optim_args`: None
|
| 250 |
- `adafactor`: False
|
| 251 |
- `group_by_length`: False
|
| 252 |
- `length_column_name`: length
|
| 253 |
- `project`: huggingface
|
| 254 |
- `trackio_space_id`: trackio
|
| 255 |
+
- `ddp_find_unused_parameters`: None
|
| 256 |
- `ddp_bucket_cap_mb`: None
|
| 257 |
- `ddp_broadcast_buffers`: False
|
| 258 |
- `dataloader_pin_memory`: True
|
| 259 |
- `dataloader_persistent_workers`: False
|
| 260 |
- `skip_memory_metrics`: True
|
| 261 |
- `use_legacy_prediction_loop`: False
|
| 262 |
+
- `push_to_hub`: False
|
| 263 |
- `resume_from_checkpoint`: None
|
| 264 |
+
- `hub_model_id`: None
|
| 265 |
- `hub_strategy`: every_save
|
| 266 |
- `hub_private_repo`: None
|
| 267 |
- `hub_always_push`: False
|
|
|
|
| 288 |
- `neftune_noise_alpha`: None
|
| 289 |
- `optim_target_modules`: None
|
| 290 |
- `batch_eval_metrics`: False
|
| 291 |
+
- `eval_on_start`: False
|
| 292 |
- `use_liger_kernel`: False
|
| 293 |
- `liger_kernel_config`: None
|
| 294 |
- `eval_use_gather_object`: False
|
| 295 |
- `average_tokens_across_devices`: True
|
| 296 |
- `prompts`: None
|
| 297 |
- `batch_sampler`: batch_sampler
|
| 298 |
+
- `multi_dataset_batch_sampler`: round_robin
|
| 299 |
- `router_mapping`: {}
|
| 300 |
- `learning_rate_mapping`: {}
|
| 301 |
|
| 302 |
</details>
|
| 303 |
|
| 304 |
### Training Logs
|
| 305 |
+
| Epoch | Step | Training Loss |
|
| 306 |
+
|:------:|:----:|:-------------:|
|
| 307 |
+
| 0.3199 | 500 | 0.2284 |
|
| 308 |
+
| 0.6398 | 1000 | 0.0571 |
|
| 309 |
+
| 0.9597 | 1500 | 0.0486 |
|
| 310 |
+
| 1.2796 | 2000 | 0.0378 |
|
| 311 |
+
| 1.5995 | 2500 | 0.0367 |
|
| 312 |
+
| 1.9194 | 3000 | 0.0338 |
|
| 313 |
+
| 2.2393 | 3500 | 0.0327 |
|
| 314 |
+
| 2.5592 | 4000 | 0.0285 |
|
| 315 |
+
| 2.8791 | 4500 | 0.0285 |
|
| 316 |
+
|
|
|
|
|
|
|
|
|
|
| 317 |
|
| 318 |
### Framework Versions
|
| 319 |
- Python: 3.10.18
|
eval/Information-Retrieval_evaluation_val_results.csv
CHANGED
|
@@ -2,3 +2,39 @@ epoch,steps,cosine-Accuracy@1,cosine-Accuracy@3,cosine-Accuracy@5,cosine-Precisi
|
|
| 2 |
0,0,0.8306,0.8812,0.903,0.8306,0.8306,0.29373333333333335,0.8812,0.1806,0.903,0.8306,0.8580933333333336,0.8615153968253979,0.8775189066928426,0.8635987322727473
|
| 3 |
1.4245014245014245,500,0.915,0.9666,0.9802,0.915,0.915,0.3222,0.9666,0.19603999999999996,0.9802,0.915,0.9408566666666663,0.9426431746031747,0.9549755895413731,0.9431098688909989
|
| 4 |
2.849002849002849,1000,0.9156,0.9674,0.9828,0.9156,0.9156,0.3224666666666667,0.9674,0.19655999999999996,0.9828,0.9156,0.9418899999999998,0.9433757142857143,0.9557389379924726,0.9437967311048533
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
0,0,0.8306,0.8812,0.903,0.8306,0.8306,0.29373333333333335,0.8812,0.1806,0.903,0.8306,0.8580933333333336,0.8615153968253979,0.8775189066928426,0.8635987322727473
|
| 3 |
1.4245014245014245,500,0.915,0.9666,0.9802,0.915,0.915,0.3222,0.9666,0.19603999999999996,0.9802,0.915,0.9408566666666663,0.9426431746031747,0.9549755895413731,0.9431098688909989
|
| 4 |
2.849002849002849,1000,0.9156,0.9674,0.9828,0.9156,0.9156,0.3224666666666667,0.9674,0.19655999999999996,0.9828,0.9156,0.9418899999999998,0.9433757142857143,0.9557389379924726,0.9437967311048533
|
| 5 |
+
0,0,0.8306,0.8812,0.903,0.8306,0.8306,0.29373333333333335,0.8812,0.1806,0.903,0.8306,0.8580933333333336,0.8615153968253979,0.8775189066928426,0.8635987322727473
|
| 6 |
+
0.2849002849002849,100,0.894,0.948,0.9668,0.894,0.894,0.316,0.948,0.19336,0.9668,0.894,0.9223233333333335,0.9244372222222224,0.938479280073602,0.9252923238377365
|
| 7 |
+
0.5698005698005698,200,0.908,0.9566,0.9762,0.908,0.908,0.31886666666666663,0.9566,0.19523999999999997,0.9762,0.908,0.934316666666666,0.9358780158730157,0.9484495917361974,0.9365908719441163
|
| 8 |
+
0.8547008547008547,300,0.9136,0.9616,0.9776,0.9136,0.9136,0.3205333333333333,0.9616,0.19551999999999997,0.9776,0.9136,0.9383066666666664,0.939995555555555,0.9521233134462401,0.9406401752452377
|
| 9 |
+
1.1396011396011396,400,0.9116,0.9638,0.9788,0.9116,0.9116,0.3212666666666667,0.9638,0.19575999999999996,0.9788,0.9116,0.938166666666666,0.9399092063492062,0.9524429443175384,0.94049272884241
|
| 10 |
+
1.4245014245014245,500,0.9122,0.9658,0.9802,0.9122,0.9122,0.3219333333333333,0.9658,0.19603999999999996,0.9802,0.9122,0.9391566666666665,0.9408415079365081,0.9535259441616083,0.9413274048032421
|
| 11 |
+
1.7094017094017095,600,0.9138,0.9662,0.9812,0.9138,0.9138,0.32206666666666667,0.9662,0.19623999999999997,0.9812,0.9138,0.9402833333333328,0.941934841269841,0.9544617890424794,0.9423965116472999
|
| 12 |
+
1.9943019943019942,700,0.9154,0.9668,0.982,0.9154,0.9154,0.3222666666666667,0.9668,0.1964,0.982,0.9154,0.9416466666666667,0.9432646031746031,0.9556113325450355,0.9437089809657148
|
| 13 |
+
2.2792022792022792,800,0.9146,0.9668,0.9824,0.9146,0.9146,0.32226666666666665,0.9668,0.19647999999999996,0.9824,0.9146,0.9411900000000002,0.9427308730158733,0.955214779372602,0.9431701536455497
|
| 14 |
+
2.564102564102564,900,0.916,0.9676,0.983,0.916,0.916,0.3225333333333333,0.9676,0.19659999999999994,0.983,0.916,0.9424433333333334,0.9439552380952385,0.9562008945401774,0.9443868016274295
|
| 15 |
+
2.849002849002849,1000,0.918,0.968,0.984,0.918,0.918,0.32266666666666666,0.968,0.19679999999999995,0.984,0.918,0.9436899999999999,0.9451158730158733,0.9572002608088729,0.9455037809055091
|
| 16 |
+
3.133903133903134,1100,0.917,0.9674,0.9842,0.917,0.917,0.3224666666666667,0.9674,0.19683999999999996,0.9842,0.917,0.943383333333333,0.9447990476190476,0.9570223245145849,0.9451840665936517
|
| 17 |
+
3.4188034188034186,1200,0.9182,0.9678,0.9848,0.9182,0.9182,0.3226,0.9678,0.19696,0.9848,0.9182,0.944073333333333,0.9454951587301582,0.957716972687552,0.9458173871961372
|
| 18 |
+
3.7037037037037037,1300,0.9178,0.9682,0.9846,0.9178,0.9178,0.3227333333333333,0.9682,0.19691999999999998,0.9846,0.9178,0.9438833333333326,0.9453219841269834,0.9575541769846366,0.9456632030173215
|
| 19 |
+
3.9886039886039883,1400,0.9176,0.9686,0.984,0.9176,0.9176,0.3228666666666667,0.9686,0.19679999999999997,0.984,0.9176,0.9436733333333331,0.9451425396825395,0.9573274263550402,0.9455296883797789
|
| 20 |
+
4.273504273504273,1500,0.9174,0.9678,0.9838,0.9174,0.9174,0.3226,0.9678,0.19676,0.9838,0.9174,0.9438066666666663,0.9454632539682536,0.9578062092205877,0.9457650288600289
|
| 21 |
+
4.5584045584045585,1600,0.9166,0.9676,0.9842,0.9166,0.9166,0.3225333333333333,0.9676,0.19683999999999996,0.9842,0.9166,0.9433833333333332,0.9449851587301588,0.9574903853768568,0.945263396166527
|
| 22 |
+
4.843304843304844,1700,0.9174,0.9684,0.9842,0.9174,0.9174,0.3228,0.9684,0.19683999999999996,0.9842,0.9174,0.9439733333333328,0.9455711111111106,0.9578939600876886,0.945876005430171
|
| 23 |
+
5.128205128205128,1800,0.918,0.9676,0.9852,0.918,0.918,0.3225333333333333,0.9676,0.19704,0.9852,0.918,0.944713333333333,0.9461937301587295,0.9584220005497169,0.946479562211455
|
| 24 |
+
5.413105413105413,1900,0.9182,0.9686,0.9854,0.9182,0.9182,0.32286666666666664,0.9686,0.19707999999999998,0.9854,0.9182,0.9450499999999996,0.9464548412698407,0.9585785976256349,0.946755635836173
|
| 25 |
+
5.698005698005698,2000,0.9178,0.9698,0.985,0.9178,0.9178,0.3232666666666667,0.9698,0.19699999999999998,0.985,0.9178,0.9446599999999995,0.9462009523809518,0.9584813888059387,0.9464702858471533
|
| 26 |
+
5.982905982905983,2100,0.9178,0.968,0.9852,0.9178,0.9178,0.3226666666666667,0.968,0.19703999999999997,0.9852,0.9178,0.9446466666666662,0.9461438095238088,0.9583932509292831,0.9464317040482961
|
| 27 |
+
6.267806267806268,2200,0.9178,0.9682,0.9848,0.9178,0.9178,0.32273333333333337,0.9682,0.19695999999999997,0.9848,0.9178,0.9443633333333328,0.9459359523809515,0.9582664640306275,0.9462111969736714
|
| 28 |
+
6.552706552706553,2300,0.9174,0.9684,0.9854,0.9174,0.9174,0.3228,0.9684,0.19707999999999998,0.9854,0.9174,0.9443666666666665,0.945789444444444,0.9580402481297285,0.9461211373400121
|
| 29 |
+
6.837606837606837,2400,0.9178,0.9688,0.985,0.9178,0.9178,0.32293333333333335,0.9688,0.19699999999999998,0.985,0.9178,0.9447166666666662,0.9462247619047613,0.9583790685463628,0.9465534299939993
|
| 30 |
+
7.122507122507122,2500,0.9178,0.9686,0.9856,0.9178,0.9178,0.3228666666666667,0.9686,0.19712,0.9856,0.9178,0.9448433333333329,0.9462237301587298,0.9583360706069709,0.9465760314467667
|
| 31 |
+
7.407407407407407,2600,0.9184,0.9694,0.9856,0.9184,0.9184,0.32313333333333333,0.9694,0.19712,0.9856,0.9184,0.9453399999999996,0.9467295238095232,0.9587266587881651,0.9470744407226759
|
| 32 |
+
7.6923076923076925,2700,0.9184,0.9696,0.9854,0.9184,0.9184,0.3232,0.9696,0.19707999999999998,0.9854,0.9184,0.9452299999999996,0.9466565873015865,0.9587063233562559,0.9469863530316026
|
| 33 |
+
7.977207977207978,2800,0.9178,0.9694,0.9858,0.9178,0.9178,0.32313333333333333,0.9694,0.19716,0.9858,0.9178,0.9450566666666662,0.9463881746031738,0.9584692678806099,0.9467396474480428
|
| 34 |
+
8.262108262108262,2900,0.9184,0.9692,0.9858,0.9184,0.9184,0.3230666666666667,0.9692,0.19716,0.9858,0.9184,0.9451566666666662,0.9465150793650786,0.9585553275034318,0.9468657961140838
|
| 35 |
+
8.547008547008547,3000,0.9178,0.9692,0.9852,0.9178,0.9178,0.32306666666666667,0.9692,0.19703999999999997,0.9852,0.9178,0.9447699999999996,0.9462491269841264,0.9584001704198265,0.9465882311515644
|
| 36 |
+
8.831908831908832,3100,0.9182,0.9694,0.9854,0.9182,0.9182,0.32313333333333333,0.9694,0.19707999999999998,0.9854,0.9182,0.9449499999999996,0.9464100793650785,0.9585203799914772,0.9467427222866738
|
| 37 |
+
9.116809116809117,3200,0.9186,0.97,0.9854,0.9186,0.9186,0.3233333333333333,0.97,0.19707999999999998,0.9854,0.9186,0.9452433333333329,0.9466879365079358,0.958729257011403,0.947022835299621
|
| 38 |
+
9.401709401709402,3300,0.918,0.9702,0.9854,0.918,0.918,0.3234,0.9702,0.19707999999999998,0.9854,0.918,0.9449833333333331,0.9464248412698404,0.9585364250732368,0.9467604500159339
|
| 39 |
+
9.686609686609687,3400,0.9184,0.9702,0.9852,0.9184,0.9184,0.3234,0.9702,0.19703999999999997,0.9852,0.9184,0.9451433333333329,0.946628888888888,0.9586880746687382,0.9469662432012432
|
| 40 |
+
9.971509971509972,3500,0.9184,0.97,0.9852,0.9184,0.9184,0.3233333333333333,0.97,0.19703999999999997,0.9852,0.9184,0.9451033333333331,0.9465657142857136,0.9585962869405669,0.9469212791024237
|
final_metrics.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"val_cosine_accuracy@1": 0.9208,
|
| 3 |
+
"val_cosine_accuracy@3": 0.9698,
|
| 4 |
+
"val_cosine_accuracy@5": 0.9842,
|
| 5 |
+
"val_cosine_precision@1": 0.9208,
|
| 6 |
+
"val_cosine_precision@3": 0.3232666666666667,
|
| 7 |
+
"val_cosine_precision@5": 0.19684,
|
| 8 |
+
"val_cosine_recall@1": 0.9208,
|
| 9 |
+
"val_cosine_recall@3": 0.9698,
|
| 10 |
+
"val_cosine_recall@5": 0.9842,
|
| 11 |
+
"val_cosine_ndcg@10": 0.9593212690041523,
|
| 12 |
+
"val_cosine_mrr@1": 0.9208,
|
| 13 |
+
"val_cosine_mrr@5": 0.9460899999999998,
|
| 14 |
+
"val_cosine_mrr@10": 0.9476021428571432,
|
| 15 |
+
"val_cosine_map@100": 0.9479260307963899
|
| 16 |
+
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 114011616
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3c69983267a6db5ae9801964f057ecf353f9ae2741d24a0d28d157e7ee25803a
|
| 3 |
size 114011616
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 6161
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ddb13b4a71cfc0f5a0deb789459db15cf201f8e30be7b6d481e4467797f714fa
|
| 3 |
size 6161
|