SentenceTransformer based on BAAI/bge-small-en
This is a sentence-transformers model finetuned from BAAI/bge-small-en. It maps sentences & paragraphs to a 384-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-small-en
- Maximum Sequence Length: 512 tokens
- Output Dimensionality: 384 tokens
- Similarity Function: Cosine Similarity
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': True}) with Transformer model: BertModel
(1): Pooling({'word_embedding_dimension': 384, '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("DrishtiSharma/bge-small-en-obliqa-5-epochs")
# Run inference
sentences = [
'How should an Authorised Person document and justify any deviations when mapping activities into business lines for Operational Risk capital purposes, particularly when they differ from regulatory capital calculations in other risk categories?',
'Principles for business line mapping. The mapping of activities into business lines for Operational Risk capital purposes should be consistent with the definitions of business lines used for regulatory capital calculations in other risk categories, i.e. credit and Market Risk. Any deviations from this principle should be clearly motivated and documented.',
'REGULATORY REQUIREMENTS FOR AUTHORISED PERSONS ENGAGED IN REGULATED ACTIVITIES IN RELATION TO VIRTUAL ASSETS\nPlanned and Unplanned system outages\nAuthorised Persons should have a programme of planned systems outages to provide for adequate opportunities to perform updates and testing. Authorised Persons should also have multiple communication channels to ensure that its Clients are informed, ahead of time, of any outages which may affect them.\n',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
Evaluation
Metrics
Information Retrieval
- Evaluated with
InformationRetrievalEvaluator
Metric | Value |
---|---|
cosine_accuracy@1 | 0.6255 |
cosine_accuracy@3 | 0.7518 |
cosine_accuracy@5 | 0.7934 |
cosine_accuracy@10 | 0.8368 |
cosine_precision@1 | 0.6255 |
cosine_precision@3 | 0.2641 |
cosine_precision@5 | 0.1703 |
cosine_precision@10 | 0.0931 |
cosine_recall@1 | 0.5488 |
cosine_recall@3 | 0.6705 |
cosine_recall@5 | 0.7117 |
cosine_recall@10 | 0.7628 |
cosine_ndcg@10 | 0.68 |
cosine_mrr@10 | 0.6976 |
cosine_map@100 | 0.6393 |
dot_accuracy@1 | 0.6255 |
dot_accuracy@3 | 0.7518 |
dot_accuracy@5 | 0.7934 |
dot_accuracy@10 | 0.8368 |
dot_precision@1 | 0.6255 |
dot_precision@3 | 0.2641 |
dot_precision@5 | 0.1703 |
dot_precision@10 | 0.0931 |
dot_recall@1 | 0.5488 |
dot_recall@3 | 0.6705 |
dot_recall@5 | 0.7117 |
dot_recall@10 | 0.7628 |
dot_ndcg@10 | 0.68 |
dot_mrr@10 | 0.6976 |
dot_map@100 | 0.6393 |
Training Details
Training Dataset
Unnamed Dataset
- Size: 22,291 training samples
- Columns:
sentence_0
andsentence_1
- Approximate statistics based on the first 1000 samples:
sentence_0 sentence_1 type string string details - min: 14 tokens
- mean: 34.77 tokens
- max: 68 tokens
- min: 12 tokens
- mean: 113.08 tokens
- max: 369 tokens
- Samples:
sentence_0 sentence_1 Could you outline the process for obtaining an ADGM Green Fund Designation or an ADGM Climate Transition Fund Designation, and what are the ongoing compliance obligations associated with these designations?
AUTHORISED PERSONS CONDUCTING A REGULATED ACTIVITY IN RELATION TO VIRTUAL ASSETS – EXTENSION INTO TO DIGITAL SECURITIES ACTIVITIES
MTFs using Virtual Assets – Becoming a Digital Securities RIE
Migration of a Virtual Assets MTF to a RIE is more complex than the extension of a Virtual Assets MTF into Digital Securities (as dealt with in paragraphs 63 - 67 above). This is due to a number of factors, including that a RIE is required to meet the full suite of requirements in Chapters 2 and 3 of MIR, and the primary market considerations associated with operating a RIE (e.g., requirement for Approved Prospectuses, admission to the Official List of Securities, and the ongoing technical/operational and regulatory requirements related to Digital Securities being admitted to trading and admitted to the Official List).Can the ADGM provide examples of effective internal risk control and reporting mechanisms that ensure an accurate assessment of a Reporting Entity's financial position and prospects, as per Rule 9.2.8?
Risk control. Authorised Persons should recognise and control the Credit Risk arising from their new products and services. Well in advance of entering into business transactions involving new types of products and activities, they should ensure that they understand the risks fully and have established appropriate Credit Risk policies, procedures and controls, which should be approved by the Governing Body or its appropriate delegated committee. A formal risk assessment of new products and activities should also be performed and documented.
What are the specific criteria used by the FSRA to determine whether a company's ESG disclosures align with a globally recognized standard?
The Regulator may refuse to grant an application for an ADGM Green Bond Designation or an ADGM Sustainability-Linked Bond Designation if it is not satisfied that the requirements of this section have been met or will be met on an ongoing basis.
- Loss:
MultipleNegativesRankingLoss
with these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim" }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy
: stepsper_device_train_batch_size
: 10per_device_eval_batch_size
: 10num_train_epochs
: 5multi_dataset_batch_sampler
: round_robin
All Hyperparameters
Click to expand
overwrite_output_dir
: Falsedo_predict
: Falseeval_strategy
: stepsprediction_loss_only
: Trueper_device_train_batch_size
: 10per_device_eval_batch_size
: 10per_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
: 5max_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
: 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
: 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
: Falsehub_always_push
: Falsegradient_checkpointing
: Falsegradient_checkpointing_kwargs
: Noneinclude_inputs_for_metrics
: Falseeval_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
: Falsebatch_sampler
: batch_samplermulti_dataset_batch_sampler
: round_robin
Training Logs
Epoch | Step | Training Loss | cosine_map@100 |
---|---|---|---|
0.0897 | 200 | - | 0.5994 |
0.1794 | 400 | - | 0.6027 |
0.2242 | 500 | 0.925 | - |
0.2691 | 600 | - | 0.6053 |
0.3587 | 800 | - | 0.6123 |
0.4484 | 1000 | 0.5995 | 0.5981 |
0.5381 | 1200 | - | 0.6230 |
0.6278 | 1400 | - | 0.6236 |
0.6726 | 1500 | 0.5963 | - |
0.7175 | 1600 | - | 0.6082 |
0.8072 | 1800 | - | 0.6192 |
0.8969 | 2000 | 0.5078 | 0.6128 |
0.9865 | 2200 | - | 0.6159 |
1.0 | 2230 | - | 0.6235 |
1.0762 | 2400 | - | 0.6232 |
1.1211 | 2500 | 0.4599 | - |
1.1659 | 2600 | - | 0.6122 |
1.2556 | 2800 | - | 0.6242 |
1.3453 | 3000 | 0.4054 | 0.6246 |
1.4350 | 3200 | - | 0.6364 |
1.5247 | 3400 | - | 0.6260 |
1.5695 | 3500 | 0.4197 | - |
1.6143 | 3600 | - | 0.6230 |
1.7040 | 3800 | - | 0.6324 |
1.7937 | 4000 | 0.3896 | 0.6384 |
1.8834 | 4200 | - | 0.6346 |
1.9731 | 4400 | - | 0.6279 |
2.0 | 4460 | - | 0.6296 |
2.0179 | 4500 | 0.3875 | - |
2.0628 | 4600 | - | 0.6263 |
2.1525 | 4800 | - | 0.6326 |
2.2422 | 5000 | 0.3117 | 0.6306 |
2.3318 | 5200 | - | 0.6351 |
2.4215 | 5400 | - | 0.6330 |
2.4664 | 5500 | 0.3327 | - |
2.5112 | 5600 | - | 0.6355 |
2.6009 | 5800 | - | 0.6323 |
2.6906 | 6000 | 0.3017 | 0.6249 |
2.7803 | 6200 | - | 0.6324 |
2.8700 | 6400 | - | 0.6326 |
2.9148 | 6500 | 0.2971 | - |
2.9596 | 6600 | - | 0.6306 |
3.0 | 6690 | - | 0.6368 |
3.0493 | 6800 | - | 0.6351 |
3.1390 | 7000 | 0.2755 | 0.6308 |
3.2287 | 7200 | - | 0.6372 |
3.3184 | 7400 | - | 0.6390 |
3.3632 | 7500 | 0.2639 | - |
3.4081 | 7600 | - | 0.6326 |
3.4978 | 7800 | - | 0.6351 |
3.5874 | 8000 | 0.2474 | 0.6377 |
3.6771 | 8200 | - | 0.6375 |
3.7668 | 8400 | - | 0.6380 |
3.8117 | 8500 | 0.2402 | - |
3.8565 | 8600 | - | 0.6407 |
3.9462 | 8800 | - | 0.6401 |
4.0 | 8920 | - | 0.6433 |
4.0359 | 9000 | 0.2628 | 0.6452 |
4.1256 | 9200 | - | 0.6432 |
4.2152 | 9400 | - | 0.6426 |
4.2601 | 9500 | 0.2318 | - |
4.3049 | 9600 | - | 0.6404 |
4.3946 | 9800 | - | 0.6390 |
4.4843 | 10000 | 0.2246 | 0.6389 |
4.5740 | 10200 | - | 0.6394 |
4.6637 | 10400 | - | 0.6388 |
4.7085 | 10500 | 0.2054 | - |
4.7534 | 10600 | - | 0.6396 |
4.8430 | 10800 | - | 0.6389 |
4.9327 | 11000 | 0.2194 | 0.6394 |
5.0 | 11150 | - | 0.6393 |
Framework Versions
- Python: 3.10.12
- Sentence Transformers: 3.1.1
- Transformers: 4.45.2
- PyTorch: 2.5.1+cu121
- Accelerate: 1.2.0.dev0
- Datasets: 3.1.0
- Tokenizers: 0.20.3
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",
}
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
- 0
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 DrishtiSharma/bge-small-en-obliqa-5-epochs
Base model
BAAI/bge-small-enEvaluation results
- Cosine Accuracy@1 on Unknownself-reported0.626
- Cosine Accuracy@3 on Unknownself-reported0.752
- Cosine Accuracy@5 on Unknownself-reported0.793
- Cosine Accuracy@10 on Unknownself-reported0.837
- Cosine Precision@1 on Unknownself-reported0.626
- Cosine Precision@3 on Unknownself-reported0.264
- Cosine Precision@5 on Unknownself-reported0.170
- Cosine Precision@10 on Unknownself-reported0.093
- Cosine Recall@1 on Unknownself-reported0.549
- Cosine Recall@3 on Unknownself-reported0.670