CoolFace
Modelpublic

antonkirk/retrieval-mpnet-dot-finetuned-llama3-synthetic-dataset

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes23downloads
Model Card

SentenceTransformer based on sentence-transformers/multi-qa-mpnet-base-dot-v1

This is a sentence-transformers model finetuned from sentence-transformers/multi-qa-mpnet-base-dot-v1. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.

Model Details

Model Description

  • —Model Type: Sentence Transformer
  • —Base model: sentence-transformers/multi-qa-mpnet-base-dot-v1 <!-- at revision 3af7c6da5b3e1bea796ef6c97fe237538cbe6e7f -->
  • —Maximum Sequence Length: 512 tokens
  • —Output Dimensionality: 768 tokens
  • —Similarity Function: Dot Product <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: MPNetModel 
  (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

bash
pip install -U sentence-transformers

Then you can load this model and run inference.

python
from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("sentence_transformers_model_id")
# Run inference
sentences = [
    'ear malformations, nipple abnormalities, dental anomalies',
    'A number sign (#) is used with this entry because scalp-ear-nipple syndrome (SENS) is caused by heterozygous mutation in the KCTD1 gene (613420) on chromosome 18q11.\n\nDescription\n\nScalp-ear-nipple syndrome is characterized by aplasia cutis congenita of the scalp, breast anomalies that range from hypothelia or athelia to amastia, and minor anomalies of the external ears. Less frequent clinical characteristics include nail dystrophy, dental anomalies, cutaneous syndactyly of the digits, and renal malformations. Penetrance appears to be high, although there is substantial variable expressivity within families (Marneros et al., 2013).\n\nClinical Features',
    'This article is an orphan, as no other articles link to it. Please introduce links to this page from related articles; try the Find link tool for suggestions. (July 2016)  \n  \nInguinal lymphadenopathy  \nInguinal lymphadenopathy  \n  \nInguinal lymphadenopathy causes swollen lymph nodes in the groin area. It can be a symptom of infective or neoplastic processes. Infective aetiologies include Tuberculosis, HIV, non-specific or reactive lymphadenopathy to recent lower limb infection or groin infections. Another notable infectious cause is Lymphogranuloma venereum, which is a sexually transmitted infection of the lymphatic system. Neoplastic aetiologies include lymphoma, leukaemia and metastatic disease from primary tumours in the lower limb, external genitalia or perianal region and melanoma.\n\n## References[edit]\n\n  * Ferrer R (October 1998). "Lymphadenopathy: differential diagnosis and evaluation". Am Fam Physician. 58 (6): 1313–20. PMID 9803196.\n\n## Further reading[edit]',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

<!--

Direct Usage (Transformers)

<details><summary>Click to see the direct usage in Transformers</summary>

</details> -->

<!--

Downstream Usage (Sentence Transformers)

You can finetune this model on your own dataset.

<details><summary>Click to expand</summary>

</details> -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

Evaluation

Metrics

Information Retrieval
MetricValue
cosine_accuracy@10.1807
cosine_accuracy@30.5427
cosine_accuracy@50.7381
cosine_accuracy@100.8161
cosine_precision@10.1807
cosine_precision@30.1809
cosine_precision@50.1476
cosine_precision@100.0816
cosine_recall@10.1807
cosine_recall@30.5427
cosine_recall@50.7381
cosine_recall@100.8161
cosine_ndcg@100.4947
cosine_mrr@100.3907
cosine_map@1000.3953
dot_accuracy@10.1827
dot_accuracy@30.5413
dot_accuracy@50.743
dot_accuracy@100.8167
dot_precision@10.1827
dot_precision@30.1804
dot_precision@50.1486
dot_precision@100.0817
dot_recall@10.1827
dot_recall@30.5413
dot_recall@50.743
dot_recall@100.8167
dot_ndcg@100.4957
dot_mrr@100.3918
dot_map@1000.3963

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Dataset

Unnamed Dataset
  • —Size: 98,928 training samples
  • —Columns: <code>queries</code> and <code>chunks</code>
  • —Approximate statistics based on the first 1000 samples: | | queries | chunks | |:--------|:---------------------------------------------------------------------------------|:------------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 7 tokens</li><li>mean: 17.4 tokens</li><li>max: 76 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 159.93 tokens</li><li>max: 334 tokens</li></ul> |
  • —Samples: | queries | chunks | |:-------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <code>fever, malaise, headaches, lymphadenopathy</code> | <code>A rare, acquired, self-limiting, infectious disease due to the mite-borne bacteria Rickettsia akari characterized by an asymptomatic, 0.5 to 2 cm in diameter papulovesicle that typically ulcerates and forms an eschar, followed by a generalized papulovesicular rash associating variable constitutional symptoms, such as localized lymphadenopathy, fever, malaise, and headaches. Additonal symptoms may include diaphoresis, myalgia and, less frequently, rhinorrhea, pharyngitis, nausea, vomiting, splenomegaly, conjunctival hyperemia, and abdominal pain. Systemic symtoms resolve within 6-10 days.</code> | | <code>rash, papulovesicular, generalized, constitutional symptoms</code> | <code>A rare, acquired, self-limiting, infectious disease due to the mite-borne bacteria Rickettsia akari characterized by an asymptomatic, 0.5 to 2 cm in diameter papulovesicle that typically ulcerates and forms an eschar, followed by a generalized papulovesicular rash associating variable constitutional symptoms, such as localized lymphadenopathy, fever, malaise, and headaches. Additonal symptoms may include diaphoresis, myalgia and, less frequently, rhinorrhea, pharyngitis, nausea, vomiting, splenomegaly, conjunctival hyperemia, and abdominal pain. Systemic symtoms resolve within 6-10 days.</code> | | <code>myalgia, diaphoresis, nausea, vomiting</code> | <code>A rare, acquired, self-limiting, infectious disease due to the mite-borne bacteria Rickettsia akari characterized by an asymptomatic, 0.5 to 2 cm in diameter papulovesicle that typically ulcerates and forms an eschar, followed by a generalized papulovesicular rash associating variable constitutional symptoms, such as localized lymphadenopathy, fever, malaise, and headaches. Additonal symptoms may include diaphoresis, myalgia and, less frequently, rhinorrhea, pharyngitis, nausea, vomiting, splenomegaly, conjunctival hyperemia, and abdominal pain. Systemic symtoms resolve within 6-10 days.</code> |
  • —Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 1,
      "similarity_fct": "dot_score"
  }

Evaluation Dataset

Unnamed Dataset
  • —Size: 9,308 evaluation samples
  • —Columns: <code>queries</code> and <code>chunks</code>
  • —Approximate statistics based on the first 1000 samples: | | queries | chunks | |:--------|:---------------------------------------------------------------------------------|:------------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 7 tokens</li><li>mean: 17.8 tokens</li><li>max: 48 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 166.19 tokens</li><li>max: 299 tokens</li></ul> |
  • —Samples: | queries | chunks | |:-------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <code>facial features, overgrowth, learning disabilities, delayed development</code> | <code>Sotos syndrome is a condition characterized mainly by distinctive facial features; overgrowth in childhood; and learning disabilities or delayed development. Facial features may include a long, narrow face; a high forehead; flushed (reddened) cheeks; a small, pointed chin; and down-slanting palpebral fissures. Affected infants and children tend to grow quickly; they are significantly taller than their siblings and peers and have a large head. Other signs and symptoms may include intellectual disability; behavioral problems; problems with speech and language; and/or weak muscle tone (hypotonia). Sotos syndrome is usually caused by a mutation in the NSD1 gene and is inherited in an autosomal dominant manner. About 95% of cases are due to a new mutation in the affected person and occur sporadically (are not inherited).</code> | | <code>long face, high forehead, flushed cheeks, small chin, down-slanting palpebral fissures</code> | <code>Sotos syndrome is a condition characterized mainly by distinctive facial features; overgrowth in childhood; and learning disabilities or delayed development. Facial features may include a long, narrow face; a high forehead; flushed (reddened) cheeks; a small, pointed chin; and down-slanting palpebral fissures. Affected infants and children tend to grow quickly; they are significantly taller than their siblings and peers and have a large head. Other signs and symptoms may include intellectual disability; behavioral problems; problems with speech and language; and/or weak muscle tone (hypotonia). Sotos syndrome is usually caused by a mutation in the NSD1 gene and is inherited in an autosomal dominant manner. About 95% of cases are due to a new mutation in the affected person and occur sporadically (are not inherited).</code> | | <code>intellectual disability, behavioral problems, speech and language difficulties, hypotonia</code> | <code>Sotos syndrome is a condition characterized mainly by distinctive facial features; overgrowth in childhood; and learning disabilities or delayed development. Facial features may include a long, narrow face; a high forehead; flushed (reddened) cheeks; a small, pointed chin; and down-slanting palpebral fissures. Affected infants and children tend to grow quickly; they are significantly taller than their siblings and peers and have a large head. Other signs and symptoms may include intellectual disability; behavioral problems; problems with speech and language; and/or weak muscle tone (hypotonia). Sotos syndrome is usually caused by a mutation in the NSD1 gene and is inherited in an autosomal dominant manner. About 95% of cases are due to a new mutation in the affected person and occur sporadically (are not inherited).</code> |
  • —Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 1,
      "similarity_fct": "dot_score"
  }

Training Hyperparameters

Non-Default Hyperparameters
  • —eval_strategy: steps
  • —per_device_train_batch_size: 32
  • —per_device_eval_batch_size: 32
  • —learning_rate: 2e-05
  • —num_train_epochs: 25
  • —warmup_ratio: 0.1
  • —fp16: True
  • —load_best_model_at_end: True
  • —eval_on_start: True
  • —batch_sampler: no_duplicates
All Hyperparameters

<details><summary>Click to expand</summary>

  • —overwrite_output_dir: False
  • —do_predict: False
  • —eval_strategy: steps
  • —prediction_loss_only: True
  • —per_device_train_batch_size: 32
  • —per_device_eval_batch_size: 32
  • —per_gpu_train_batch_size: None
  • —per_gpu_eval_batch_size: None
  • —gradient_accumulation_steps: 1
  • —eval_accumulation_steps: None
  • —torch_empty_cache_steps: None
  • —learning_rate: 2e-05
  • —weight_decay: 0.0
  • —adam_beta1: 0.9
  • —adam_beta2: 0.999
  • —adam_epsilon: 1e-08
  • —max_grad_norm: 1.0
  • —num_train_epochs: 25
  • —max_steps: -1
  • —lr_scheduler_type: linear
  • —lr_scheduler_kwargs: {}
  • —warmup_ratio: 0.1
  • —warmup_steps: 0
  • —log_level: passive
  • —log_level_replica: warning
  • —log_on_each_node: True
  • —logging_nan_inf_filter: True
  • —save_safetensors: True
  • —save_on_each_node: False
  • —save_only_model: False
  • —restore_callback_states_from_checkpoint: False
  • —no_cuda: False
  • —use_cpu: False
  • —use_mps_device: False
  • —seed: 42
  • —data_seed: None
  • —jit_mode_eval: False
  • —use_ipex: False
  • —bf16: False
  • —fp16: True
  • —fp16_opt_level: O1
  • —half_precision_backend: auto
  • —bf16_full_eval: False
  • —fp16_full_eval: False
  • —tf32: None
  • —local_rank: 0
  • —ddp_backend: None
  • —tpu_num_cores: None
  • —tpu_metrics_debug: False
  • —debug: []
  • —dataloader_drop_last: True
  • —dataloader_num_workers: 0
  • —dataloader_prefetch_factor: None
  • —past_index: -1
  • —disable_tqdm: False
  • —remove_unused_columns: True
  • —label_names: None
  • —load_best_model_at_end: True
  • —ignore_data_skip: False
  • —fsdp: []
  • —fsdp_min_num_params: 0
  • —fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • —fsdp_transformer_layer_cls_to_wrap: None
  • —accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • —deepspeed: None
  • —label_smoothing_factor: 0.0
  • —optim: adamw_torch
  • —optim_args: None
  • —adafactor: False
  • —group_by_length: False
  • —length_column_name: length
  • —ddp_find_unused_parameters: None
  • —ddp_bucket_cap_mb: None
  • —ddp_broadcast_buffers: False
  • —dataloader_pin_memory: True
  • —dataloader_persistent_workers: False
  • —skip_memory_metrics: True
  • —use_legacy_prediction_loop: False
  • —push_to_hub: False
  • —resume_from_checkpoint: None
  • —hub_model_id: None
  • —hub_strategy: every_save
  • —hub_private_repo: False
  • —hub_always_push: False
  • —gradient_checkpointing: False
  • —gradient_checkpointing_kwargs: None
  • —include_inputs_for_metrics: False
  • —eval_do_concat_batches: True
  • —fp16_backend: auto
  • —push_to_hub_model_id: None
  • —push_to_hub_organization: None
  • —mp_parameters:
  • —auto_find_batch_size: False
  • —full_determinism: False
  • —torchdynamo: None
  • —ray_scope: last
  • —ddp_timeout: 1800
  • —torch_compile: False
  • —torch_compile_backend: None
  • —torch_compile_mode: None
  • —dispatch_batches: None
  • —split_batches: None
  • —include_tokens_per_second: False
  • —include_num_input_tokens_seen: False
  • —neftune_noise_alpha: None
  • —optim_target_modules: None
  • —batch_eval_metrics: False
  • —eval_on_start: True
  • —eval_use_gather_object: False
  • —batch_sampler: no_duplicates
  • —multi_dataset_batch_sampler: proportional

</details>

Training Logs

<details><summary>Click to expand</summary>

EpochStepTraining Losslossdot_map@100
00-1.87010.2095
0.12951001.5494--
0.25912000.9993--
0.38863000.7225--
0.51814000.6533--
0.64775000.66180.59390.3722
0.77726000.6454--
0.90677000.5568--
1.03638000.5435--
1.16589000.499--
1.295310000.53860.47680.3842
1.424911000.5077--
1.554412000.4929--
1.683913000.5194--
1.813514000.5157--
1.943015000.43370.44550.3894
2.072516000.4373--
2.202117000.4569--
2.331618000.4084--
2.461119000.42--
2.590720000.41120.45780.3886
2.720221000.4498--
2.849722000.415--
2.979323000.3734--
3.108824000.3359--
3.238325000.39230.43390.3929
3.367926000.3345--
3.497427000.3324--
3.626928000.3574--
3.756529000.4078--
3.886030000.32210.42930.3904
4.015531000.2895--
4.145132000.2821--
4.274633000.3192--
4.404134000.28--
4.533735000.27160.44860.3885
4.663236000.3147--
4.792737000.3565--
4.922338000.2465--
5.051839000.2436--
5.181340000.22970.44860.3917
5.310941000.2538--
5.440442000.2448--
5.569943000.2433--
5.699544000.3017--
5.829045000.29580.47370.3934
5.958546000.2142--
6.088147000.1939--
6.217648000.2449--
6.347249000.2026--
6.476750000.20060.49010.3895
6.606251000.2118--
6.735852000.3064--
6.865353000.2276--
6.994854000.1809--
7.124455000.17820.49920.3915
7.253956000.2211--
7.383457000.1728--
7.513058000.1651--
7.642559000.2158--
7.772060000.28640.51130.3892
7.901661000.179--
8.031162000.1677--
8.160663000.1517--
8.290264000.1851--
8.419765000.16460.50300.3933
8.549266000.1608--
8.678867000.217--
8.808368000.2357--
8.937869000.1404--
9.067470000.14650.51530.3877
9.196971000.1791--
9.326472000.1261--
9.456073000.1406--
9.585574000.1626--
9.715075000.2230.53260.3939
9.844676000.1806--
9.974177000.1289--
10.103678000.1269--
10.233279000.1609--
10.362780000.12790.51130.3933
10.492281000.1264--
10.621882000.1453--
10.751383000.2227--
10.880884000.1314--
11.010485000.11920.54440.3925
11.139986000.1164--
11.269487000.1418--
11.399088000.1202--
11.528589000.1152--
11.65890000.14540.5290.3963
11.787691000.1952--
11.917192000.1079--
12.046693000.1139--
12.176294000.1067--
12.305795000.12190.52570.3938
12.435296000.119--
12.564897000.1195--
12.694398000.158--
12.823899000.156--
12.9534100000.09740.54340.3934
13.0829101000.0928--
13.2124102000.1266--
13.3420103000.0964--
13.4715104000.1007--
13.6010105000.1120.57890.3893
13.7306106000.1699--
13.8601107000.1084--
13.9896108000.0967--
14.1192109000.0856--
14.2487110000.11420.52520.3933
14.3782111000.0891--
14.5078112000.0911--
14.6373113000.1128--
14.7668114000.1686--
14.8964115000.08740.58740.3945
15.0259116000.0909--
15.1554117000.0778--
15.2850118000.1055--
15.4145119000.0872--
15.5440120000.08840.58940.3934
15.6736121000.1101--
15.8031122000.1354--
15.9326123000.0762--
16.0622124000.0782--
16.1917125000.09360.55890.3919
16.3212126000.072--
16.4508127000.0806--
16.5803128000.0929--
16.7098129000.1215--
16.8394130000.10390.60250.3926
16.9689131000.0738--
17.0984132000.0651--
17.2280133000.0943--
17.3575134000.0678--
17.4870135000.0770.60020.3941
17.6166136000.0839--
17.7461137000.1268--
17.8756138000.0764--
18.0052139000.0686--
18.1347140000.06970.58980.3913
18.2642141000.0871--
18.3938142000.0699--
18.5233143000.0611--
18.6528144000.0872--
18.7824145000.12810.60870.3927
18.9119146000.0583--
19.0415147000.0658--
19.1710148000.0595--
19.3005149000.0816--
19.4301150000.06990.60780.3965
19.5596151000.0729--
19.6891152000.0908--
19.8187153000.0978--
19.9482154000.0585--
20.0777155000.05570.58610.3925
20.2073156000.0787--
20.3368157000.061--
20.4663158000.0638--
20.5959159000.0656--
20.7254160000.10030.60320.3923
20.8549161000.0718--
20.9845162000.0625--
21.1140163000.0532--
21.2435164000.0739--
21.3731165000.05520.60800.3942
21.5026166000.0588--
21.6321167000.0716--
21.7617168000.1078--
21.8912169000.0559--
22.0207170000.05960.60440.3922
22.1503171000.0512--
22.2798172000.0716--
22.4093173000.0574--
22.5389174000.058--
22.6684175000.070.61170.3942
22.7979176000.0965--
22.9275177000.0507--
23.0570178000.0498--
23.1865179000.0524--
23.3161180000.06560.59360.3936
23.4456181000.057--
23.5751182000.0619--
23.7047183000.0785--
23.8342184000.0729--
23.9637185000.05410.61740.3979
24.0933186000.0456--
24.2228187000.0696--
24.3523188000.048--
24.4819189000.0547--
24.6114190000.05530.61460.3962
24.7409191000.0936--
24.8705192000.0579--
25.0193000.04980.52900.3963
  • —The bold row denotes the saved checkpoint. </details>

Framework Versions

  • —Python: 3.11.9
  • —Sentence Transformers: 3.0.1
  • —Transformers: 4.43.3
  • —PyTorch: 2.3.1+cu121
  • —Accelerate: 0.30.1
  • —Datasets: 2.19.2
  • —Tokenizers: 0.19.1

Citation

BibTeX

Sentence Transformers
bibtex
@inproceedings{reimers-2019-sentence-bert,
    title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
    author = "Reimers, Nils and Gurevych, Iryna",
    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
    month = "11",
    year = "2019",
    publisher = "Association for Computational Linguistics",
    url = "https://arxiv.org/abs/1908.10084",
}
MultipleNegativesRankingLoss
bibtex
@misc{henderson2017efficient,
    title={Efficient Natural Language Response Suggestion for Smart Reply}, 
    author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
    year={2017},
    eprint={1705.00652},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->