Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks
Paper • 1908.10084 • Published • 13
How to use HariishHafiiz/sbert-bug-eclipse-ft with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("HariishHafiiz/sbert-bug-eclipse-ft")
sentences = [
"debugger not reusing a ireusableeditor eclipse . doubleclick a source file of my language. an editor is opened with a fileeditorinput for it. well call it instance. debug the program file of my language. i have my own mylanguageinput for a runtime program so that i can do coloring based on vm states see bug the debugger will not reuse the already open ireusableeditor that i have setting its input object was what i expected. it will choose to open a new editor instead. well call this instance. debug more instances of the same program. now the debugger will reuse instance. why cant the debugger reuse instance from the beginning note that this problem was hit by a workaround for bug",
"would like to say what text attributes to use when selecting the executing statement for my language id like to have the currently executing line colored depending on state from my vm. id imagine that passing such text attributes when generating these debug events would be one way to go. note that is is a spinoff from bug",
"ant builds using an external jvm with input tasks cannot request input. please ensure that an inputhandler is being provided for external ant tasks currently the ant will request the input from stdin which is not possible on the current console rather than popping up an appropriate dialog as it would when run from within the eclipse vm.",
"workbench startup is throwing dialog rather than logging to .log took new startedt on old workspace got annternal error dialog executable extension definition for class not found. hit ok t came up ok nothingn log"
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]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.
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()
)
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]])
anchor and positive| anchor | positive | |
|---|---|---|
| type | string | string |
| details |
|
|
| 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. |
MultipleNegativesRankingLoss with these parameters:{
"scale": 20.0,
"similarity_fct": "cos_sim",
"gather_across_devices": false
}
warmup_steps: 100fp16: Truedo_predict: Falseeval_strategy: noprediction_loss_only: Trueper_device_train_batch_size: 8per_device_eval_batch_size: 8gradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 5e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 3max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_ratio: Nonewarmup_steps: 100log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Trueenable_jit_checkpoint: Falsesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseuse_cpu: Falseseed: 42data_seed: Nonebf16: Falsefp16: Truebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: -1ddp_backend: Nonedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonedisable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Falseignore_data_skip: Falsefsdp: []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: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Nonegroup_by_length: Falselength_column_name: lengthproject: huggingfacetrackio_space_id: trackioddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Truepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Nonehub_always_push: Falsehub_revision: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_for_metrics: []eval_do_concat_batches: Trueauto_find_batch_size: Falsefull_determinism: Falseddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneinclude_num_input_tokens_seen: noneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Trueuse_cache: Falseprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| 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 |
@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",
}
@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}
}
Base model
sentence-transformers/all-mpnet-base-v2