SentenceTransformer based on sentence-transformers/all-mpnet-base-v2
This is a sentence-transformers model finetuned from sentence-transformers/all-mpnet-base-v2 on the json dataset. 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: sentence-transformers/all-mpnet-base-v2
- Maximum Sequence Length: 384 tokens
- Output Dimensionality: 768 dimensions
- Similarity Function: Cosine Similarity
- Training Dataset:
- json
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': 384, 'do_lower_case': False, 'architecture': 'MPNetModel'})
(1): Pooling({'word_embedding_dimension': 768, '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()
)
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("sentence_transformers_model_id")
# Run inference
sentences = [
'tation. A copy of the assessment, denial, or other determination you are disputing must be attached. Representative Information (complete only if you want someone to represent you during the reconsideration process) Power of Attorney (complete only if you want someone to represent you during the reconsideration process) By signing below, the petitioner(s) named in Section 1 appoints the individual named in Section 6 to act as their representative with full authority to receive confidential information and to perform any and all acts the petitioner can perform in connection with matters associated with this petition, except, the representative may not delegate their authority to another individual. If you wish to limit the authority granted by this Power of Attorney, please describe the limitation: A copy of the assessment, denial, or other determination (collectively referred to throughout these instructions as a “Determination”) you are disputing must be attached.',
'Criminals are targeting human resources and financial professionals across Maine with a new phishing scheme. Don’t fall victim. If you get an email asking you to send employee W-2 or other private/sensitive information, stop to confirm if the request is legitimate before you hit send. Criminals have perfected techniques to trick you into thinking an email is coming from a person you work with. Don’t fall victim to this scam. Connect with the person who you believe sent you the request by phone or by walking over to see them. Do not respond to the email to confirm the sender’s request. The sender could be a criminal, disguising their identity with a fake email address. If you confirm a legitimate request, take steps to protect the information before you send it. and place W-2 Scam in the subject line. • File a complaint with the Internet Crime Complaint Center (IC3), operated by the Federal Bureau of Investigation.',
'noise',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[ 1.0000, -0.2313, -0.0125],
# [-0.2313, 1.0000, 0.0933],
# [-0.0125, 0.0933, 1.0000]])
Training Details
Training Dataset
json
- Dataset: json
- Size: 16,975 training samples
- Columns:
sentence1,sentence2,score, andtype - Approximate statistics based on the first 1000 samples:
sentence1 sentence2 score type type string string float string details - min: 36 tokens
- mean: 179.93 tokens
- max: 270 tokens
- min: 21 tokens
- mean: 94.85 tokens
- max: 217 tokens
- min: 0.05
- mean: 0.49
- max: 1.0
- min: 3 tokens
- mean: 4.03 tokens
- max: 5 tokens
- Samples:
sentence1 sentence2 score type additional cost incurred providing job coaching, training and supervision on a supported work site. : "Supported Employment/Work" is a consumer-oriented, integrated, and non-segregated employment which is based on the individual's informed choice and which provides appropriate ongoing services to individual s with most significant disabilities in order for the individual to work productively in the community. Specifically, individuals in supported employment/work must: A. be engaged in part-time or full-time employment which pays wages and benefits commensurate with the individuals ability to produce goods or render services and which is based on current competitive rates at or above the minimum wage .All industrial facilities must implement a confined space entry program, including written procedures, employee training, and rescue plans, to comply with workplace safety requirements.0.3soft_negativeadditional cost incurred providing job coaching, training and supervision on a supported work site. : "Supported Employment/Work" is a consumer-oriented, integrated, and non-segregated employment which is based on the individual's informed choice and which provides appropriate ongoing services to individual s with most significant disabilities in order for the individual to work productively in the community. Specifically, individuals in supported employment/work must: A. be engaged in part-time or full-time employment which pays wages and benefits commensurate with the individuals ability to produce goods or render services and which is based on current competitive rates at or above the minimum wage .“Supported Employment/Work” permits payment of wages below the minimum wage and allows supported workers to be paid without regard to current competitive rates.0.6hard_negativevices and which is based on current competitive rates at or above the minimum wage . hat is individualized, and customized, consistent with the unique strengths, abilities, interests, and informed choice of the individual, including with ongoing support services for individuals with the most significant disabilities – For whom competitive integrated employment has not historically occurred, or for whom competitive integrated employment has been interrupted or intermittent as a result of a significant disability; and Who, because of the nature and severity of their disabilities, need intensive supported employment services and extended services after the transition from support provided by the designated State unit, in order to perform this work.Licensed businesses that discharge process water must install and operate best available technology to limit nutrient discharges and must submit semiannual effluent monitoring reports to the environmental agency.0.3soft_negative - Loss:
CoSENTLosswith these parameters:{ "scale": 40.0, "similarity_fct": "pairwise_cos_sim" }
Evaluation Dataset
json
- Dataset: json
- Size: 2,139 evaluation samples
- Columns:
sentence1,sentence2,score, andtype - Approximate statistics based on the first 1000 samples:
sentence1 sentence2 score type type string string float string details - min: 44 tokens
- mean: 181.52 tokens
- max: 329 tokens
- min: 22 tokens
- mean: 86.31 tokens
- max: 227 tokens
- min: 0.05
- mean: 0.5
- max: 1.0
- min: 3 tokens
- mean: 3.98 tokens
- max: 5 tokens
- Samples:
sentence1 sentence2 score type rce, after an individual has made the transition from support provided by the designated State unit. can produce a diminished or altered state of consciousness resulting in impairment of cognitive abilities or physical functioning; C. can result in the disturbance of behavioral or emotional functioning; E. can cause partial or total functional disability or psychological maladjustment. An applicant for or recipient of Extended Support services who is dissatisfied with any determination made by the Bureau of Rehabilitation Services concerning the furnishing or denial of services may request a timely review of the determination. The Bureau shall make reasonable accessibility accommodations for the individual with disabilities during the appeals process. Whenever possible, the Bureau will attempt to resolve conflicts through Informal Review or through Mediation. An individual may request a Due Process Hearing immediately without having to go through other appeal steps.Conditions described can impair consciousness, cognition, physical functioning, behavior, or emotional functioning and may cause partial or total functional disability or psychological maladjustment. An applicant or recipient dissatisfied with a Bureau of Rehabilitation Services decision about providing or denying Extended Support may request a timely review. The Bureau must provide reasonable accessibility accommodations during the appeals process, will attempt to resolve disputes through Informal Review or Mediation when possible, and an individual may request a Due Process Hearing immediately without first completing other appeal steps.1.0positiveThe purpose of this program is to provide ongoing extended supports to individuals with brain injuries who are VR consumers with the most significant disabilities once training has been completed. The program provides financial assistance to providers of ongoing support and/or employers to help defray the additional cost incurred providing job coaching, training and supervision on a supported work site.The program provides financial assistance only to individuals prior to completing training and does not fund supports for vocational rehabilitation consumers after training completion.0.6hard_negativer assessments and determinations. After I file a petition, do I still have to pay the amount due? No. However, interest, but not penalties, will continue to accrue during the appeals process. You can minimize additional interest by helping to get your case decided as quickly as possible. For example, if you have any documents that you want MRS to consider, you should attach copies to your petition. You should also be as specific as possible in explaining why you believe the assessment is not correct. However, if you have received a “jeopardy” assessment, you must immediately pay the assessed amount, or file a bond or other security, to prevent immediate collection proceedings. You may still file a petition within 60 days as with any other assessment. For any assessment, if you pay the amount due and MRS later determines that you do not owe some or all of the assessment, MRS will issue you a refund. Yes, if you think meeting with MRS would be helpful.No, filing a petition does not generally require you to pay the assessed amount while the appeal is pending. However, interest (but not penalties) will continue to accrue during the appeals process. You can help minimize further interest by promptly providing any documents you want MRS to consider and by explaining specifically why the assessment is incorrect. If you received a “jeopardy” assessment, you must immediately pay the assessed amount or post a bond or other security to avoid immediate collection; you may still file a petition within 60 days. If you pay an assessment and MRS later determines you did not owe some or all of it, MRS will issue a refund. If you believe a meeting with MRS would help, you may request one.1.0positive - Loss:
CoSENTLosswith these parameters:{ "scale": 40.0, "similarity_fct": "pairwise_cos_sim" }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy: epochper_device_train_batch_size: 16learning_rate: 1e-05weight_decay: 0.01num_train_epochs: 6warmup_ratio: 0.1fp16: Trueload_best_model_at_end: True
All Hyperparameters
Click to expand
overwrite_output_dir: Falsedo_predict: Falseeval_strategy: epochprediction_loss_only: Trueper_device_train_batch_size: 16per_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: 1e-05weight_decay: 0.01adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 6max_steps: -1lr_scheduler_type: linearlr_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: 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: 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}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}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthproject: huggingfacetrackio_space_id: trackioddp_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: Falsehub_revision: Nonegradient_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: noneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Trueprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}
Training Logs
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.4713 | 500 | 6.2293 | - |
| 0.9425 | 1000 | 1.8318 | - |
| 1.0 | 1061 | - | 0.5277 |
| 1.4138 | 1500 | 1.3701 | - |
| 1.8850 | 2000 | 0.9076 | - |
| 2.0 | 2122 | - | 0.4623 |
| 2.3563 | 2500 | 0.4613 | - |
| 2.8275 | 3000 | 0.3688 | - |
| 3.0 | 3183 | - | 0.3232 |
| 3.2988 | 3500 | 0.1959 | - |
| 3.7700 | 4000 | 0.1412 | - |
| 4.0 | 4244 | - | 0.3016 |
| 4.2413 | 4500 | 0.0838 | - |
| 4.7125 | 5000 | 0.0647 | - |
| 5.0 | 5305 | - | 0.3073 |
| 5.1838 | 5500 | 0.0338 | - |
| 5.6550 | 6000 | 0.0124 | - |
| 6.0 | 6366 | - | 0.2879 |
- The bold row denotes the saved checkpoint.
Framework Versions
- Python: 3.12.12
- Sentence Transformers: 5.1.2
- Transformers: 4.57.2
- PyTorch: 2.9.0+cu126
- Accelerate: 1.12.0
- Datasets: 4.4.1
- Tokenizers: 0.22.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",
}
CoSENTLoss
@article{10531646,
author={Huang, Xiang and Peng, Hao and Zou, Dongcheng and Liu, Zhiwei and Li, Jianxin and Liu, Kay and Wu, Jia and Su, Jianlin and Yu, Philip S.},
journal={IEEE/ACM Transactions on Audio, Speech, and Language Processing},
title={CoSENT: Consistent Sentence Embedding via Similarity Ranking},
year={2024},
doi={10.1109/TASLP.2024.3402087}
}
- Downloads last month
- 29
Model tree for hassaangyt/compliance-emb-v1
Base model
sentence-transformers/all-mpnet-base-v2