Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks
Paper • 1908.10084 • Published • 17
How to use kevin-rice/ticket-similarity-finetuned with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("kevin-rice/ticket-similarity-finetuned")
sentences = [
"[Admin] \\\"Unable to create asset\\\" error when creating asset from All Assets pageNavigate to Assets > All Assets and click the Create button to open the Create Asset UI. After filling in all required fields and clicking the Create button, the system throws an error message stating \\\"Unable to create asset\\\" instead of successfully creating the asset.",
"[Admin] Permission denied / Failed to open stream error when submitting Manual Product InboundNavigate to Manage Assets > Manage Products > Products Inbound and select Manual Inbound. Click Create Inbound to open the Product Inbound UI. In the Scan or Search Barcode section, enter a barcode and fill in all required fields. After clicking the Submit button, the system throws an error instead of creating the inbound record successfully.\\n \\n Observed Error:\\n The stream or file \\\"/home/assets.wecomm.info/public_html/storage/logs/activity/laravel-2024-10-01.log\\\" could not be opened in append mode: Failed to open stream: Permission denied",
"[User Portal] DataTables warning displayed when opening Create Work Order screenLogin as a user and navigate to Work Orders > Manage. Click on the Create Work Order button to open the Create Work Order screen. While loading the page, the system displays a DataTables warning / Ajax error popup message.\\n \\n Observed Error:\\n DataTables warning: table id=DataTables_Table_8 - Ajax error.",
"Pickup Product Invoice - Inconsistent Date Formats DisplayedIn the Pickup Product Invoice, the date formats are inconsistent across different fields. The Requisition Date and Pickup Date are displayed in different formats on the same invoice, causing formatting inconsistency and poor user experience."
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]This is a sentence-transformers model trained. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for retrieval.
SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'MPNetModel'})
(1): Pooling({'embedding_dimension': 768, 'pooling_mode': 'mean', '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 = [
"Order shows success message but not created when assignee has no assigned warehousen Demo WeComm, while placing a POS Order, select Mary Yed as the Assignee in the Enter Warehouse Pick Details popup.\\nAfter submission, the system displays:\\nOrder placed successfully\\nError message: User doesn't have assigned Warehouse\\nThis is contradictory behavior. Even though a success message is shown, the POS order/order number cannot be found in Customer Orders > Manage Customer Orders.",
'POS order allows quantity greater than available stock and marks order as deliveredIn Demo WeComm, under Manage Products, the product Viktos Taculus MX Chest Rig Bag shows available stock as 2.\\nHowever, the system allows creation of a POS Order for 3 units of the same product without showing any validation or out-of-stock error. The order is then processed and marked as Delivered.\\nThis indicates inventory validation is not enforced during POS order placement.',
'Incorrect order number displayed and wrong delivery status message shown in notificationsNavigate to Warehouse > Orders > Customer Orders and open the Notifications panel.\\nTwo issues are observed in order notifications:\\nNotification order number does not match the actual order number shown in the Customer Orders grid.\\nAfter the product/order status is marked as Delivered, the notification message still says \\"Ready for shipping\\" instead of confirming delivery.\\nThis causes confusion for users regarding actual order references and shipment status.',
]
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.0924, 0.1173],
# [0.0924, 1.0000, 0.0839],
# [0.1173, 0.0839, 1.0000]])
sentence_0, sentence_1, and label| sentence_0 | sentence_1 | label | |
|---|---|---|---|
| type | string | string | float |
| details |
|
|
|
| sentence_0 | sentence_1 | label |
|---|---|---|
[Admin] HTTP 500 / Permission denied error when creating product from Manage ProductsNavigate to Manage Products and click Create Product to open the Create Product UI. After filling all mandatory fields and clicking the Create button, the system throws an HTTP 500 Internal Server Error instead of creating the product successfully.\n \n Observed Error:\n The stream or file "/home/assets.wecomm.info/public_html/storage/logs/activity/laravel-2024-10-01.log" could not be opened in append mode: Failed to open stream: Permission denied |
[Admin] Permission denied / Failed to open stream error when submitting Manual Product InboundNavigate to Manage Assets > Manage Products > Products Inbound and select Manual Inbound. Click Create Inbound to open the Product Inbound UI. In the Scan or Search Barcode section, enter a barcode and fill in all required fields. After clicking the Submit button, the system throws an error instead of creating the inbound record successfully.\n \n Observed Error:\n The stream or file "/home/assets.wecomm.info/public_html/storage/logs/activity/laravel-2024-10-01.log" could not be opened in append mode: Failed to open stream: Permission denied |
0.4869 |
Accounting Template Column Displays Incorrect/Random DataWhen navigating to Reports > Customer Orders and opening the Customer Order Details report, the Accounting Template column is displaying random or irrelevant text instead of the actual accounting template associated with the order. |
Update Returned/Exchanged Items section in View Warehouse Return UI to show Accounting Template and Requisition NumberIn the Warehouse > Manage Inventory > Return Items module, selecting the eye icon in the Action column opens the View Warehouse Return UI.\nUnder the Returned/Exchanged Items section, the table should be updated to include the Accounting Template and Requisition Number related to the order.\nAdditionally, the SKU and Condition columns should be removed if they are not required for business operations. |
0.1521 |
Product stock becomes negative after POS delivery and stock count displayed as -1In Demo WeComm > Manage Products, after a POS order was processed and marked as Delivered for Viktos Taculus MX Chest Rig Bag, the product stock updated to -1.\nInventory stock should never become negative. The system allowed fulfillment beyond available quantity and reduced stock below zero.\nAdditionally, the product price is displayed as $95.00 after the transaction. |
[Admin] Available product quantity not updated after adding stock at product locationAs an Admin, create a product and update the Product Location with stock levels. Even though the selected location shows the product as In Stock, the Available Quantity field does not get updated and remains incorrect. |
0.16879999999999998 |
CosineSimilarityLoss with these parameters:{
"loss_fct": "torch.nn.modules.loss.MSELoss",
"cos_score_transformation": "torch.nn.modules.linear.Identity"
}
num_train_epochs: 10multi_dataset_batch_sampler: round_robindo_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: 1num_train_epochs: 10max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_ratio: Nonewarmup_steps: 0log_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: Falsebf16_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: round_robinrouter_mapping: {}learning_rate_mapping: {}@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",
}