Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks
Paper • 1908.10084 • Published • 16
How to use dhruvnayee/help_texted_mined_r3s_0810 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("dhruvnayee/help_texted_mined_r3s_0810")
sentences = [
"Where do I select the build type in R³S Modeler?",
"## Perform build on(requiresR³S Enterprise) The Perform build on drop-down list is not available when running a results workspace. You can use the Perform build on drop-down list to specify whether to use distributed processing to build (generate, compile, and link) the calculations specified in the batch or the model. You can select an option from the drop-down list: * Local: build the batch or the model on the current machine (the controller) without using distributed processing. * Remote: use distributed processing to build the batch or the model on one of the remote machines (a worker). This is useful when you do not want to occupy the controller with these tasks. If you build or run a batch or a model, R³S Modeler uses the value of the Perform build on property of the batch or model as the default value of the drop-down list. R³S Modeler uses the value of the Perform build on drop-down list to set the value of the Perform build on property of the batch or the model in the results workspace. You can specify the connector to use for distributed processing on the Distribution tab of the Options dialog box. For the Remote option to use distributed processing, you must use the Microsoft® HPC Pack connector or the Azure® Batch connector.",
"Server hierarchy The Server hierarchy property is a property of the following components: - **Development sandbox workspace or approval sandbox workspace(requiresR³S Development Manager)**: The Server hierarchy property of a development sandbox workspace or an approval sandbox workspace shows the name of the sandbox, branch, and library with which you associated the workspace. - **Snapshot workspace(requiresR³S Development Manager)**: The Server hierarchy property of a snapshot workspace shows the name of the changeset, label, or sandbox, the branch, and the library from which you created the snapshot.",
"Result grid The result grid of the Analyzer tab of a results workspace shows the results at different calculation dates for the current variable, the variables that it depends on, and the variables that depend on it if these results are available in sample output. The result grid is more useful for analyzing layers than data layers, because a data layer has only one calculation date, corresponding to the portfolio date of the model or model alias. Each scalar numeric and indicator variable has a checkbox before its name. Selecting one of these checkboxes clears the others. In the graph pane, R³S Modeler graphs the results for the variable whose checkbox you select. If events occur in a projection step of a layer, R³S Modeler shows these in pink in the result grid. To hide the results for the events, select the Hide events checkbox. This also stops events from being indicated by the green vertical line in the graph pane. If loops occur in a projection step of a layer, R³S Modeler shows these in blue in the result grid. To hide the results for the loops, select the Hide loops checkbox. Because loop variables have no time associated with them, they are never shown in the graph pane. Selecting the Hide events checkbox to hide event results or the Hide loops checkbox to hide loop results does not affect the results; it just hides them in the result grid. With these checkboxes selected, it might not be easy to understand the calculation of non-portfolio variables that are summed across event dates in the step or how the final values of loop variables have been extracted into step variables. The dependency diagram still shows all the precedents and is not affected by the checkboxes. The result grid shows the variable being analyzed in its first row. Precedent variables are shown immediately beneath the chosen variable, and dependent variables are shown below these. The currently selected date is highlighted with a yellow box. Yellow boxes also highlight the variable being analyzed and its precedents and dependents. Highlighting a cell in the result grid and pressing the Enter key makes the corresponding variable and date the subject of the analysis. You can also do this by right-clicking in the result grid and choosing Analyze from the context menu. Highlighting a cell in the result grid and pressing the Home key makes the corresponding variable the subject of the analysis at the layer start date. You can also do this by right-clicking in the result grid and choo"
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]This is a sentence-transformers model finetuned from BAAI/bge-large-en-v1.5. It maps sentences & paragraphs to a 1024-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': 384, 'do_lower_case': True, 'architecture': 'BertModel'})
(1): Pooling({'word_embedding_dimension': 1024, '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("dhruvnayee/help_texted_mined_r3s_0810")
# Run inference
sentences = [
'What inputs does Qx accept?',
'## Examples q\ue04f\ue052 | =Qx(58, , LT) q\ue028\ue04f\ue053\ue029\ue02a\ue027 | =Qx(59+1, 1, LT)',
"Invalid Target Variable Message: '<name>' cannot be an array because it is the target input range.",
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.8317, 0.8164],
# [0.8317, 1.0000, 0.4416],
# [0.8164, 0.4416, 1.0000]])
sentence_0, sentence_1, and sentence_2| sentence_0 | sentence_1 | sentence_2 | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| sentence_0 | sentence_1 | sentence_2 |
|---|---|---|
What are the new features in this release? |
## What's new from previous upgrades |
What's new in version 1.2 Targeting * This functionality may be used to find the value of an input variable giving the specified value of an output variable, for example for use in profit testing Enhancements to distributed processing * This provides for greater functionality in distributed processing Enhancements to Compare * This extends the functionality of the Compare Page to allow comparison of multiple components Initialization variables * This new component allows greater flexibility and simplicity of coding variables, allowing different definitions at the outset of a projection and during the projection Stochastic processes (not available in R³S Modeler Lite ) * This involves enhancements to the existing stochastic process functionality Results workspaces * This enhances the information provided about related results workspaces on the opening page of a workspace Program Linker and Model Builder * This enables greater ease of adding and moving items within these tools Analyzer e... |
What does this element represent? |
Data_Source_Name The Data_Source_Name system variable is a character variable that gives the name of the data source. You can use this system variable in a data source in a data process in the data layer of a model. This system variable is a placeholder variable. |
Cannot rerun results workspace Message: It is not possible to rerun a results workspace that contained any model that failed to build. |
How does R3S Modeler create parent program records? |
Record_Is_Last_Step The Record_Is_Last_Step system variable is an indicator variable that is 1 if the Record_End_Date system variable for the current program record is a date that is in the current projection step and 0 otherwise. This system variable is not defined for parent program records that R³S Modeler creates solely by aggregating child program records (and does not read from data). |
## Circumstances This error occurs when the variable used in a formula does not exist in the workspace (for example, it is not in the Variable Chooser ). For example, if a variable, say, CF_Premium is defined as Prem_Annual * Prob_Surr and the variable Prob_Surr does not exist within the workspace then the above error will occur. |
TripletLoss with these parameters:{
"distance_metric": "TripletDistanceMetric.EUCLIDEAN",
"triplet_margin": 5
}
num_train_epochs: 1fp16: Truemulti_dataset_batch_sampler: round_robinoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: noprediction_loss_only: Trueper_device_train_batch_size: 8per_device_eval_batch_size: 8per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_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: 1max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.0warmup_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}deepspeed: 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: Falsegradient_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: Nonedispatch_batches: Nonesplit_batches: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseeval_use_gather_object: Falseaverage_tokens_across_devices: Falseprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: round_robinrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss |
|---|---|---|
| 0.2397 | 500 | 4.8389 |
| 0.4794 | 1000 | 4.7385 |
| 0.7191 | 1500 | 4.7068 |
| 0.9588 | 2000 | 4.7199 |
@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-large-en-v1.5