Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks
Paper • 1908.10084 • Published • 17
How to use aaa961/finetuned-bge-base-en-firefox-bugs-bugs with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("aaa961/finetuned-bge-base-en-firefox-bugs-bugs")
sentences = [
"Components using standard `background-color-ghost-...` CSS design system tokens have contrast issues when a wallpaper is set Currently, we have to override the standard token defaults for components depneding if a user has a wallpaper set: \n\nExamples: \n- [Weather component](https://searchfox.org/mozilla-central/source/browser/components/newtab/content-src/components/Weather/_Weather.scss#165-181)\n- [Top Sites component](https://searchfox.org/mozilla-central/source/browser/components/newtab/content-src/components/TopSites/_TopSites.scss#29-39)\n\nNote that there is not an immediate issue, but if the design system pushes updates to this token set, components using this override will deviate/be out of sync.",
"Horizontal and vertical scrollbars in upgrade dialog at some Windows OS zoom/scaling settings Firefox 89.0b12 and 90.0a1 20210514215821 on Windows 8.1, 1920x1080 screen resolution and 125% zoom on the OS level, task bar is on the left of the screen.\n\nThe upgrade dialog has a horizontal and a vertical scroll bar.\n\nBisection identifies https://hg.mozilla.org/releases/mozilla-beta/pushloghtml?fromchange=310d7fce2d0ed6c833513e20c9ad4aae1104c455&tochange=4a4264b2122a29c25536045de9b25f2749b7266f as the starting push - bug 1706279 should be the regressing change.",
"Add learn more link to \"Cross-site cookies\" permission header description This was omitted in bug 1643191.",
"The Review Checker Shopping sidebar is displayed on an unsupported link **Found in**\n* Nightly 121.0a1 (2023-10-26)\n\n**Affected versions**\n* Nightly 121.0a1 (2023-10-26) \n* Beta 120.0b2\n\n**Affected platforms**\n* ALL\n\n**Preconditions:**\nSet the browser.shopping.experience2023.enabled - TRUE\nSet the browser.shopping.experience2023.optedIn - 1\n\n\n**Steps to reproduce**\n1. Reach https://www.bestbuy.com/site/builder/solution/6447111.p\n\n**Expected result**\n* The Shopping sidebar should not be displayed on pages other than the product details page.\n\n**Actual result**\n* The Shopping sidebar is still displayed on the builder page from bestbuy.com : https://www.bestbuy.com/site/builder/solution/6447111.p\n\n**Regression range**\nNot Applicable"
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]This is a sentence-transformers model finetuned from BAAI/bge-base-en. 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': 512, 'do_lower_case': True, 'architecture': 'BertModel'})
(1): Pooling({'word_embedding_dimension': 768, '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()
)
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("aaa961/finetuned-bge-base-en-firefox-bugs-bugs")
# Run inference
sentences = [
"Some bookmark icons disappear over time User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/112.0\n\nSteps to reproduce:\n\nI have two bookmarks in my Bookmarks Menu for which sometimes Firefox resets the icon to the default (globe) icon from time to time for no reason. I don't visit them or do anything to those boookmarks. It's these two sites that have this problem, all other bookmarks' icons stay in tact. \n\nTo fix it, I have to click on the respective bookmark and wait for the page load - after that the proper site icon is shown again.",
'After closing or opening a tab without leaving the tab strip, there is no delay in displaying the tab preview **Found in**\n* 126.0a1 (2024-04-04)\n\n\n\n**Affected versions**\n* 126.0a1 (2024-04-04)\n\n\n\n**Tested platforms**\n* Affected platforms: Windows 10x64, Ubuntu 23, macOS 12\n* Unaffected platforms: none\n\n**Preconditions**\n* browser.tabs.cardPreview.enabled: true\n\n**Steps to reproduce**\n1. Open some random tabs and hover over them until the tab preview is displayed.\n2. Without leaving the tab strip close a tab located in the middle of the other tabs.\n\n**Expected result** \n* The tab preview is displayed after 500ms.\n\n\n\n**Actual result**\n* The tab preview is displayed instantly. \n\n\n**Regression range**\n* Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=7b609d9f295fce7ab954f09492fea414b72843e6&tochange=a387d4331dd332c954d2689a4a8b64c2181690b1 \nPossible regressor: Bug 1876522 \n\n**Additional notes**\n* Attached a screen recording.\n* This also happens when opening a new tab.',
'Adding Opensearch search engine does not work for .onion addresses User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0\n\nSteps to reproduce:\n\n1. Navigate to a search engine website hosted on the TOR network (like http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion/ ).\nThe website must provide an Opensearch descriptor.\n\n2. Click "Page Actions" -> "Add Search Engine".\n\n\nActual results:\n\nFirefox cannot add the search engine despite the website providing a valid Opensearch descriptor. Following message is shown:\n```\nFirefox could not download the search plugin from: http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion/opensearch.xml\n```\n\n\nExpected results:\n\nWhen fetching the Opensearch descriptor Firefox should use the proxy settings provided by the user. In the case of TOR requests to .onion websites will fail when not using the SOCKS5 proxy.\n\nWorkaround: Downloading the index.html and the opensearch.xml descriptor file manually and serving them locally. After navigating to the local address, the search engine can be added normally.',
]
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.9140, 0.9162],
# [0.9140, 1.0000, 0.9958],
# [0.9162, 0.9958, 1.0000]])
bge-base-en-eval and bge-base-en-trainTripletEvaluator| Metric | bge-base-en-eval | bge-base-en-train |
|---|---|---|
| cosine_accuracy | 0.5159 | 0.6812 |
anchor, positive, and negative| anchor | positive | negative | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| anchor | positive | negative |
|---|---|---|
The "X" button of the opt-in modal is only read as "button" using a screen reader [Affected Versions]: |
normalize.scss breaking some stuff on Firefox View Our sheet aboutwelcome.css is only loaded into firefox view when a feature callout is shown, so it doesn't always apply to about:firefoxview. When it is loaded, it affects the layout of the page and of some elements (see attachment) because of normalize.scss. For example, check out the |
Typing "gm" in the address-bar does not highlight "gmail.com" since a few days In my usual firefox profile, type "gm" in the address-bar. |
Text and radio buttons are overlapping on PDF Tested with: |
The Firefox icon from the task bar is no longer displayed if Firefox is pinned again after it is already pinned [Affected Versions]: |
'send yourself a download link' link is marked up as a button ## Prerequisites: |
Editing a PDF results in unexpected content change User Agent: Mozilla/5.0 (Android 14; Mobile; rv:128.0) Gecko/128.0 Firefox/128.0 |
PDF editor resets active field when switching windows User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0 |
PDF Form: Only first line of two line input field gets printed I noticed an odd behavior with a PDF form from my bank. This is the PDF: |
TripletLoss with these parameters:{
"distance_metric": "TripletDistanceMetric.COSINE",
"triplet_margin": 5
}
anchor, positive, and negative| anchor | positive | negative | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| anchor | positive | negative |
|---|---|---|
The Not Now button from the Fakespot Onboarding sidebar is missing the Clicked State Found in |
[Experiment] The “Survey” screen from the “about:welcome” page has layout issues on Firefox locales with long strings [Affected versions]: |
Resume/Retry doesn’t work in case of deleted inprogress downloads Note |
Missing data from table Tested with: |
Failure in toolkit/components/extensions/test/browser/browser_ext_themes_autocomplete_popup.js with proton urlbar There's a failure in toolkit/components/extensions/test/browser/browser_ext_themes_autocomplete_popup.js when graduating the proton urlbar |
Insecure connection icon is barely visible on http website login form with dark theme Affected versions |
Change the return type in case of JEXL evaluation error Now the default return in case of failures (when |
LightweightThemeConsumer.jsm:_sanitizeCSSColor slows down first-time about:welcome theme enables https://searchfox.org/mozilla-central/source/toolkit/modules/LightweightThemeConsumer.jsm#458 has shown up to be a good candidate for speeding up to support making the theme switches in about:welcome meaningfully faster. |
If "Open tabs" suggestion is disabled, top sites in address bar doesn't show open top sites From: https://www.reddit.com/r/firefox/comments/g42asi/when_disabling_switch_to_tab_feature_on_address/ |
TripletLoss with these parameters:{
"distance_metric": "TripletDistanceMetric.COSINE",
"triplet_margin": 5
}
eval_strategy: stepsper_device_train_batch_size: 16per_device_eval_batch_size: 32gradient_accumulation_steps: 8learning_rate: 2e-05num_train_epochs: 7warmup_ratio: 0.1fp16: Truebatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 16per_device_eval_batch_size: 32per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 8eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 2e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 7max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.1warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseno_cuda: Falseuse_cpu: Falseuse_mps_device: Falseseed: 42data_seed: Nonejit_mode_eval: Falseuse_ipex: Falsebf16: Falsefp16: Truefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Falseignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_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_torchoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Trueuse_legacy_prediction_loop: Falsepush_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_inputs_for_metrics: Falseinclude_for_metrics: []eval_do_concat_batches: Truefp16_backend: autopush_to_hub_model_id: Nonepush_to_hub_organization: Nonemp_parameters: auto_find_batch_size: Falsefull_determinism: Falsetorchdynamo: Noneray_scope: lastddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_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: Falseprompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | Validation Loss | bge-base-en-eval_cosine_accuracy | bge-base-en-train_cosine_accuracy |
|---|---|---|---|---|---|
| -1 | -1 | - | - | 0.5073 | - |
| 2.3304 | 100 | 4.8424 | 4.9209 | - | 0.6825 |
| 4.6608 | 200 | 4.488 | 4.8791 | - | 0.6829 |
| 6.9912 | 300 | 4.4078 | 4.9009 | - | 0.6812 |
| -1 | -1 | - | - | 0.5159 | - |
@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{hermans2017defense,
title={In Defense of the Triplet Loss for Person Re-Identification},
author={Alexander Hermans and Lucas Beyer and Bastian Leibe},
year={2017},
eprint={1703.07737},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
Base model
BAAI/bge-base-en