Edit model card

SentenceTransformer based on BAAI/bge-base-en-v1.5

This is a sentence-transformers model finetuned from BAAI/bge-base-en-v1.5. 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.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: BAAI/bge-base-en-v1.5
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 768 tokens
  • Similarity Function: Cosine Similarity
  • Language: en
  • License: apache-2.0

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': True}) with Transformer model: 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()
)

Usage

Direct Usage (Sentence Transformers)

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("MugheesAwan11/bge-base-securiti-dataset-1-v9")
# Run inference
sentences = [
    "PR and Federal Data Protection Act within Germany; To promote awareness within the public related to the risks, rules, safeguards, and rights concerning the processing of personal data; To handle all complaints raised by data subjects related to data processing in addition to carrying out investigations to find out if any data handler has breached any provisions of the Act; ## Penalties for Non compliance The GDPR already laid down some stringent penalties for companies that would be found in breach of the law's provisions. More importantly, as opposed to other data protection laws such as the CCPA and CPRA, non-compliance with the law also meant penalties. Germany's Federal Data Protection Act has a slightly more lenient take in this regard. Suppose a data handler is found to have fraudulently collected data, processed, shared, or sold data without proper consent from the data subjects, not responded or responded with delay to a data subject request, or failed to inform the data subject of a breach properly. In that case, it can be fined up to €50,000. This is in addition to the GDPR's €20 million or 4% of the total worldwide annual turnover of the preceding financial year, whichever is higher, that any organisation found in breach of the law is subject to. However, for this fine to be applied, either the data subject, the Federal Commissioner, or the regulatory authority must file an official complaint. ## How an Organization Can Operationalize the Law Data handlers processing data inside Germany can remain compliant with the country's data protection law if they fulfill the following conditions: Have a comprehensive privacy policy that educates all users of their rights and how to contact the relevant personnel within the organisation in case of a query Hire a competent Data Protection Officer that understands the GDPR and Federal Data Protection Act thoroughly and can lead compliance efforts within your organisation Ensure all the company's employees and staff are acutely aware of their responsibilities under the law Conduct regular data protection impact assessments as well as data mapping exercises to ensure maximum efficiency in your compliance efforts Notify the relevant authorities of a data breach as soon as possible ## How can Securiti Help Data privacy and compliance have become incredibly vital in earning users' trust globally. Most users now expect most businesses to take all the relevant measures to ensure the data they collect is properly stored, protected, and maintained. Data protection laws have made such efforts legally mandatory",
    "What is required for an official complaint to be filed under Germany's Federal Data Protection Act?",
    'Why is tracking data lineage important for data management and security?',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

Evaluation

Metrics

Information Retrieval

Metric Value
cosine_accuracy@1 0.08
cosine_accuracy@3 0.31
cosine_accuracy@5 0.47
cosine_accuracy@10 0.65
cosine_precision@1 0.08
cosine_precision@3 0.1033
cosine_precision@5 0.094
cosine_precision@10 0.065
cosine_recall@1 0.08
cosine_recall@3 0.31
cosine_recall@5 0.47
cosine_recall@10 0.65
cosine_ndcg@10 0.3343
cosine_mrr@10 0.2366
cosine_map@100 0.2498

Information Retrieval

Metric Value
cosine_accuracy@1 0.09
cosine_accuracy@3 0.29
cosine_accuracy@5 0.46
cosine_accuracy@10 0.65
cosine_precision@1 0.09
cosine_precision@3 0.0967
cosine_precision@5 0.092
cosine_precision@10 0.065
cosine_recall@1 0.09
cosine_recall@3 0.29
cosine_recall@5 0.46
cosine_recall@10 0.65
cosine_ndcg@10 0.3343
cosine_mrr@10 0.2371
cosine_map@100 0.2495

Information Retrieval

Metric Value
cosine_accuracy@1 0.08
cosine_accuracy@3 0.28
cosine_accuracy@5 0.43
cosine_accuracy@10 0.6
cosine_precision@1 0.08
cosine_precision@3 0.0933
cosine_precision@5 0.086
cosine_precision@10 0.06
cosine_recall@1 0.08
cosine_recall@3 0.28
cosine_recall@5 0.43
cosine_recall@10 0.6
cosine_ndcg@10 0.3082
cosine_mrr@10 0.2182
cosine_map@100 0.233

Information Retrieval

Metric Value
cosine_accuracy@1 0.05
cosine_accuracy@3 0.17
cosine_accuracy@5 0.36
cosine_accuracy@10 0.53
cosine_precision@1 0.05
cosine_precision@3 0.0567
cosine_precision@5 0.072
cosine_precision@10 0.053
cosine_recall@1 0.05
cosine_recall@3 0.17
cosine_recall@5 0.36
cosine_recall@10 0.53
cosine_ndcg@10 0.2497
cosine_mrr@10 0.1642
cosine_map@100 0.1814

Training Details

Training Dataset

Unnamed Dataset

  • Size: 900 training samples
  • Columns: positive and anchor
  • Approximate statistics based on the first 1000 samples:
    positive anchor
    type string string
    details
    • min: 159 tokens
    • mean: 445.26 tokens
    • max: 512 tokens
    • min: 7 tokens
    • mean: 22.05 tokens
    • max: 82 tokens
  • Samples:
    positive anchor
    orra The Andorra personal data protection act came into force on May 17, 2022, by the Andorra Data Protection Authority (ADPA). Learn more about Andorra PDPA ### United Kingdom The UK Data Protection Act (DPA) 2018 is the amended version of the Data Protection Act that was passed in 1998. The DPA 2018 implements the GDPR with several additions and restrictions. Learn more about UK DPA ### Botswana The Botswana Data Protection came into effect on October 15, 2021 after the issuance of the Data Protection Act (Commencement Date) Order 2021 by the Minister of Presidential Affairs, Governance and Public Administration. Learn more about Botswana DPA ### Zambia On March 31, 2021, the Zambian parliament formally passed the Data Protection Act No. 3 of 2021 and the Electronic Communications and Transactions Act No. 4 of 2021. Learn more about Zambia DPA ### Jamaica On November 30, 2020, the First Schedule of the Data Protection Act No. 7 of 2020 came into effect following the publication of Supplement No. 160 of Volume CXLIV in the Jamaica Gazette Supplement. Learn more about Jamaica DPA ### Belarus The Law on Personal Data Protection of May 7, 2021, No. 99-Z, entered into effect within Belarus on November 15, 2021. Learn more about Belarus DPA ### Russian Federation The primary Russian law on data protection, Federal Law No. 152-FZ has been in effect since July 2006. Learn more ### Eswatini On March 4, 2022, the Eswatini Communications Commission published the Data Protection Act No. 5 of 2022, simultaneously announcing its immediate enforcement. Learn more ### Oman The Royal Decree 6/2022 promulgating the Personal Data Protection Law (PDPL) was passed on February 9, 2022. Learn more ### Sri Lanka Sri Lanka's parliament formally passed the Personal Data Protection Act (PDPA), No. 9 Of 2022, on March 19, 2022. Learn more ### Kuwait Kuwait's DPPR was formally introduced by the CITRA to ensure the Gulf country's data privacy infrastructure. Learn more ### Brunei Darussalam The draft Personal Data Protection Order is Brunei’s primary data protection law which came into effect in 2022. Learn more ### India India’ What is the name of India's data protection law before May 17, 2022?
    the affected data subjects and regulatory authority about the breach and whether any of their information has been compromised as a result. ### Data Protection Impact Assessment There is no requirement for conducting data protection impact assessment under the PDPA. ### Record of Processing Activities A data controller must keep and maintain a record of any privacy notice, data subject request, or any other information relating to personal data processed by him in the form and manner that may be determined by the regulatory authority. ### Cross Border Data Transfer Requirements The PDPA provides that personal data can be transferred out of Malaysia only when the recipient country is specified as adequate in the Official Gazette. The personal data of data subjects can not be disclosed without the consent of the data subject. The PDPA provides the following exceptions to the cross border data transfer requirements: Where the consent of data subject is obtained for transfer; or Where the transfer is necessary for the performance of contract between the parties; The transfer is for the purpose of any legal proceedings or for the purpose of obtaining legal advice or for establishing, exercising or defending legal rights; The data user has taken all reasonable precautions and exercised all due diligence to ensure that the personal data will not in that place be processed in any manner which, if that place is Malaysia, would be a contravention of this PDPA; The transfer is necessary in order to protect the vital interests of the data subject; or The transfer is necessary as being in the public interest in circumstances as determined by the Minister. ## Data Subject Rights The data subjects or the person whose data is being collected has certain rights under the PDPA. The most prominent rights can be categorized under the following: ## Right to withdraw consent The PDPA, like some of the other landmark data protection laws such as CPRA and GDPR gives data subjects the right to revoke their consent at any time by way of written notice from having their data collected processed. ## Right to access and rectification As per this right, anyone whose data has been collected has the right to request to review their personal data and have it updated. The onus is on the data handlers to respond to such a request as soon as possible while also making it easier for data subjects on how they can request access to their personal data. ## Right to data portability Data subjects have the right to request that their data be stored in a manner where it What is the requirement for conducting a data protection impact assessment under the PDPA?
    more Privacy Automate compliance with global privacy regulations Data Mapping Automation View Data Subject Request Automation View People Data Graph View Assessment Automation View Cookie Consent View Universal Consent View Vendor Risk Assessment View Breach Management View Privacy Policy Management View Privacy Center View Learn more Security Identify data risk and enable protection & control Data Security Posture Management View Data Access Intelligence & Governance View Data Risk Management View Data Breach Analysis View Learn more Governance Optimize Data Governance with granular insights into your data Data Catalog View Data Lineage View Data Quality View Data Controls Orchestrator View Solutions Technologies Covering you everywhere with 1000+ integrations across data systems. Snowflake View AWS View Microsoft 365 View Salesforce View Workday View GCP View Azure View Oracle View Learn more Regulations Automate compliance with global privacy regulations. US California CCPA View US California CPRA View European Union GDPR View Thailand’s PDPA View China PIPL View Canada PIPEDA View Brazil's LGPD View + More View Learn more Roles Identify data risk and enable protection & control. Privacy View Security View Governance View Marketing View Resources Blog Read through our articles written by industry experts Collateral Product brochures, white papers, infographics, analyst reports and more. Knowledge Center Learn about the data privacy, security and governance landscape. Securiti Education Courses and Certifications for data privacy, security and governance professionals. Company About Us Learn all about What is Data Subject Request Automation?
  • Loss: MatryoshkaLoss with these parameters:
    {
        "loss": "MultipleNegativesRankingLoss",
        "matryoshka_dims": [
            512,
            256,
            128,
            64
        ],
        "matryoshka_weights": [
            1,
            1,
            1,
            1
        ],
        "n_dims_per_step": -1
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: epoch
  • per_device_train_batch_size: 32
  • per_device_eval_batch_size: 16
  • learning_rate: 2e-05
  • num_train_epochs: 2
  • lr_scheduler_type: cosine
  • warmup_ratio: 0.1
  • bf16: True
  • tf32: True
  • load_best_model_at_end: True
  • optim: adamw_torch_fused
  • batch_sampler: no_duplicates

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: epoch
  • prediction_loss_only: True
  • per_device_train_batch_size: 32
  • per_device_eval_batch_size: 16
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • learning_rate: 2e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1.0
  • num_train_epochs: 2
  • max_steps: -1
  • lr_scheduler_type: cosine
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.1
  • warmup_steps: 0
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • save_safetensors: True
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • no_cuda: False
  • use_cpu: False
  • use_mps_device: False
  • seed: 42
  • data_seed: None
  • jit_mode_eval: False
  • use_ipex: False
  • bf16: True
  • fp16: False
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: True
  • local_rank: 0
  • ddp_backend: None
  • tpu_num_cores: None
  • tpu_metrics_debug: False
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • past_index: -1
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: True
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_min_num_params: 0
  • fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch_fused
  • optim_args: None
  • adafactor: False
  • group_by_length: False
  • length_column_name: length
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • skip_memory_metrics: True
  • use_legacy_prediction_loop: False
  • push_to_hub: False
  • resume_from_checkpoint: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_private_repo: False
  • hub_always_push: False
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • eval_do_concat_batches: True
  • fp16_backend: auto
  • push_to_hub_model_id: None
  • push_to_hub_organization: None
  • mp_parameters:
  • auto_find_batch_size: False
  • full_determinism: False
  • torchdynamo: None
  • ray_scope: last
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • dispatch_batches: None
  • split_batches: None
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: False
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • batch_sampler: no_duplicates
  • multi_dataset_batch_sampler: proportional

Training Logs

Epoch Step Training Loss dim_128_cosine_map@100 dim_256_cosine_map@100 dim_512_cosine_map@100 dim_64_cosine_map@100
0.3448 10 7.0997 - - - -
0.6897 20 5.0842 - - - -
1.0 29 - 0.2367 0.2561 0.2502 0.1813
1.0345 30 4.7423 - - - -
1.3793 40 3.7933 - - - -
1.7241 50 3.4879 - - - -
2.0 58 - 0.233 0.2495 0.2498 0.1814
  • The bold row denotes the saved checkpoint.

Framework Versions

  • Python: 3.10.14
  • Sentence Transformers: 3.0.1
  • Transformers: 4.41.2
  • PyTorch: 2.1.2+cu121
  • Accelerate: 0.31.0
  • Datasets: 2.19.1
  • Tokenizers: 0.19.1

Citation

BibTeX

Sentence Transformers

@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",
}

MatryoshkaLoss

@misc{kusupati2024matryoshka,
    title={Matryoshka Representation Learning}, 
    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},
    year={2024},
    eprint={2205.13147},
    archivePrefix={arXiv},
    primaryClass={cs.LG}
}

MultipleNegativesRankingLoss

@misc{henderson2017efficient,
    title={Efficient Natural Language Response Suggestion for Smart Reply}, 
    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},
    year={2017},
    eprint={1705.00652},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}
Downloads last month
5
Safetensors
Model size
109M params
Tensor type
F32
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Model tree for MugheesAwan11/bge-base-securiti-dataset-1-v9

Finetuned
(257)
this model

Evaluation results