CoolFace
Modelpublic

Trelis/ms-marco-MiniLM-L-6-v2-2-cst-ep-MNRLtriplets-2e-5-batch32-gpu-overlap

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

SentenceTransformer based on cross-encoder/ms-marco-MiniLM-L-6-v2

This is a sentence-transformers model finetuned from cross-encoder/ms-marco-MiniLM-L-6-v2. It maps sentences & paragraphs to a 384-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: cross-encoder/ms-marco-MiniLM-L-6-v2 <!-- at revision b2cfda50a1a9fc7919e7444afbb52610d268af92 -->
  • —Maximum Sequence Length: 512 tokens
  • —Output Dimensionality: 384 tokens
  • —Similarity Function: Cosine Similarity <!-- - 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: BertModel 
  (1): Pooling({'word_embedding_dimension': 384, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, '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("Trelis/ms-marco-MiniLM-L-6-v2-2-cst-ep-MNRLtriplets-2e-5-batch32-gpu-overlap")
# Run inference
sentences = [
    'What is the minimum number of digits allowed for identifying numbers according to clause 4.3.1?',
    '2. 2 teams playing unregistered players are liable to forfeit any match in which unregistered players have competed. fit playing rules - 5th edition copyright © touch football australia 2020 5 3 the ball 3. 1 the game is played with an oval, inflated ball of a shape, colour and size approved by fit or the nta. 3. 2 the ball shall be inflated to the manufacturers ’ recommended air pressure. 3. 3 the referee shall immediately pause the match if the size and shape of the ball no longer complies with clauses 3. 1 or 3. 2 to allow for the ball to replaced or the issue rectified. 3. 4 the ball must not be hidden under player attire. 4 playing uniform 4. 1 participating players are to be correctly attired in matching team uniforms 4. 2 playing uniforms consist of shirt, singlet or other item as approved by the nta or nta competition provider, shorts and / or tights and socks. 4. 3 all players are to wear a unique identifying number not less than 16cm in height, clearly displayed on the rear of the playing top. 4. 3. 1 identifying numbers must feature no more than two ( 2 ) digits.',
    '24. 5 for the avoidance of doubt for clauses 24. 3 and 24. 4 the non - offending team will retain a numerical advantage on the field of play during the drop - off. 25 match officials 25. 1 the referee is the sole judge on all match related matters inside the perimeter for the duration of a match, has jurisdiction over all players, coaches and officials and is required to : 25. 1. 1 inspect the field of play, line markings and markers prior to the commencement of the match to ensure the safety of all participants. 25. 1. 2 adjudicate on the rules of the game ; 25. 1. 3 impose any sanction necessary to control the match ; 25. 1. 4 award tries and record the progressive score ; 25. 1. 5 maintain a count of touches during each possession ; 25. 1. 6 award penalties for infringements against the rules ; and 25. 1. 7 report to the relevant competition administration any sin bins, dismissals or injuries to any participant sustained during a match. 25. 2 only team captains are permitted to seek clarification of a decision directly from the referee. an approach may only be made during a break in play or at the discretion of the referee.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]

# 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. -->

<!--

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 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: 2
  • —lr_scheduler_type: constant
  • —warmup_ratio: 0.3
  • —bf16: True
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
  • —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: 2
  • —max_steps: -1
  • —lr_scheduler_type: constant
  • —lr_scheduler_kwargs: {}
  • —warmup_ratio: 0.3
  • —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: True
  • —fp16: False
  • —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: False
  • —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: False
  • —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: False
  • —batch_sampler: batch_sampler
  • —multi_dataset_batch_sampler: proportional

</details>

Training Logs

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

EpochStepTraining Lossloss
0.006624.4256-
0.013144.1504-
0.019764.0494-
0.026284.0447-
0.0328103.9851-
0.0393123.9284-
0.0459143.9155-
0.0525163.8791-
0.0590183.8663-
0.0656203.9012-
0.0721223.8999-
0.0787243.7895-
0.0852263.7235-
0.0918283.7938-
0.0984303.5057-
0.1049323.5776-
0.1115343.5092-
0.1180363.7226-
0.1246383.5426-
0.1311403.7318-
0.1377423.529-
0.1443443.5977-
0.1508463.6484-
0.1574483.5026-
0.1639503.4568-
0.1705523.6119-
0.1770543.4206-
0.1836563.3701-
0.1902583.3232-
0.1967603.3398-
0.2033623.333-
0.2098643.3587-
0.2164663.1304-
0.2230683.0618-
0.2295703.145-
0.2361723.2074-
0.2426743.0436-
0.2492763.0572-
0.252577-3.0810
0.2557783.1225-
0.2623802.8197-
0.2689822.8979-
0.2754842.7827-
0.2820862.9472-
0.2885882.918-
0.2951902.7035-
0.3016922.6876-
0.3082942.8322-
0.3148962.6335-
0.3213982.3754-
0.32791003.0978-
0.33441022.4946-
0.34101042.5085-
0.34751062.7456-
0.35411082.3934-
0.36071102.3222-
0.36721122.4773-
0.37381142.6684-
0.38031162.2435-
0.38691182.243-
0.39341202.228-
0.41222.4652-
0.40661242.2113-
0.41311262.0805-
0.41971282.5041-
0.42621302.4489-
0.43281322.2474-
0.43931342.0252-
0.44591362.257-
0.45251381.9381-
0.45901402.0183-
0.46561422.1021-
0.47211442.1508-
0.47871461.9669-
0.48521481.7468-
0.49181501.8776-
0.49841521.8081-
0.50491541.67991.6088
0.51151561.9628-
0.51801581.8253-
0.52461601.7791-
0.53111621.8463-
0.53771641.6357-
0.54431661.6531-
0.55081681.6747-
0.55741701.5666-
0.56391721.7272-
0.57051741.6045-
0.57701761.3786-
0.58361781.6547-
0.59021801.6416-
0.59671821.4796-
0.60331841.4595-
0.60981861.4106-
0.61641881.4844-
0.62301901.4581-
0.62951921.4922-
0.63611941.2978-
0.64261961.2612-
0.64921981.4725-
0.65572001.3162-
0.66232021.3736-
0.66892041.4553-
0.67542061.4011-
0.68202081.2523-
0.68852101.3732-
0.69512121.3721-
0.70162141.5262-
0.70822161.2631-
0.71482181.6174-
0.72132201.4252-
0.72792221.3527-
0.73442241.1969-
0.74102261.2901-
0.74752281.4379-
0.75412301.1332-
0.7574231-1.0046
0.76072321.3693-
0.76722341.3097-
0.77382361.2314-
0.78032381.0873-
0.78692401.2882-
0.79342421.1723-
0.82441.1748-
0.80662461.2916-
0.81312481.0894-
0.81972501.2299-
0.82622521.207-
0.83282541.1361-
0.83932561.1323-
0.84592581.0927-
0.85252601.1433-
0.85902621.1088-
0.86562641.1384-
0.87212661.0962-
0.87872681.1878-
0.88522701.0113-
0.89182721.1411-
0.89842741.0289-
0.90492761.0163-
0.91152781.2859-
0.91802800.9449-
0.92462821.0941-
0.93112841.0908-
0.93772861.1028-
0.94432881.0633-
0.95082901.1004-
0.95742921.0483-
0.96392941.0064-
0.97052961.0088-
0.97702981.0068-
0.98363001.1903-
0.99023020.9401-
0.99673040.8369-
1.00333060.5046-
1.00983081.06260.8660
1.01643100.9587-
1.02303121.0565-
1.02953141.1329-
1.03613161.1857-
1.04263180.9777-
1.04923200.9883-
1.05573220.9076-
1.06233240.7942-
1.06893261.1952-
1.07543280.9726-
1.08203301.0663-
1.08853321.0337-
1.09513340.9522-
1.10163360.9813-
1.10823380.9057-
1.11483401.0076-
1.12133420.8557-
1.12793440.9341-
1.13443460.9188-
1.14103481.091-
1.14753500.8205-
1.15413521.0509-
1.16073540.9201-
1.16723561.0741-
1.17383580.8662-
1.18033600.9468-
1.18693620.8604-
1.19343640.8141-
1.23660.9475-
1.20663680.8407-
1.21313700.764-
1.21973720.798-
1.22623740.8205-
1.23283760.7995-
1.23933780.9305-
1.24593800.858-
1.25253820.8465-
1.25903840.7691-
1.2623385-0.7879
1.26563861.0073-
1.27213880.8026-
1.27873900.8108-
1.28523920.7783-
1.29183940.8766-
1.29843960.8576-
1.30493980.884-
1.31154000.9547-
1.31804020.9231-
1.32464040.8027-
1.33114060.9117-
1.33774080.7743-
1.34434100.8257-
1.35084120.8738-
1.35744140.972-
1.36394160.8297-
1.37054180.8941-
1.37704200.8513-
1.38364220.7588-
1.39024240.8332-
1.39674260.7682-
1.40334280.7916-
1.40984300.9519-
1.41644321.0526-
1.42304340.8724-
1.42954360.8267-
1.43614380.7672-
1.44264400.7977-
1.44924420.6947-
1.45574440.9042-
1.46234460.8971-
1.46894480.9655-
1.47544500.8512-
1.48204520.9421-
1.48854540.9501-
1.49514560.8214-
1.50164580.9335-
1.50824600.7617-
1.51484620.86010.7855
1.52134640.757-
1.52794660.7389-
1.53444680.8146-
1.54104700.9235-
1.54754720.9901-
1.55414740.9624-
1.56074760.8909-
1.56724780.7276-
1.57384800.9444-
1.58034820.874-
1.58694840.7985-
1.59344860.9335-
1.64880.8108-
1.60664900.7779-
1.61314920.8807-
1.61974940.8146-
1.62624960.9218-
1.63284980.8439-
1.63935000.7348-
1.64595020.8533-
1.65255040.7695-
1.65905060.7911-
1.66565080.837-
1.67215100.731-
1.67875120.911-
1.68525140.7963-
1.69185160.7719-
1.69845180.8011-
1.70495200.7428-
1.71155220.8159-
1.71805240.7833-
1.72465260.7934-
1.73115280.7854-
1.73775300.8398-
1.74435320.7875-
1.75085340.7282-
1.75745360.8269-
1.76395380.8033-
1.7672539-0.7595
1.77055400.9471-
1.77705420.941-
1.78365440.725-
1.79025460.8978-
1.79675480.8361-
1.80335500.7092-
1.80985520.809-
1.81645540.9399-
1.82305560.769-
1.82955580.7381-
1.83615600.7554-
1.84265620.8553-
1.84925640.919-
1.85575660.7479-
1.86235680.8381-
1.86895700.7911-
1.87545720.8076-
1.88205740.7868-
1.88855760.9147-
1.89515780.7271-
1.90165800.7201-
1.90825820.7538-
1.91485840.7522-
1.92135860.7737-
1.92795880.7187-
1.93445900.8713-
1.94105920.7971-
1.94755940.8226-
1.95415960.7074-
1.96075980.804-
1.96726000.7259-
1.97386020.7758-
1.98036040.8209-
1.98696060.7918-
1.99346080.7467-
2.06100.4324-

</details>

Framework Versions

  • —Python: 3.10.12
  • —Sentence Transformers: 3.0.1
  • —Transformers: 4.42.3
  • —PyTorch: 2.1.1+cu121
  • —Accelerate: 0.31.0
  • —Datasets: 2.17.1
  • —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. -->