SentenceTransformer based on sentence-transformers/all-MiniLM-L6-v2

This is a sentence-transformers model finetuned from sentence-transformers/all-MiniLM-L6-v2. 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: sentence-transformers/all-MiniLM-L6-v2
  • Maximum Sequence Length: 256 tokens
  • Output Dimensionality: 384 dimensions
  • Similarity Function: Cosine Similarity

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 256, 'do_lower_case': False}) with Transformer model: BertModel 
  (1): Pooling({'word_embedding_dimension': 384, '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("Bea-Taylor/objection_fine_tuned_4")
# Run inference
sentences = [
    'It will also reduce/limit/block east facing views of Canary Wharf for Swedish Quays residents next door. In turn, this will have a knock on effect on the value of our property because views of Canary Wharf are sought after by potential buyers.',
    'I support the planning application for the proposed development of the roof space. This project is a vital step toward easing the financial burden on residents and addressing ongoing concerns effectively. Additionally, it brings the added benefit of a positive environmental impact, contributing to a more sustainable and responsible community.',
    'My health has really suffered over the last two years during which, I have had 3 heart attacks and have recently been diagnosed with anaemia and emphysema as well as having stents surgically placed in my arteries. I am on twelve tablets a day for my health and this whole subject is creating all my health conditions to worsen. All I can do is emphasise my objections and hope that Barnet Council decline building permission.',
]
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

Semantic Similarity

Metric Value
pearson_cosine 0.9829
spearman_cosine 0.9159

Training Details

Training Dataset

Unnamed Dataset

  • Size: 180,000 training samples
  • Columns: text1, text2, and label
  • Approximate statistics based on the first 1000 samples:
    text1 text2 label
    type string string float
    details
    • min: 3 tokens
    • mean: 50.78 tokens
    • max: 256 tokens
    • min: 3 tokens
    • mean: 50.72 tokens
    • max: 256 tokens
    • min: 0.0
    • mean: 0.36
    • max: 1.0
  • Samples:
    text1 text2 label
    Loss of Daylight and Sunlight Fifthly, the increased height of the building with an additional storey will further reduce the available sunlight hours in my first floor flat leading to increased heating costs as well as a reduction in my quality of life. As the sun barely gets above the level of the existing building in the winter months it is likely I will spend much of the winter with the rear of my flat continually in shadow. 0.75
    The existing carpark has a maximum of 16 car parking spaces for the 37 flats, used on a first come first served basis. As the other comments on this application state, the building works appear to be complete and the application does not appear to demonstrate the scale of the work or the reality of the build. 0.0
    Are you proposing to connect to the existing drainage system? The design of the types of buildings being proposed is out of character with the area. I object to the removal of the existing footbridge... this is unacceptable and will cut the area of Victoria Park off from Cromer road - a currently safe route which pedestrians and school children use to access without having to cross road and the promise of new access or pedestrian routes will mean walking public pavements around New Barnet via Station Road. I am not convinced by the developers that an alternative safer route will be provided as they will say anything to obtain planning. 0.0
  • Loss: CosineSimilarityLoss with these parameters:
    {
        "loss_fct": "torch.nn.modules.loss.MSELoss"
    }
    

Evaluation Dataset

Unnamed Dataset

  • Size: 20,000 evaluation samples
  • Columns: text1, text2, and label
  • Approximate statistics based on the first 1000 samples:
    text1 text2 label
    type string string float
    details
    • min: 3 tokens
    • mean: 49.71 tokens
    • max: 256 tokens
    • min: 4 tokens
    • mean: 51.7 tokens
    • max: 256 tokens
    • min: 0.0
    • mean: 0.33
    • max: 1.0
  • Samples:
    text1 text2 label
    1. Significant noise and disruption for local residents of rainbow quay and surrounding developments - Including over looking Princes Court and blocking already limited light. I object to the developer changing the goal posts in order to achieve more profit as it is not the families who need social housing who will benefit or the young people trying to get on the property ladder and can't but the developer who profits from those who can "afford" to pay the "high prices" of Barnet accommodation. 0.0
    Congestion on Camlet way and beach hill , roads which already have traffic issues! TRAFFIC AND PARKING - Granville Road has limited off road parking and is a busy & important thoroughfare from Ballards Lane, to High Road North Finchley & Summers Lane, linking Finchley & Friern Barnet. The addition of two further flats without parking provision would increase the pressure for parking spaces. 0.75
    It will also obstruct light to my property and garden. - Health and safety: concern for disruption building works will cause, damage to local infrastructure, increased traffic 0.0
  • Loss: CosineSimilarityLoss with these parameters:
    {
        "loss_fct": "torch.nn.modules.loss.MSELoss"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • learning_rate: 2e-05
  • num_train_epochs: 1
  • warmup_ratio: 0.1
  • fp16: True

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: steps
  • prediction_loss_only: True
  • per_device_train_batch_size: 16
  • 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
  • torch_empty_cache_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: 1
  • max_steps: -1
  • lr_scheduler_type: linear
  • 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: False
  • fp16: True
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • 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: False
  • 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
  • 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: None
  • hub_always_push: False
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • include_for_metrics: []
  • 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
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: False
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • eval_on_start: False
  • use_liger_kernel: False
  • eval_use_gather_object: False
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: proportional

Training Logs

Click to expand
Epoch Step Training Loss Validation Loss sts-dev_spearman_cosine
-1 -1 - - 0.3501
0.0089 100 0.1082 0.1113 0.3928
0.0178 200 0.1088 0.1000 0.4880
0.0267 300 0.0931 0.0857 0.5950
0.0356 400 0.0765 0.0749 0.6603
0.0444 500 0.0725 0.0685 0.6929
0.0533 600 0.066 0.0622 0.7216
0.0622 700 0.0568 0.0558 0.7506
0.0711 800 0.0525 0.0498 0.7749
0.08 900 0.048 0.0453 0.7926
0.0889 1000 0.0438 0.0412 0.8091
0.0978 1100 0.0447 0.0375 0.8239
0.1067 1200 0.0391 0.0336 0.8357
0.1156 1300 0.0359 0.0305 0.8486
0.1244 1400 0.0307 0.0272 0.8565
0.1333 1500 0.0289 0.0251 0.8621
0.1422 1600 0.0256 0.0233 0.8667
0.1511 1700 0.0285 0.0221 0.8702
0.16 1800 0.0229 0.0206 0.8743
0.1689 1900 0.0228 0.0193 0.8781
0.1778 2000 0.022 0.0182 0.8814
0.1867 2100 0.0197 0.0173 0.8827
0.1956 2200 0.0185 0.0167 0.8837
0.2044 2300 0.0202 0.0162 0.8850
0.2133 2400 0.0178 0.0151 0.8883
0.2222 2500 0.0174 0.0147 0.8896
0.2311 2600 0.0171 0.0146 0.8891
0.24 2700 0.0163 0.0136 0.8921
0.2489 2800 0.0147 0.0131 0.8934
0.2578 2900 0.0149 0.0129 0.8953
0.2667 3000 0.0152 0.0122 0.8966
0.2756 3100 0.0138 0.0120 0.8969
0.2844 3200 0.0128 0.0114 0.8977
0.2933 3300 0.0128 0.0111 0.8991
0.3022 3400 0.0117 0.0106 0.9005
0.3111 3500 0.0126 0.0104 0.9009
0.32 3600 0.0118 0.0102 0.9020
0.3289 3700 0.0115 0.0100 0.9016
0.3378 3800 0.0115 0.0098 0.9019
0.3467 3900 0.0116 0.0092 0.9035
0.3556 4000 0.0113 0.0090 0.9042
0.3644 4100 0.0117 0.0090 0.9043
0.3733 4200 0.0097 0.0084 0.9054
0.3822 4300 0.0098 0.0087 0.9052
0.3911 4400 0.0098 0.0085 0.9054
0.4 4500 0.0097 0.0084 0.9056
0.4089 4600 0.0097 0.0082 0.9057
0.4178 4700 0.0102 0.0080 0.9066
0.4267 4800 0.0086 0.0079 0.9071
0.4356 4900 0.0085 0.0078 0.9070
0.4444 5000 0.009 0.0076 0.9080
0.4533 5100 0.0091 0.0073 0.9085
0.4622 5200 0.0084 0.0073 0.9085
0.4711 5300 0.0082 0.0071 0.9089
0.48 5400 0.0073 0.0070 0.9089
0.4889 5500 0.0096 0.0069 0.9098
0.4978 5600 0.007 0.0068 0.9097
0.5067 5700 0.0078 0.0070 0.9096
0.5156 5800 0.0079 0.0067 0.9102
0.5244 5900 0.0097 0.0067 0.9107
0.5333 6000 0.0077 0.0065 0.9110
0.5422 6100 0.0084 0.0065 0.9112
0.5511 6200 0.007 0.0063 0.9113
0.56 6300 0.0073 0.0062 0.9117
0.5689 6400 0.0078 0.0066 0.9107
0.5778 6500 0.0082 0.0062 0.9116
0.5867 6600 0.0066 0.0061 0.9119
0.5956 6700 0.0076 0.0060 0.9122
0.6044 6800 0.0076 0.0060 0.9120
0.6133 6900 0.0075 0.0059 0.9123
0.6222 7000 0.0071 0.0059 0.9126
0.6311 7100 0.0076 0.0057 0.9130
0.64 7200 0.0067 0.0056 0.9131
0.6489 7300 0.0069 0.0057 0.9130
0.6578 7400 0.0068 0.0055 0.9134
0.6667 7500 0.0073 0.0054 0.9136
0.6756 7600 0.0063 0.0056 0.9131
0.6844 7700 0.0068 0.0054 0.9134
0.6933 7800 0.0057 0.0054 0.9135
0.7022 7900 0.0073 0.0053 0.9137
0.7111 8000 0.0063 0.0053 0.9139
0.72 8100 0.0061 0.0052 0.9139
0.7289 8200 0.0062 0.0052 0.9141
0.7378 8300 0.0065 0.0051 0.9143
0.7467 8400 0.0061 0.0052 0.9141
0.7556 8500 0.0064 0.0050 0.9146
0.7644 8600 0.0056 0.0050 0.9146
0.7733 8700 0.006 0.0050 0.9146
0.7822 8800 0.0066 0.0049 0.9147
0.7911 8900 0.005 0.0048 0.9150
0.8 9000 0.0056 0.0048 0.9149
0.8089 9100 0.0061 0.0048 0.9149
0.8178 9200 0.0057 0.0047 0.9149
0.8267 9300 0.0075 0.0048 0.9150
0.8356 9400 0.0057 0.0047 0.9152
0.8444 9500 0.0055 0.0047 0.9151
0.8533 9600 0.0056 0.0047 0.9153
0.8622 9700 0.0049 0.0047 0.9153
0.8711 9800 0.0066 0.0047 0.9154
0.88 9900 0.0054 0.0046 0.9154
0.8889 10000 0.0055 0.0046 0.9154
0.8978 10100 0.0055 0.0046 0.9155
0.9067 10200 0.0048 0.0045 0.9155
0.9156 10300 0.0046 0.0045 0.9156
0.9244 10400 0.0063 0.0045 0.9157
0.9333 10500 0.0055 0.0045 0.9157
0.9422 10600 0.0059 0.0045 0.9158
0.9511 10700 0.0049 0.0045 0.9158
0.96 10800 0.0058 0.0045 0.9158
0.9689 10900 0.0052 0.0045 0.9158
0.9778 11000 0.0065 0.0044 0.9159
0.9867 11100 0.0053 0.0044 0.9159
0.9956 11200 0.0046 0.0044 0.9159
-1 -1 - - 0.9159

Framework Versions

  • Python: 3.10.17
  • Sentence Transformers: 4.1.0
  • Transformers: 4.52.4
  • PyTorch: 2.7.0
  • Accelerate: 1.7.0
  • Datasets: 3.6.0
  • Tokenizers: 0.21.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",
}
Downloads last month
70
Safetensors
Model size
22.7M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Bea-Taylor/objection_fine_tuned_4

Paper for Bea-Taylor/objection_fine_tuned_4

Evaluation results