Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 8192, 'do_lower_case': False, 'architecture': 'XLMRobertaModel'})
(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()
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("sentence_transformers_model_id")
5# Run inference
6sentences = [
7 'Who should communicate a personal data breach to the data subject?',
8 'The controller should communicate to the data subject a personal data breach, without undue delay, where that personal data breach is likely to result in a high risk to the rights and freedoms of the natural person in order to allow him or her to take the necessary precautions. The communication should describe the nature of the personal data breach as well as recommendations for the natural person concerned to mitigate potential adverse effects. Such communications to data subjects should be made as soon as reasonably feasible and in close cooperation with the supervisory authority, respecting guidance provided by it or by other relevant authorities such as law-enforcement authorities. For example, the need to mitigate an immediate risk of damage would call for prompt communication with data subjects whereas the need to implement appropriate measures against continuing or similar personal data breaches may justify more time for communication.',
9 "1.In the absence of an adequacy decision pursuant to Article 45(3), or of appropriate safeguards pursuant to Article 46, including binding corporate rules, a transfer or a set of transfers of personal data to a third country or an international organisation shall take place only on one of the following conditions: (a) the data subject has explicitly consented to the proposed transfer, after having been informed of the possible risks of such transfers for the data subject due to the absence of an adequacy decision and appropriate safeguards; (b) the transfer is necessary for the performance of a contract between the data subject and the controller or the implementation of pre-contractual measures taken at the data subject's request; (c) the transfer is necessary for the conclusion or performance of a contract concluded in the interest of the data subject between the controller and another natural or legal person; (d) the transfer is necessary for important reasons of public interest; (e) the transfer is necessary for the establishment, exercise or defence of legal claims; (f) the transfer is necessary in order to protect the vital interests of the data subject or of other persons, where the data subject is physically or legally incapable of giving consent; (g) the transfer is made from a register which according to Union or Member State law is intended to provide information to the public and which is open to consultation either by the public in general or by any person who can demonstrate a legitimate interest, but only to the extent that the conditions laid down by Union or Member State law for consultation are fulfilled in the particular case. Where a transfer could not be based on a provision in Article 45 or 46, including the provisions on binding corporate rules, and none of the derogations for a specific situation referred to in the first subparagraph of this paragraph is applicable, a transfer to a third country or an international organisation may take place only if the transfer is not repetitive, concerns only a limited number of data subjects, is necessary for the purposes of compelling legitimate interests pursued by the controller which are not overridden by the interests or rights and freedoms of the data subject, and the controller has assessed all the circumstances surrounding the data transfer and has on the basis of that assessment provided suitable safeguards with regard to the protection of personal data. The controller shall inform the supervisory authority of the transfer. The controller shall, in addition to providing the information referred to in Articles 13 and 14, inform the data subject of the transfer and on the compelling legitimate interests pursued.\n2.A transfer pursuant to point (g) of the first subparagraph of paragraph 1 shall not involve the entirety of the personal data or entire categories of the personal data contained in the register. Where the register is intended for consultation by persons having a legitimate interest, the transfer shall be made only at the request of those persons or if they are to be the recipients. 4.5.2016 L 119/64 \n3.Points (a), (b) and (c) of the first subparagraph of paragraph 1 and the second subparagraph thereof shall not apply to activities carried out by public authorities in the exercise of their public powers.\n4.The public interest referred to in point (d) of the first subparagraph of paragraph 1 shall be recognised in Union law or in the law of the Member State to which the controller is subject.\n5.In the absence of an adequacy decision, Union or Member State law may, for important reasons of public interest, expressly set limits to the transfer of specific categories of personal data to a third country or an international organisation. Member States shall notify such provisions to the Commission.\n6.The controller or processor shall document the assessment as well as the suitable safeguards referred to in the second subparagraph of paragraph 1 of this Article in the records referred to in Article 30.",
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 1024]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities)
18# tensor([[1.0000, 0.7041, 0.2945],
19# [0.7041, 1.0000, 0.3575],
20# [0.2945, 0.3575, 1.0000]])dim_768InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 768
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.5051 |
| cosine_accuracy@3 | 0.5379 |
| cosine_accuracy@5 | 0.5783 |
| cosine_accuracy@10 | 0.6237 |
| cosine_precision@1 | 0.5051 |
| cosine_precision@3 | 0.4832 |
| cosine_precision@5 | 0.4495 |
| cosine_precision@10 | 0.3889 |
| cosine_recall@1 | 0.1083 |
| cosine_recall@3 | 0.2625 |
| cosine_recall@5 | 0.3474 |
| cosine_recall@10 | 0.4711 |
| cosine_ndcg@10 | 0.5624 |
| cosine_mrr@10 | 0.5318 |
| cosine_map@100 | 0.6073 |
dim_512InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 512
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.4924 |
| cosine_accuracy@3 | 0.5328 |
| cosine_accuracy@5 | 0.5707 |
| cosine_accuracy@10 | 0.6212 |
| cosine_precision@1 | 0.4924 |
| cosine_precision@3 | 0.4747 |
| cosine_precision@5 | 0.4439 |
| cosine_precision@10 | 0.3828 |
| cosine_recall@1 | 0.105 |
| cosine_recall@3 | 0.257 |
| cosine_recall@5 | 0.3459 |
| cosine_recall@10 | 0.472 |
| cosine_ndcg@10 | 0.5541 |
| cosine_mrr@10 | 0.5217 |
| cosine_map@100 | 0.6007 |
dim_256InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 256
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.4621 |
| cosine_accuracy@3 | 0.5 |
| cosine_accuracy@5 | 0.548 |
| cosine_accuracy@10 | 0.5783 |
| cosine_precision@1 | 0.4621 |
| cosine_precision@3 | 0.4461 |
| cosine_precision@5 | 0.4227 |
| cosine_precision@10 | 0.3644 |
| cosine_recall@1 | 0.0973 |
| cosine_recall@3 | 0.238 |
| cosine_recall@5 | 0.3246 |
| cosine_recall@10 | 0.4473 |
| cosine_ndcg@10 | 0.5236 |
| cosine_mrr@10 | 0.4904 |
| cosine_map@100 | 0.5706 |
dim_128InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 128
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.4596 |
| cosine_accuracy@3 | 0.4823 |
| cosine_accuracy@5 | 0.5202 |
| cosine_accuracy@10 | 0.5758 |
| cosine_precision@1 | 0.4596 |
| cosine_precision@3 | 0.4377 |
| cosine_precision@5 | 0.4071 |
| cosine_precision@10 | 0.3545 |
| cosine_recall@1 | 0.097 |
| cosine_recall@3 | 0.2362 |
| cosine_recall@5 | 0.314 |
| cosine_recall@10 | 0.4391 |
| cosine_ndcg@10 | 0.5128 |
| cosine_mrr@10 | 0.4834 |
| cosine_map@100 | 0.5606 |
dim_64InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 64
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.3662 |
| cosine_accuracy@3 | 0.4015 |
| cosine_accuracy@5 | 0.4571 |
| cosine_accuracy@10 | 0.5126 |
| cosine_precision@1 | 0.3662 |
| cosine_precision@3 | 0.3544 |
| cosine_precision@5 | 0.3369 |
| cosine_precision@10 | 0.3048 |
| cosine_recall@1 | 0.0789 |
| cosine_recall@3 | 0.1968 |
| cosine_recall@5 | 0.2664 |
| cosine_recall@10 | 0.3808 |
| cosine_ndcg@10 | 0.4353 |
| cosine_mrr@10 | 0.3988 |
| cosine_map@100 | 0.4852 |
anchor and positive| anchor | positive | |
|---|---|---|
| type | string | string |
| details |
|
|
| anchor | positive |
|---|---|
How has technology affected the collection and sharing of personal data? | Rapid technological developments and globalisation have brought new challenges for the protection of personal data. The scale of the collection and sharing of personal data has increased significantly. Technology allows both private companies and public authorities to make use of personal data on an unprecedented scale in order to pursue their activities. Natural persons increasingly make personal information available publicly and globally. Technology has transformed both the economy and social life, and should further facilitate the free flow of personal data within the Union and the transfer to third countries and international organisations, while ensuring a high level of the protection of personal data. |
When was the Official Journal of the European Union published? | In order to create incentives to apply pseudonymisation when processing personal data, measures of pseudonymisation should, whilst allowing general analysis, be possible within the same controller when that controller has taken technical and organisational measures necessary to ensure, for the processing concerned, that this Regulation is implemented, and that additional information for attributing the personal data to a specific data subject is kept separately. The controller processing the personal data should indicate the authorised persons within the same controller. 4.5.2016 L 119/5 Official Journal of the European Union EN |
What is the meaning of 'processing' in the context of personal data? | 1) 'personal data' means any information relating to an identified or identifiable natural person ('data subject'); an identifiable natural person is one who can be identified, directly or indirectly, in particular by reference to an identifier such as a name, an identification number, location data, an online identifier or to one or more factors specific to the physical, physiological, genetic, mental, economic, cultural or social identity of that natural person;[object Object](2) ‘processing’ means any operation or set of operations which is performed on personal data or on sets of personal data, whether or not by automated means, such as collection, recording, organisation, structuring, storage, adaptation or alteration, retrieval, consultation, use, disclosure by transmission, dissemination or otherwise making available, alignment or combination, restriction, erasure or destruction;[object Object](3) ‘restriction of processing’ means the marking of stored personal data with the aim of limiting their processin... |
MatryoshkaLoss with these parameters:
1{
2 "loss": "MultipleNegativesRankingLoss",
3 "matryoshka_dims": [
4 768,
5 512,
6 256,
7 128,
8 64
9 ],
10 "matryoshka_weights": [
11 1,
12 1,
13 1,
14 1,
15 1
16 ],
17 "n_dims_per_step": -1
18}eval_strategy: epochgradient_accumulation_steps: 4learning_rate: 3e-05num_train_epochs: 20lr_scheduler_type: cosinewarmup_ratio: 0.1bf16: Trueload_best_model_at_end: Trueoptim: adamw_torch_fusedbatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: epochprediction_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: 4eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 3e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 20max_steps: -1lr_scheduler_type: cosinelr_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: Truefp16: Falsefp16_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: Trueignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}tp_size: 0fsdp_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_torch_fusedoptim_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: 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: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | dim_768_cosine_ndcg@10 | dim_512_cosine_ndcg@10 | dim_256_cosine_ndcg@10 | dim_128_cosine_ndcg@10 | dim_64_cosine_ndcg@10 |
|---|---|---|---|---|---|---|---|
| -1 | -1 | - | 0.4571 | 0.4375 | 0.4008 | 0.3170 | 0.2563 |
| 0.2020 | 10 | 21.3767 | - | - | - | - | - |
| 0.4040 | 20 | 19.2573 | - | - | - | - | - |
| 0.6061 | 30 | 18.6623 | - | - | - | - | - |
| 0.8081 | 40 | 18.2772 | - | - | - | - | - |
| 1.0 | 50 | 16.0375 | 0.4596 | 0.4511 | 0.4154 | 0.3519 | 0.2872 |
| 1.2020 | 60 | 17.5302 | - | - | - | - | - |
| 1.4040 | 70 | 17.0313 | - | - | - | - | - |
| 1.6061 | 80 | 14.3965 | - | - | - | - | - |
| 1.8081 | 90 | 14.3407 | - | - | - | - | - |
| 2.0 | 100 | 12.6464 | 0.4835 | 0.4805 | 0.4585 | 0.4101 | 0.3288 |
| 2.2020 | 110 | 12.1612 | - | - | - | - | - |
| 2.4040 | 120 | 12.1747 | - | - | - | - | - |
| 2.6061 | 130 | 10.8968 | - | - | - | - | - |
| 2.8081 | 140 | 11.3075 | - | - | - | - | - |
| 3.0 | 150 | 9.3359 | 0.5314 | 0.5141 | 0.4915 | 0.4568 | 0.3777 |
| 3.2020 | 160 | 8.9723 | - | - | - | - | - |
| 3.4040 | 170 | 9.4735 | - | - | - | - | - |
| 3.6061 | 180 | 9.3438 | - | - | - | - | - |
| 3.8081 | 190 | 9.643 | - | - | - | - | - |
| 4.0 | 200 | 8.3103 | 0.5374 | 0.5426 | 0.5113 | 0.4848 | 0.4180 |
| 4.2020 | 210 | 7.3441 | - | - | - | - | - |
| 4.4040 | 220 | 7.8091 | - | - | - | - | - |
| 4.6061 | 230 | 7.1368 | - | - | - | - | - |
| 4.8081 | 240 | 7.7728 | - | - | - | - | - |
| 5.0 | 250 | 8.0139 | 0.5495 | 0.5443 | 0.5049 | 0.4923 | 0.4108 |
| 5.2020 | 260 | 5.6836 | - | - | - | - | - |
| 5.4040 | 270 | 6.0556 | - | - | - | - | - |
| 5.6061 | 280 | 7.1601 | - | - | - | - | - |
| 5.8081 | 290 | 7.8578 | - | - | - | - | - |
| 6.0 | 300 | 5.7557 | 0.5700 | 0.5564 | 0.5235 | 0.5106 | 0.4292 |
| 6.2020 | 310 | 5.7718 | - | - | - | - | - |
| 6.4040 | 320 | 5.1293 | - | - | - | - | - |
| 6.6061 | 330 | 6.7643 | - | - | - | - | - |
| 6.8081 | 340 | 5.1791 | - | - | - | - | - |
| 7.0 | 350 | 5.4592 | 0.5624 | 0.5541 | 0.5236 | 0.5128 | 0.4353 |
| 7.2020 | 360 | 5.0135 | - | - | - | - | - |
| 7.4040 | 370 | 4.9931 | - | - | - | - | - |
| 7.6061 | 380 | 5.1182 | - | - | - | - | - |
| 7.8081 | 390 | 4.5808 | - | - | - | - | - |
| 8.0 | 400 | 4.6313 | 0.5716 | 0.5549 | 0.5362 | 0.4893 | 0.4189 |
| 8.2020 | 410 | 5.0518 | - | - | - | - | - |
| 8.4040 | 420 | 4.7227 | - | - | - | - | - |
| 8.6061 | 430 | 3.5472 | - | - | - | - | - |
| 8.8081 | 440 | 5.4843 | - | - | - | - | - |
| 9.0 | 450 | 4.6137 | 0.5738 | 0.5589 | 0.5320 | 0.4849 | 0.4286 |
| -1 | -1 | - | 0.5624 | 0.5541 | 0.5236 | 0.5128 | 0.4353 |
1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}1@misc{kusupati2024matryoshka,
2 title={Matryoshka Representation Learning},
3 author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
4 year={2024},
5 eprint={2205.13147},
6 archivePrefix={arXiv},
7 primaryClass={cs.LG}
8}1@misc{henderson2017efficient,
2 title={Efficient Natural Language Response Suggestion for Smart Reply},
3 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},
4 year={2017},
5 eprint={1705.00652},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL}
8}