SentenceTransformer based on sentence-transformers/all-mpnet-base-v2

This is a sentence-transformers model finetuned from sentence-transformers/all-mpnet-base-v2. 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/all-mpnet-base-v2
  • Maximum Sequence Length: 256 tokens
  • Output Dimensionality: 768 dimensions
  • Similarity Function: Cosine Similarity

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 256, 'do_lower_case': False, 'architecture': 'MPNetModel'})
  (1): Pooling({'word_embedding_dimension': 768, '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("sentence_transformers_model_id")
# Run inference
sentences = [
    'typing add emacs recenter command emacs has a recenter command that centers the text box around the current cursor typically bound to cl.  this means that if youve moved the cursor down to the edge of the visible area you can quickly center the code around it.  it would be nice if eclipse had a similar functionality.',
    'navigation request addition of emacs recenter command for text editing short request id like to see an analogue of the emacs recenter command implemented in eclipse so that i and other emacs users can use it for  text editing.   detailed request im a longtime emacs and new eclipse user.  i have set up eclipse version ..  id  to use the emacs key bindings. yet when editing text or java code my brainstem expects cntll i.e. control  lowercase l to result in a recentering of the text view so that the current line is in the center of the screen.  this is what the default binding for cntll in emacs the recenter command does.  i would like to bind an analogous command in eclipse  to cntll but eclipse does not appear to have a recenter command.  i searched through the available commands in windowpreferenceskeys  and also was told as much on the message boards.   thanks david devault',
    'activities ui synch needed org.eclipse.swt.swtexception invalid thread access at org.eclipse.swt.swt.errorswt.java at org.eclipse.swt.swt.errorswt.java at org.eclipse.swt.widgets.widget.errorwidget.java at org.eclipse.swt.widgets.widget.checkwidgetwidget.java at org.eclipse.swt.widgets.menu.getitemsmenu.java at org.eclipse.jface.action.menumanager.updatemenumanager.java at org.eclipse.jface.action.menumanager.updatemenumanager.java at  org.eclipse.ui.internal.activities.ws.workbenchactivitysupport.activitymanager changedworkbenchactivitysupport.java at  org.eclipse.ui.internal.activities.abstractactivitymanager.fireactivitymanagerch angedabstractactivitymanager.java at  org.eclipse.ui.internal.activities.mutableactivitymanager.setenabledactivityids mutableactivitymanager.java at  org.eclipse.ui.internal.activities.ws.workbenchactivitysupport.setenabledactivit yidsworkbenchactivitysupport.java at org.eclipse.ui.internal.ide.ideworkbenchactivityhelper.resourcechanged ideworkbenchactivityhelper.java at org.eclipse.core.internal.events.notificationmanager.run notificationmanager.java at org.eclipse.core.internal.runtime.internalplatform.run internalplatform.java at org.eclipse.core.runtime.platform.runplatform.java at org.eclipse.core.internal.events.notificationmanager.notify notificationmanager.java at org.eclipse.core.internal.events.notificationmanager.broadcastchanges notificationmanager.java at org.eclipse.core.internal.resources.workspace.broadcastchanges workspace.java at org.eclipse.core.internal.resources.workspace.endoperation workspace.java at org.eclipse.core.internal.resources.workspace.runworkspace.java at org.eclipse.core.internal.resources.workspace.runworkspace.java at com.ibm.wtp.common.operation.wtpoperation.runwtpoperation.java at  com.ibm.wtp.jee.headless.tests.jee.operations.operationtestcase.runandverify operationtestcase.java at  com.ibm.wtp.jee.headless.tests.jee.operations.operationtestcase.runandverify operationtestcase.java at  com.ibm.wtp.jee.headless.tests.ejb.operations.createejbtest.setupproject createejbtest.java at  com.ibm.wtp.jee.headless.tests.ejb.operations.createbmpbeantest.createentitym odelcreatebmpbeantest.java at  com.ibm.wtp.jee.headless.tests.ejb.operations.createbmpbeantest.testsimpleent itycreatebmpbeantest.java at sun.reflect.nativemethodaccessorimpl.invokenative method at sun.reflect.nativemethodaccessorimpl.invoke nativemethodaccessorimpl.java at sun.reflect.delegatingmethodaccessorimpl.invoke delegatingmethodaccessorimpl.java at java.lang.reflect.method.invokemethod.java at junit.framework.testcase.runtesttestcase.java at junit.framework.testcase.runbaretestcase.java at junit.framework.testresult.protecttestresult.java at junit.framework.testresult.runprotectedtestresult.java at junit.framework.testresult.runtestresult.java at junit.framework.testcase.runtestcase.java at junit.framework.testsuite.runtesttestsuite.java at junit.framework.testsuite.runtestsuite.java at junit.framework.testsuite.runtesttestsuite.java at junit.framework.testsuite.runtestsuite.java at junit.swingui.testrunner.runtestrunner.java',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[ 1.0000,  0.8299, -0.1454],
#         [ 0.8299,  1.0000, -0.0903],
#         [-0.1454, -0.0903,  1.0000]])

Training Details

Training Dataset

Unnamed Dataset

  • Size: 5,920 training samples
  • Columns: anchor and positive
  • Approximate statistics based on the first 1000 samples:
    anchor positive
    type string string
    details
    • min: 17 tokens
    • mean: 129.86 tokens
    • max: 256 tokens
    • min: 13 tokens
    • mean: 130.06 tokens
    • max: 256 tokens
  • Samples:
    anchor positive
    ui viewseditors appear active when inactive getkg if you switch to a process outside of eclipse the native active title bar becomes inactive and turns grey. the eclipse views and editors however remain coloured which may appear confusing. to repeat select a view or editor in eclipse note the title bar colourize. switch to another app and restore down so that you can see eclipse in the background. confusing inner windows active when outer inactive gjnku when looking at an inactive eclipse workbench the title is grey to indicate that it is not active but the inner windows viewparts remain in the active color usually the gradiant blue. this is confusing since a cursory look at the window indicates that it is active and then after trying to do something like pressing f to continue to debug it does not work.
    cvs ui creating a patch after creating a new folder does not work properly create a new project get it synced with a cvs repo. create a new folder containing a file in the project root but dont add either of them to cvs. ceate a patch for the project unified output format and save it to either the clipbard or the filesystem. now delete the new folder and apply the patch. it creates only the file but puts it into the project root instead of creating the folder and placing the file there. cvs patch create patch misses new directories i apologize if someone has already reported this i couldnt find a duplicate. if you create a new patch and choose include new files in patch eclipse very unintuitively ignores new files which exist in new directories. please either fix the wording to indicate that new directories will be ignored or preferably include the new files in the patch.
    changing the properties of a cvs location blocks the ide i tried to change the properties of a cvs location. after pressing the ok or apply button a modal dialog progress information appears with buttons details and cancel disabled. behind this dialog another dialog appears which asks me to confirm project sharing changes and blocks the progress. the second dialog cannot be reached because it is blocked by the first dialog. the only way out seems to kill the eclipse process and lose all unsaved changes. i only tried this on mac os x . but maybe the bug occurs also on other operating systems. cant change repository parameters open the cvs repository exploring perspective. select an existing pserver repository that has attached projects. click properties. change the connection type to extssh and click either apply or ok. a dialog box with a title bar progress information opens. inside that box it says operation in progress... behind that dialog another opens that says confirm project sharing changes. there are options ok details cancel. since it is in the background behind the progress information box you cant click any option. while you can move the progress information box out of the way you cant make the confirm project sharing changes box the foreground window. you can no longer click to any other window but must quit eclipse to make it workable again.
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim",
        "gather_across_devices": false
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • warmup_steps: 100
  • fp16: True

All Hyperparameters

Click to expand
  • do_predict: False
  • eval_strategy: no
  • prediction_loss_only: True
  • per_device_train_batch_size: 8
  • per_device_eval_batch_size: 8
  • 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: 3
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: None
  • warmup_ratio: None
  • warmup_steps: 100
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • enable_jit_checkpoint: False
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • use_cpu: False
  • seed: 42
  • data_seed: None
  • bf16: False
  • fp16: True
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • local_rank: -1
  • ddp_backend: None
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
  • parallelism_config: None
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch_fused
  • optim_args: None
  • group_by_length: False
  • length_column_name: length
  • project: huggingface
  • trackio_space_id: trackio
  • 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
  • push_to_hub: False
  • resume_from_checkpoint: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_private_repo: None
  • hub_always_push: False
  • hub_revision: None
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_for_metrics: []
  • eval_do_concat_batches: True
  • auto_find_batch_size: False
  • full_determinism: False
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • include_num_input_tokens_seen: no
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • eval_on_start: False
  • use_liger_kernel: False
  • liger_kernel_config: None
  • eval_use_gather_object: False
  • average_tokens_across_devices: True
  • use_cache: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: proportional
  • router_mapping: {}
  • learning_rate_mapping: {}

Training Logs

Epoch Step Training Loss
0.1351 50 0.3131
0.2703 100 0.2310
0.4054 150 0.3020
0.5405 200 0.2301
0.6757 250 0.2584
0.8108 300 0.2278
0.9459 350 0.2608
1.0811 400 0.1618
1.2162 450 0.0894
1.3514 500 0.0825
1.4865 550 0.1157
1.6216 600 0.1062
1.7568 650 0.0873
1.8919 700 0.0677
2.0270 750 0.0996
2.1622 800 0.0387
2.2973 850 0.0389
2.4324 900 0.0469
2.5676 950 0.0345
2.7027 1000 0.0407
2.8378 1050 0.0403
2.9730 1100 0.0385

Framework Versions

  • Python: 3.12.12
  • Sentence Transformers: 5.2.3
  • Transformers: 5.0.0
  • PyTorch: 2.10.0+cu128
  • Accelerate: 1.12.0
  • Datasets: 4.8.3
  • Tokenizers: 0.22.2

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}
}
Downloads last month
42
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for HariishHafiiz/sbert-bug-eclipse-ft

Finetuned
(380)
this model

Papers for HariishHafiiz/sbert-bug-eclipse-ft