Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'XLMRobertaModel'})
(1): Pooling({'word_embedding_dimension': 1024, '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()
)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 'When is the time of commission of the fraud considered?',
8 'According to the provision of Article 386 paragraph 1 of the Greek Penal Code,\n\n"Whoever, with the intent to obtain for themselves or another an unlawful pecuniary benefit, causes damage to another’s property by persuading someone to act, omit, or tolerate something through the knowing misrepresentation of false facts as true, or through the unlawful concealment or suppression of true facts, shall be punished by imprisonment of at least three months, and if the damage caused is particularly large, by imprisonment of at least two years."\n\nFrom this provision it follows that, for the crime of fraud to be established, the following elements are required:\n\na) The intent of the perpetrator to obtain for themselves or another an unlawful pecuniary benefit, without it being necessary that the benefit actually materialize;\n\nb) The knowing misrepresentation of false facts as true, or the unlawful concealment or suppression of true facts, as a result of which—serving as the causal factor—someone is deceived and proceeds to an act, omission, or acquiescence that is detrimental to themselves or another; and\n\nc) Damage to another person’s property, as defined under civil law, which must be causally linked to the deceptive acts or omissions of the perpetrator. It is not required that the person deceived and the person who suffered the damage be the same individual.\n\nThe term “facts”, within the meaning of the above provision, refers to real circumstances relating to the past or present, and not to those that will occur in the future, such as mere promises or contractual obligations. However, when such promises or obligations are accompanied by false assurances and representations of other false facts referring to the present or the past, in such a manner as to create the impression of future fulfillment based on a false present situation fabricated by the perpetrator, who has already formed the decision not to fulfill their obligation, the crime of fraud is established.\n\nThe term “property” refers to the totality of a person’s economic assets that possess monetary value, while damage to property means its reduction—specifically, the difference between the monetary value the property had before the disposition caused by the fraudulent conduct and the value remaining after it. Property damage exists even if the victim possesses an active claim for restitution.\n\nThe time of commission of the fraud is considered to be the moment when the perpetrator acted and completed their fraudulent conduct, namely when they made the false representations that deceived the victim or a third party. Any subsequent moment at which the victim’s damage actually occurred—thereby completing the fraud—or the time when the victim carried out the harmful act or omission, is irrelevant.',
9 'Spear phishing targets specific individuals or employees within an organization using personalized, deceptive emails. Unlike mass phishing, these emails are crafted to seem familiar and urgent.\n\nScenarios:\n- CEO Fraud: Attackers impersonate executives to extract financial or sensitive data from employees.\n- Whaling: High-ranking executives are targeted using tailored fraud emails that press for immediate action without verification.',
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.6673, 0.4780],
19# [0.6673, 1.0000, 0.4691],
20# [0.4780, 0.4691, 1.0000]])dim_1024InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 1024
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.5238 |
| cosine_accuracy@3 | 0.5238 |
| cosine_accuracy@5 | 0.5238 |
| cosine_accuracy@10 | 0.619 |
| cosine_precision@1 | 0.5238 |
| cosine_precision@3 | 0.5079 |
| cosine_precision@5 | 0.4667 |
| cosine_precision@10 | 0.4429 |
| cosine_recall@1 | 0.0822 |
| cosine_recall@3 | 0.2228 |
| cosine_recall@5 | 0.2959 |
| cosine_recall@10 | 0.4766 |
| cosine_ndcg@10 | 0.5598 |
| cosine_mrr@10 | 0.5374 |
| cosine_map@100 | 0.6534 |
dim_768InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 768
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.5238 |
| cosine_accuracy@3 | 0.5238 |
| cosine_accuracy@5 | 0.5238 |
| cosine_accuracy@10 | 0.619 |
| cosine_precision@1 | 0.5238 |
| cosine_precision@3 | 0.5079 |
| cosine_precision@5 | 0.4667 |
| cosine_precision@10 | 0.4429 |
| cosine_recall@1 | 0.0822 |
| cosine_recall@3 | 0.2228 |
| cosine_recall@5 | 0.2959 |
| cosine_recall@10 | 0.4766 |
| cosine_ndcg@10 | 0.5598 |
| cosine_mrr@10 | 0.5374 |
| cosine_map@100 | 0.6531 |
dim_512InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 512
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.5238 |
| cosine_accuracy@3 | 0.5238 |
| cosine_accuracy@5 | 0.5238 |
| cosine_accuracy@10 | 0.619 |
| cosine_precision@1 | 0.5238 |
| cosine_precision@3 | 0.5079 |
| cosine_precision@5 | 0.4667 |
| cosine_precision@10 | 0.4429 |
| cosine_recall@1 | 0.0822 |
| cosine_recall@3 | 0.2228 |
| cosine_recall@5 | 0.2959 |
| cosine_recall@10 | 0.4766 |
| cosine_ndcg@10 | 0.5598 |
| cosine_mrr@10 | 0.5374 |
| cosine_map@100 | 0.6492 |
dim_256InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 256
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.619 |
| cosine_accuracy@3 | 0.619 |
| cosine_accuracy@5 | 0.619 |
| cosine_accuracy@10 | 0.6667 |
| cosine_precision@1 | 0.619 |
| cosine_precision@3 | 0.6032 |
| cosine_precision@5 | 0.5619 |
| cosine_precision@10 | 0.519 |
| cosine_recall@1 | 0.086 |
| cosine_recall@3 | 0.2342 |
| cosine_recall@5 | 0.3149 |
| cosine_recall@10 | 0.5029 |
| cosine_ndcg@10 | 0.6421 |
| cosine_mrr@10 | 0.6259 |
| cosine_map@100 | 0.6976 |
dim_128InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 128
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.5238 |
| cosine_accuracy@3 | 0.5238 |
| cosine_accuracy@5 | 0.5238 |
| cosine_accuracy@10 | 0.619 |
| cosine_precision@1 | 0.5238 |
| cosine_precision@3 | 0.5079 |
| cosine_precision@5 | 0.4667 |
| cosine_precision@10 | 0.4429 |
| cosine_recall@1 | 0.0812 |
| cosine_recall@3 | 0.2198 |
| cosine_recall@5 | 0.2909 |
| cosine_recall@10 | 0.4667 |
| cosine_ndcg@10 | 0.5598 |
| cosine_mrr@10 | 0.5374 |
| cosine_map@100 | 0.6479 |
dim_64InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 64
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.4286 |
| cosine_accuracy@3 | 0.4762 |
| cosine_accuracy@5 | 0.4762 |
| cosine_accuracy@10 | 0.5714 |
| cosine_precision@1 | 0.4286 |
| cosine_precision@3 | 0.4444 |
| cosine_precision@5 | 0.419 |
| cosine_precision@10 | 0.3952 |
| cosine_recall@1 | 0.0544 |
| cosine_recall@3 | 0.187 |
| cosine_recall@5 | 0.276 |
| cosine_recall@10 | 0.437 |
| cosine_ndcg@10 | 0.4918 |
| cosine_mrr@10 | 0.458 |
| cosine_map@100 | 0.5872 |
anchor and positive| anchor | positive | |
|---|---|---|
| type | string | string |
| details |
|
|
| anchor | positive |
|---|---|
What determines whether the act in question shall be punished if the offender is in the service of the legal holder of the data? | Everyone who obtains access to data recorded in a computer or in the external memory of a computer or transmitted by telecommunication systems shall be punished with imprisonment for up to six months or by a fine from 29 to 15,000 Euro, under the condition that these acts have been committed without right, especially in violation of prohibitions or of security measures taken by the legal holder. If the act concerns the international relations or the security of the State, he shall be punished according to Article 148.[object Object]If the offender is in the service of the legal holder of the data, the act of the preceding paragraph shall be punished only if it has been explicitly prohibited by internal regulations or by a written decision of the holder or of a competent employee of his.[object Object] |
What must be causally connected to the perpetrator's deceptive acts? | According to Article 386 paragraph 1 of the Greek Penal Code,[object Object][object Object]"Whoever, with the intent to obtain for themselves or another an unlawful pecuniary benefit, causes damage to another’s property by persuading someone to act, omit, or tolerate something through the knowing misrepresentation of false facts as true, or through the unlawful concealment or suppression of true facts, shall be punished by imprisonment of at least three months, and if the damage caused is particularly large, by imprisonment of at least two years."[object Object][object Object]From these provisions, it follows that, for the crime of fraud to be established, the following elements are required:[object Object][object Object]a) The intent of the perpetrator to obtain for themselves or another an unlawful pecuniary benefit;[object Object][object Object]b) The knowing misrepresentation of false facts as true, or the unlawful concealment or suppression of true facts, as a result of which—serving as the causal factor—someone is deceived and proceeds to an act, omission, or acquiescence detrimental to th... |
Who can be punished with imprisonment? | 1. Anyone who, by knowingly presenting false facts as true or by unlawfully concealing or withholding true facts, damages another person's property by persuading someone to act, omission, or tolerance with the aim of obtaining, for themselves or another, an unlawful financial gain from the damage to that property shall be punished with imprisonment, "and if the damage caused is particularly great, with imprisonment of at least three (3) months and a fine." .[object Object]If the damage caused exceeds a total of one hundred and twenty thousand (120,000) euros, imprisonment of up to ten (10) years and a fine shall be imposed.[object Object]2. If the fraud is directed directly against the legal entity of the Greek State, legal entities governed by public law, or local government organizations, and the damage caused exceeds a total of one hundred and twenty thousand (120,000) euros, a prison sentence of at least ten (10) years and a fine of up to one thousand (1,000) daily units shall be imposed. This offense shall b... |
MatryoshkaLoss with these parameters:
1{
2 "loss": "MultipleNegativesRankingLoss",
3 "matryoshka_dims": [
4 1024,
5 768,
6 512,
7 256,
8 128,
9 64
10 ],
11 "matryoshka_weights": [
12 1,
13 1,
14 1,
15 1,
16 1,
17 1
18 ],
19 "n_dims_per_step": -1
20}eval_strategy: epochgradient_accumulation_steps: 2learning_rate: 2e-05num_train_epochs: 10lr_scheduler_type: cosinewarmup_ratio: 0.1bf16: Truetf32: 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: 2eval_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: 10max_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: Truelocal_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_1024_cosine_ndcg@10 | 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 |
|---|---|---|---|---|---|---|---|---|
| 0.1818 | 1 | 18.029 | - | - | - | - | - | - |
| 0.3636 | 2 | 19.4106 | - | - | - | - | - | - |
| 0.5455 | 3 | 16.6201 | - | - | - | - | - | - |
| 0.7273 | 4 | 15.3048 | - | - | - | - | - | - |
| 0.9091 | 5 | 14.0182 | - | - | - | - | - | - |
| 1.0 | 6 | 6.4771 | - | - | - | - | - | - |
| 1.0909 | 7 | 6.7664 | 0.6167 | 0.5821 | 0.5524 | 0.5177 | 0.5278 | 0.4124 |
| 1.1818 | 8 | 11.8583 | - | - | - | - | - | - |
| 1.3636 | 9 | 11.9216 | - | - | - | - | - | - |
| 1.5455 | 10 | 13.3764 | - | - | - | - | - | - |
| 1.7273 | 11 | 12.9063 | - | - | - | - | - | - |
| 1.9091 | 12 | 13.5984 | - | - | - | - | - | - |
| 2.0 | 13 | 7.8523 | - | - | - | - | - | - |
| 2.0909 | 14 | 4.4487 | 0.5921 | 0.5921 | 0.5518 | 0.5709 | 0.5685 | 0.5113 |
| 2.1818 | 15 | 8.5374 | - | - | - | - | - | - |
| 2.3636 | 16 | 9.6999 | - | - | - | - | - | - |
| 2.5455 | 17 | 9.0121 | - | - | - | - | - | - |
| 2.7273 | 18 | 13.5705 | - | - | - | - | - | - |
| 2.9091 | 19 | 13.0195 | - | - | - | - | - | - |
| 3.0 | 20 | 7.9821 | - | - | - | - | - | - |
| 3.0909 | 21 | 3.2842 | 0.5159 | 0.5636 | 0.5468 | 0.5468 | 0.5468 | 0.5233 |
| 3.1818 | 22 | 4.4446 | - | - | - | - | - | - |
| 3.3636 | 23 | 5.7244 | - | - | - | - | - | - |
| 3.5455 | 24 | 7.1394 | - | - | - | - | - | - |
| 3.7273 | 25 | 16.7583 | - | - | - | - | - | - |
| 3.9091 | 26 | 11.3515 | - | - | - | - | - | - |
| 4.0 | 27 | 8.813 | - | - | - | - | - | - |
| 4.0909 | 28 | 6.9124 | 0.5159 | 0.5468 | 0.4992 | 0.5468 | 0.4992 | 0.4992 |
| 4.1818 | 29 | 6.1814 | - | - | - | - | - | - |
| 4.3636 | 30 | 7.1606 | - | - | - | - | - | - |
| 4.5455 | 31 | 5.0888 | - | - | - | - | - | - |
| 4.7273 | 32 | 5.0684 | - | - | - | - | - | - |
| 4.9091 | 33 | 6.7382 | - | - | - | - | - | - |
| 5.0 | 34 | 7.0497 | - | - | - | - | - | - |
| 5.0909 | 35 | 6.582 | 0.5598 | 0.5598 | 0.5598 | 0.6421 | 0.5598 | 0.4918 |
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}