krumeto's picture
Add new SentenceTransformer model.
5e1186f verified
metadata
base_model: Snowflake/snowflake-arctic-embed-xs
datasets: []
language:
  - en
library_name: sentence-transformers
license: apache-2.0
metrics:
  - cosine_accuracy
  - dot_accuracy
  - manhattan_accuracy
  - euclidean_accuracy
  - max_accuracy
pipeline_tag: sentence-similarity
tags:
  - sentence-transformers
  - sentence-similarity
  - feature-extraction
  - generated_from_trainer
  - dataset_size:100000
  - loss:MultipleNegativesRankingLoss
widget:
  - source_sentence: >-
      Represent this sentence for searching relevant passages: what is spider
      silk made of
    sentences:
      - >-
        Arachnid Pictures. Spider's silk is made up of chains of amino acids. In
        other words, it is simply a protein (see How Food Works for details on
        amino acids and proteins). The two primary amino acids are glycine and
        alanine. Spider silk is extremely strong -- it is about five times
        stronger than steel and twice as strong as Kevlar of the same weight.
      - >-
        Spider silk is made of several kinds of proteins. These proteins are
        processed and stored within the spider's abdomen. Spiders typically have
        six or eight spinnerets, organs at the rear of their abdomen, through
        which they extrude the silk proteins.
      - >-
        Neon is the second lightest noble gas, after helium, and it has an
        atomic number of 10. On the periodic table, it is identified with the
        symbol Ne. The noble gases were recognized in the late 1800s, when
        scientists realized that an entire class of gases was missing from the
        periodic table of elements.
  - source_sentence: >-
      Represent this sentence for searching relevant passages: what is a caring
      community of learners
    sentences:
      - >-
        A couple of my friends and I made hot ice for our school science fair.
        We used sodium acetate. This project won first place at my schools
        science fair!!! Materials: Stove. Pot. A spoon. A glass cup. and Sodium
        acetate (you can find it online or in certain heat packs). How to do it:
        You heat water in a pot and put the sodium acetate in the water.
      - >-
        Caring Community of Learners. A group or classroom in which children and
        adults engage in warm, positive relationships; treat each other with
        respect; and learn from and with each other. Self-concept. Children's
        stable perceptions about themselves despite variations in their
        behavior.
      - >-
        Transcript of Creating a Caring Community of Caring Learners: - Caring
        Community of Learners: Group or classroom in which children and adults
        have positive, respectful relationships and learn from each other. -
        attachment theory: children's ability to learn depends on trusting
        relationships with caregivers.
  - source_sentence: >-
      Represent this sentence for searching relevant passages: what does dark
      circles around deep set eyes mean
    sentences:
      - >-
        Production Planner, Manufacturing Salary. (United States). The average
        salary for a Production Planner, Manufacturing is $51,962 per year. A
        skill in SAP Enterprise Resource Planning (ERP) is associated with high
        pay for this job. People in this job generally don't have more than 20
        years' experience.
      - >-
        Symptoms & Signs. Dark circles under the eyes are a common complaint of
        both men and women, although they can occasionally be seen in children.
        As people age, the skin becomes thinner and collagen is lost, sometimes
        enhancing the appearance of blood vessels beneath the eyes and making
        the area appear darker.
      - >-
        What are dark circles under the eyes? Dark circles under the eyes,
        sometimes called shadows or dark rings under the eyes, are the
        appearance of dark skin between the lower eyelid and the top of the
        cheek. Dark circles under the eyes can occur in infants, children,
        adolescents and adults, and to men and women alike. It is commonly
        assumed that dark circles under the eyes are caused by a lack of sleep,
        and poor quality sleep and insomnia can certainly cause this condition.
  - source_sentence: >-
      Represent this sentence for searching relevant passages: how big is rv
      access
    sentences:
      - >-
        The average length of bigger RVs is between 7.6 meters to 12 meters or
        25 feet to 40 feet. These vehicles are usually packed with different
        interesting features, most of which are intended to offer luxury and
        convenience.
      - >-
        Murder, My Sweet (released as Farewell, My Lovely in the United Kingdom)
        is a 1944 American film noir, directed by Edward Dmytryk and starring
        Dick Powell, Claire Trevor, and Anne Shirley. The film is based on
        Raymond Chandler 's 1940 novel Farewell, My Lovely. A second film
        adaptation of the novel was made in 1975 and released under Chandler's
        title. Murder, My Sweet turned out to be Anne Shirley's final film. She
        retired from acting in 1944 at age 26.
      - >-
        It should be wider then the rv.....lol sorry could not pass that one up.
        A standard RV is normally around 96 inches wide at most, newer larger
        class A's are around 102 inches wide. This width does not include
        mirrors or other safety equipment..... Last edited by rtandc; 10-22-2010
        at 05:41 AM..
  - source_sentence: >-
      Represent this sentence for searching relevant passages: how many pitchers
      used per game
    sentences:
      - >-
        Trackback - A method by which a blogger receives notification which
        other bloggers link to his or her blog entry
      - >-
        Accroding to the statistics in the Baseball Reference page showing 2014
        Major League Baseball Pitching Pitches, 745 pitchers threw 704,983
        pitches in 2430 games for an average of 290 pitches per game.
      - >-
        In modern day baseball, teams generally have five starting pitchers, and
        they take it in turn to start a game every fifth day (hence the phrase
        rotation). Sometimes, if the schedule pans out, a team can get away with
        a four man rotation, and in the distant past some teams managed a three
        man rotation.
model-index:
  - name: Fine-tuned snowflake actic xs based on MS-Marco triplets
    results:
      - task:
          type: triplet
          name: Triplet
        dataset:
          name: xs msmarco triplet
          type: xs-msmarco-triplet
        metrics:
          - type: cosine_accuracy
            value: 0.571
            name: Cosine Accuracy
          - type: dot_accuracy
            value: 0.4286
            name: Dot Accuracy
          - type: manhattan_accuracy
            value: 0.5728
            name: Manhattan Accuracy
          - type: euclidean_accuracy
            value: 0.571
            name: Euclidean Accuracy
          - type: max_accuracy
            value: 0.5728
            name: Max Accuracy
      - task:
          type: triplet
          name: Triplet
        dataset:
          name: xs msmarco triplet train
          type: xs-msmarco-triplet-train
        metrics:
          - type: cosine_accuracy
            value: 0.5696
            name: Cosine Accuracy
          - type: dot_accuracy
            value: 0.43
            name: Dot Accuracy
          - type: manhattan_accuracy
            value: 0.5674
            name: Manhattan Accuracy
          - type: euclidean_accuracy
            value: 0.5696
            name: Euclidean Accuracy
          - type: max_accuracy
            value: 0.5696
            name: Max Accuracy

Fine-tuned snowflake actic xs based on MS-Marco triplets

This is a sentence-transformers model finetuned from Snowflake/snowflake-arctic-embed-xs on the sentence-transformers/msmarco-msmarco-mini_lm-l-6-v3 dataset. 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: Snowflake/snowflake-arctic-embed-xs
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 384 tokens
  • Similarity Function: Cosine Similarity
  • Training Dataset:
    • sentence-transformers/msmarco-msmarco-mini_lm-l-6-v3
  • Language: en
  • License: apache-2.0

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': 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})
  (2): Normalize()
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

pip install -U sentence-transformers

Then you can load this model and run inference.

from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("krumeto/snowflake-arctic-embed-xs-ms-marco-triplet")
# Run inference
sentences = [
    'Represent this sentence for searching relevant passages: how many pitchers used per game',
    'In modern day baseball, teams generally have five starting pitchers, and they take it in turn to start a game every fifth day (hence the phrase rotation). Sometimes, if the schedule pans out, a team can get away with a four man rotation, and in the distant past some teams managed a three man rotation.',
    'Accroding to the statistics in the Baseball Reference page showing 2014 Major League Baseball Pitching Pitches, 745 pitchers threw 704,983 pitches in 2430 games for an average of 290 pitches per game.',
]
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]

Evaluation

Metrics

Triplet

Metric Value
cosine_accuracy 0.571
dot_accuracy 0.4286
manhattan_accuracy 0.5728
euclidean_accuracy 0.571
max_accuracy 0.5728

Triplet

Metric Value
cosine_accuracy 0.5696
dot_accuracy 0.43
manhattan_accuracy 0.5674
euclidean_accuracy 0.5696
max_accuracy 0.5696

Training Details

Training Dataset

sentence-transformers/msmarco-msmarco-mini_lm-l-6-v3

  • Dataset: sentence-transformers/msmarco-msmarco-mini_lm-l-6-v3
  • Size: 100,000 training samples
  • Columns: query, positive, and negative
  • Approximate statistics based on the first 1000 samples:
    query positive negative
    type string string string
    details
    • min: 12 tokens
    • mean: 17.05 tokens
    • max: 36 tokens
    • min: 19 tokens
    • mean: 78.68 tokens
    • max: 212 tokens
    • min: 16 tokens
    • mean: 73.73 tokens
    • max: 205 tokens
  • Samples:
    query positive negative
    Represent this sentence for searching relevant passages: what are the liberal arts? liberal arts. 1. the academic course of instruction at a college intended to provide general knowledge and comprising the arts, humanities, natural sciences, and social sciences, as opposed to professional or technical subjects. Liberal Arts Defined. The liberal arts are a set of academic disciplines that include the sciences and the humanities. When you study a liberal arts curriculum, you don't have to have one specific career goal, although you might. Instead, you'll assemble a broad foundation of knowledge that can be used in a wide spectrum of careers.
    Represent this sentence for searching relevant passages: what is the mechanism of action of fibrinolytic or thrombolytic drugs? Baillière's Clinical Haematology. 6 Mechanism of action of the thrombolytic agents. 6 Mechanism of action of the thrombolytic agents JEFFREY I. WEITZ Fibrin formed during the haemostatic, inflammatory or tissue repair process serves a temporary role, and must be degraded to restore normal tissue function and structure. Fibrinolytic drug. Fibrinolytic drug, also called thrombolytic drug, any agent that is capable of stimulating the dissolution of a blood clot (thrombus). Fibrinolytic drugs work by activating the so-called fibrinolytic pathway.
    Represent this sentence for searching relevant passages: what is normal plat count 78 Followers. A. Platelets are the tiny blood cells that help stop bleeding by binding together to form a clump or plug at sites of injury inside blood vessels. A normal platelet count is between 150,000 and 450,000 platelets per microliter (one-millionth of a liter, abbreviated mcL).The average platelet count is 237,000 per mcL in men and 266,000 per mcL in women.8 Followers. A. Platelets are the tiny blood cells that help stop bleeding by binding together to form a clump or plug at sites of injury inside blood vessels. A normal platelet count is between 150,000 and 450,000 platelets per microliter (one-millionth of a liter, abbreviated mcL). In the context of blood work, PLT refers to the platelet count. Platelets are the cells that cause blood clotting and control bleeding. The normal range of platelets for adults is 3.5 to 10.5 billion cells per liter of blood, according to the Mayo Clinic. Continue Reading.
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Evaluation Dataset

sentence-transformers/msmarco-msmarco-mini_lm-l-6-v3

  • Dataset: sentence-transformers/msmarco-msmarco-mini_lm-l-6-v3
  • Size: 5,000 evaluation samples
  • Columns: query, positive, and negative
  • Approximate statistics based on the first 1000 samples:
    query positive negative
    type string string string
    details
    • min: 12 tokens
    • mean: 17.09 tokens
    • max: 35 tokens
    • min: 21 tokens
    • mean: 80.07 tokens
    • max: 250 tokens
    • min: 16 tokens
    • mean: 76.73 tokens
    • max: 341 tokens
  • Samples:
    query positive negative
    Represent this sentence for searching relevant passages: what is the name of the material harder than diamonds Nano-material is harder than diamonds By Will Knight A material that is harder than diamond has been created in the lab, by packing together tiny “nanorods” of carbon. The new material, known as aggregated carbon nanorods (ACNR), was created by compressing and heating super-strong carbon molecules called buckyballs or carbon-60. What material is stronger than diamond? Diamonds are famous for their hardness, but not particularly for strength,since they are easily cleaved to create the facets that make the different cuts of diamonds for setting in a ring or necklace. Many materials are stronger than diamonds, only a couple of synthesized materials are harder than diamonds.
    Represent this sentence for searching relevant passages: is pink impression a perennial tulip? Tulip Pink Impression. close video. VIDEO. Tulip Pink Impression. The rich pink blooms of this hybrid are bound to make an impression, whether used in the landscape or as a cut flower. Robust stems and giant blooms characterise the range, and this hybrid is no exception. ‘Pink Impression’ will continue to impress thanks to the perennial potential of this range. Tulip Pink Impression. The lustrous petals are a deep, rich rose at the center, shading to a delicate pale pink at the edge, while doing amazing things in between that include shades of both melon and sunset. Tall, strong, long-lasting and reliable, like most Darwin hybrids. An absolutely first-class Tulip.
    Represent this sentence for searching relevant passages: define: colonization Colonization. the settlement and economic development of the uninhabited borderlands of a country (internal colonization) or the establishment of settlements (engaging primarily in agricultural activity) beyond the frontiers of a country (external colonization). Colonization is a process by which a central system of power dominates the surrounding land and its components. The term is derived from the Latin word colere, which means to inhabit. Also, colonization refers strictly to migration, for example, to settler colonies in America or Australia, trading posts, and plantations, while colonialism deals with this, along with ruling the existing indigenous peoples of styled new territories. Colonization was linked to the spread of tens of millions fro
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • num_train_epochs: 1
  • warmup_ratio: 0.1
  • fp16: True
  • batch_sampler: no_duplicates

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: steps
  • prediction_loss_only: True
  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • learning_rate: 5e-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: 1
  • 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: 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: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': 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: no_duplicates
  • multi_dataset_batch_sampler: proportional

Training Logs

Epoch Step Training Loss loss xs-msmarco-triplet-train_max_accuracy xs-msmarco-triplet_max_accuracy
0 0 - - - 0.3648
0.016 100 1.0213 1.0078 - 0.3672
0.032 200 0.9785 0.9630 - 0.3764
0.048 300 0.9591 0.9190 - 0.4014
0.064 400 0.9088 0.8906 - 0.4392
0.08 500 0.9215 0.8707 - 0.4598
0.096 600 0.8692 0.8681 - 0.4874
0.112 700 0.8806 0.8538 - 0.4964
0.128 800 0.8801 0.8477 - 0.5106
0.144 900 0.8692 0.8414 - 0.5228
0.16 1000 0.8624 0.8391 - 0.5194
0.176 1100 0.8737 0.8397 - 0.5264
0.192 1200 0.8505 0.8344 - 0.5214
0.208 1300 0.8818 0.8358 - 0.5164
0.224 1400 0.8464 0.8269 - 0.5326
0.24 1500 0.8623 0.8291 - 0.5232
0.256 1600 0.8203 0.8407 - 0.5328
0.272 1700 0.8566 0.8257 - 0.5302
0.288 1800 0.8386 0.8198 - 0.5364
0.304 1900 0.8587 0.8172 - 0.5388
0.32 2000 0.8472 0.8233 - 0.5568
0.336 2100 0.8466 0.8188 - 0.5468
0.352 2200 0.8273 0.8190 - 0.5386
0.368 2300 0.8356 0.8183 - 0.5396
0.384 2400 0.8294 0.8156 - 0.5538
0.4 2500 0.8274 0.8168 - 0.5448
0.416 2600 0.8392 0.8093 - 0.5422
0.432 2700 0.8541 0.8087 - 0.5426
0.448 2800 0.8218 0.8086 - 0.5474
0.464 2900 0.8446 0.8062 - 0.554
0.48 3000 0.8405 0.8076 - 0.548
0.496 3100 0.8447 0.8087 - 0.553
0.512 3200 0.8453 0.8073 - 0.5536
0.528 3300 0.8371 0.8089 - 0.5504
0.544 3400 0.8548 0.8005 - 0.5516
0.56 3500 0.8162 0.8026 - 0.5572
0.576 3600 0.8577 0.7994 - 0.5558
0.592 3700 0.8289 0.7990 - 0.5526
0.608 3800 0.824 0.7967 - 0.562
0.624 3900 0.833 0.7959 - 0.5608
0.64 4000 0.8362 0.7958 - 0.5554
0.656 4100 0.8057 0.7966 - 0.5578
0.672 4200 0.8001 0.7943 - 0.5646
0.688 4300 0.8215 0.7937 - 0.5602
0.704 4400 0.8257 0.7933 - 0.5614
0.72 4500 0.8173 0.7942 - 0.5648
0.736 4600 0.8002 0.7922 - 0.5698
0.752 4700 0.8445 0.7899 - 0.5626
0.768 4800 0.825 0.7897 - 0.5592
0.784 4900 0.8151 0.7870 - 0.5696
0.8 5000 0.8223 0.7895 - 0.5676
0.816 5100 0.8235 0.7877 - 0.5656
0.832 5200 0.8355 0.7866 - 0.5688
0.848 5300 0.8218 0.7864 - 0.5672
0.864 5400 0.8384 0.7866 - 0.5652
0.88 5500 0.7988 0.7860 - 0.569
0.896 5600 0.8117 0.7867 - 0.5684
0.912 5700 0.8113 0.7861 - 0.5734
0.928 5800 0.8129 0.7860 - 0.5698
0.944 5900 0.799 0.7863 - 0.5688
0.96 6000 0.8269 0.7858 - 0.5708
0.976 6100 0.8066 0.7857 - 0.572
0.992 6200 0.8302 0.7856 - 0.5728
1.0 6250 - - 0.5696 -

Framework Versions

  • Python: 3.10.12
  • Sentence Transformers: 3.0.1
  • Transformers: 4.42.4
  • PyTorch: 2.3.1+cu121
  • Accelerate: 0.32.1
  • Datasets: 2.20.0
  • Tokenizers: 0.19.1

Citation

BibTeX

Sentence Transformers

@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

@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}
}