SentenceTransformer

This is a sentence-transformers model trained. 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
  • Maximum Sequence Length: 256 tokens
  • Output Dimensionality: 384 dimensions
  • Similarity Function: Cosine Similarity

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 256, '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})
  (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("minsuas/Misconceptions_1")
# Run inference
sentences = [
    'Subject: Construct Triangle\nConstruct: Construct a triangle using Side-Side-Side\nQuestion: Tom and Katie are arguing about constructing triangles.\n\nTom says you can construct a triangle with lengths 11mathrm cm,10mathrm cm 11 \\mathrm{~cm}, 10 \\mathrm{~cm}  and 2mathrm cm 2 \\mathrm{~cm} .\n\nKatie says you can construct a triangle with lengths 8mathrm cm,5mathrm cm 8 \\mathrm{~cm}, 5 \\mathrm{~cm}  and 3mathrm cm 3 \\mathrm{~cm} .\n\nWho is correct?\nIncorrect Answer: Neither is correct',
    'Does not realise that the sum of the two shorter sides must be greater than the third side for it to be a possible triangle\nThe passage is discussing a common misconception about the properties required to form a triangle. The misconception is that one might think any three given side lengths can form a triangle. However, for three lengths to actually form a triangle, they must satisfy the triangle inequality theorem. This theorem states that the sum of the lengths of any two sides of a triangle must be greater than the length of the remaining side. This rule must hold true for all three combinations of added side lengths. \n\nTo apply this to the misconception: one does not realize that the sum of the lengths of the two shorter sides must be greater than the length of the longest side to form a possible triangle. This ensures that the sides can actually meet to form a closed figure with three angles.',
    'Draws both angles at the same end of the line when constructing a triangle\nThe misconception described refers to a common error in geometry when students are constructing a triangle based on given angles and a line segment. The mistake is to draw both given angles at the same end of the given line segment. This is incorrect because in a triangle, each angle is located at a different vertex, and each vertex connects two sides. To correctly construct the triangle, each given angle should be drawn at different ends of the line segment (if constructing based on one line segment and two angles) or at vertices defined by the construction steps (if additional sides are given). This ensures that the three angles are positioned to form the corners of the triangle, with each angle at a distinct vertex, thereby creating a proper triangle.',
]
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]

Training Details

Training Dataset

Unnamed Dataset

  • Size: 17,405 training samples
  • Columns: anchor, positive, and negative
  • Approximate statistics based on the first 1000 samples:
    anchor positive negative
    type string string string
    details
    • min: 32 tokens
    • mean: 87.49 tokens
    • max: 256 tokens
    • min: 79 tokens
    • mean: 179.08 tokens
    • max: 256 tokens
    • min: 75 tokens
    • mean: 180.1 tokens
    • max: 256 tokens
  • Samples:
    anchor positive negative
    Subject: Cubics and Reciprocals
    Construct: Given a positive x value, find the corresponding y value for reciprocal graphs
    Question: This is a part of the table of values for the equation ( y=\frac{3}{x} ) \begin{tabular}{
    l l
    Subject: Angle Facts with Parallel Lines
    Construct: Identify a transversal
    Question: What is the name given to the red line that intersects the two dashed lines? Shows two straight horizontal dashed lines that are converging and are both intersected by a solid red line
    Incorrect Answer: Parallel
    Does not know the meaning of the word parallel
    The passage is indicating a misconception related to a math problem, specifically one that involves the concept of "parallel." In mathematics, particularly in geometry, "parallel" refers to lines or planes that are equidistant from each other at every point and never intersect, no matter how far they are extended. A misunderstanding or lack of knowledge about this definition can lead to errors when solving problems that involve parallel lines or planes, such as determining angles or distances. Thus, to correctly interpret and solve problems involving parallel lines or planes, one must understand that they maintain a constant distance from each other and never meet.
    Does not know the term transversal
    The passage is indicating a common pitfall in geometry where a student may not be familiar with the term "transversal." A transversal is a line that passes through two or more other lines, often creating several angles with them. When discussing parallel lines and the angles formed when a transversal intersects them, understanding the term and its implications is crucial. The misconception here is likely that without knowing what a transversal is, a student might struggle to identify the relationships between the angles formed (such as alternate interior angles, corresponding angles, etc.), which are fundamental concepts in solving geometry problems involving parallel lines.
    Subject: Sharing in a Ratio
    Construct: Divide a quantity into two parts for a given a ratio, where each part is an integer
    Question: Share ( £360 ) in the ratio ( 2: 7 )
    Incorrect Answer: ( £ 180: £ 51 )
    Divides total amount by each side of the ratio instead of dividing by the sum of the parts
    The misconception described refers to a mistake made when dividing a total amount according to a given ratio. For instance, if someone has to divide $100 in the ratio 2:3, a correct approach would be to first add the parts of the ratio (2+3=5) to find the total number of parts. Then, divide the total amount by this sum ($100 ÷ 5 = $20) to determine the value of one part. This $20 can then be multiplied by each number in the ratio (2 and 3) to correctly distribute the $100.

    The misconception occurs when someone divides the total amount ($100) by each individual number in the ratio (2 and 3) rather than by the sum of the parts (5). This method would incorrectly distribute the $100, as it does not account for the proportional relationship that the ratio is meant to establish.
    Estimates shares of a ratio instead of calculating
    The passage is discussing a common mistake made in mathematics, particularly when dealing with ratio problems. The misconception lies in estimating the shares or parts of a ratio rather than calculating them accurately. For example, if a problem involves dividing a quantity in the ratio of 2:3, the misconception would be to guess or estimate what parts of the quantity correspond to 2 and 3, instead of using the correct method to find the exact shares. The correct approach involves first adding the parts of the ratio (in this case, 2 + 3 = 5) and then using this sum to calculate each part's exact share of the total quantity. Thus, it's important to calculate each part of the ratio precisely rather than estimating.
  • Loss: CachedMultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 512
  • num_train_epochs: 1
  • lr_scheduler_type: cosine
  • warmup_ratio: 0.1
  • fp16: True

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: no
  • prediction_loss_only: True
  • per_device_train_batch_size: 512
  • per_device_eval_batch_size: 8
  • 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: 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: cosine
  • 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: None
  • hub_always_push: False
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • include_for_metrics: []
  • 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
  • use_liger_kernel: False
  • eval_use_gather_object: False
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: proportional

Framework Versions

  • Python: 3.10.12
  • Sentence Transformers: 3.3.1
  • Transformers: 4.47.1
  • PyTorch: 2.5.1+cu121
  • Accelerate: 1.2.1
  • Datasets: 3.2.0
  • Tokenizers: 0.21.0

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",
}

CachedMultipleNegativesRankingLoss

@misc{gao2021scaling,
    title={Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup},
    author={Luyu Gao and Yunyi Zhang and Jiawei Han and Jamie Callan},
    year={2021},
    eprint={2101.06983},
    archivePrefix={arXiv},
    primaryClass={cs.LG}
}
Downloads last month
3
Safetensors
Model size
22.7M params
Tensor type
F32
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.