Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks
Paper
•
1908.10084
•
Published
•
12
This is a sentence-transformers model finetuned from DarshanKumarA/nyay-ai-user-1. 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.
SentenceTransformer(
(0): Transformer({'max_seq_length': 256, 'do_lower_case': False, 'architecture': '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()
)
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 = [
"G.M. Talang vs The Union Of India on 11 April, 1974\r\n\r\nThis is an appeal by special leave from the judgment of the High Court of Delhi dismissing a writ petition filed by the appellant challenging the termination of his service.\r\n\r\nThe appellant was employed as a Senior Scientific Officer in the Ministry of Defence. His services were terminated by an order dated January 20, 1971, under Rule 5 of the Central Civil Services (Temporary Service) Rules, 1965. The rule provides that the services of a temporary Government servant shall be liable to termination at any time by a notice in writing given either by the Government servant to the appointing authority or by the appointing authority to the Government servant.\r\n\r\nThe appellant contended that the termination order was punitive in nature and was passed in violation of Article 311 of the Constitution. He alleged that the termination was a camouflage for his dismissal on the ground of his alleged association with certain undesirable elements. The High Court rejected this contention and held that the termination was a simple termination of service under the rules and was not punitive.\r\n\r\nThe main question for consideration in this appeal is whether the termination of the appellant's service was punitive in nature. It is now well settled that the form of the order is not conclusive and the court can go behind the order to find out the true character of the action. If the court finds that the termination is a mere camouflage for dismissing the employee on grounds of misconduct, it will be held to be punitive and will be struck down if the provisions of Article 311 have not been complied with.\r\n\r\nIn the present case, the termination order is ex facie a simple order of termination. There is nothing in the order to suggest that it was passed by way of punishment. The appellant has not been able to produce any evidence to show that the termination was a camouflage for his dismissal. The mere fact that some preliminary inquiry was held to ascertain the appellant's suitability for the post does not make the termination punitive.\r\n\r\nWe are, therefore, of the opinion that the High Court was right in holding that the termination of the appellant's service was not punitive. The appeal is accordingly dismissed. There will be no order as to costs.",
"Delhi Transport Corporation vs D.T.C. Mazdoor Congress on 4 September, 1990\r\n\r\nThis appeal by the Delhi Transport Corporation is directed against the judgment of a Division Bench of the Delhi High Court declaring certain regulations empowering the Corporation to terminate the services of a permanent employee by giving one month's notice as ultra vires Article 14 of the Constitution.\r\n\r\nThe respondent, a permanent employee of the Corporation, was served with a notice of termination under Regulation 9(b) of the Delhi Road Transport Authority (Conditions of Appointment and Service) Regulations, 1952. The regulation provided that the service of an employee could be terminated by giving one month's notice or pay in lieu thereof without assigning any reason.\r\n\r\nThe respondent challenged the validity of the regulation on the ground that it was arbitrary and conferred unguided power on the authority. The High Court accepted the contention and struck down the regulation.\r\n\r\nThe question that arises for consideration is whether a regulation which empowers a public sector undertaking to terminate the services of its permanent employees by giving one month's notice without assigning any reason is arbitrary and violative of Article 14 of the Constitution.\r\n\r\nIt is now a well-established principle of law that an arbitrary power is violative of Article 14 of the Constitution. The principle of reasonableness and rationality which is legally as well as philosophically an essential element of equality or non-arbitrariness is projected by Article 14 and it must characterize every State action, whether it be under authority of law or in exercise of executive power without making of law.\r\n\r\nIn the present case, Regulation 9(b) confers an absolute and arbitrary power on the authority to terminate the services of a permanent employee without assigning any reason. It is not controlled by any guidelines and is liable to be misused. A permanent employee has a right to continue in service till the age of superannuation and his services cannot be terminated except for misconduct or on disciplinary grounds. A regulation which empowers the authority to terminate the services of a permanent employee by giving one month's notice is arbitrary and violative of Article 14 of the Constitution.\r\n\r\nWe are, therefore, of the opinion that the High Court was right in striking down Regulation 9(b). The appeal is dismissed with costs.",
"Radhey Shyam Gupta vs U.P. State Agro Industries on 20 November, 1998\r\n\r\nThe services of the appellant, who was a permanent employee of the U.P. State Agro Industries Corporation, were terminated by an order dated 25th May, 1983. The termination was made under Rule 41 of the U.P. State Agro Industries Corporation Service Rules, 1977, which provided for termination of service of a permanent employee by giving three months' notice or pay in lieu thereof.\r\n\r\nThe appellant challenged the termination order before the Allahabad High Court, which dismissed the writ petition. The appellant then filed this appeal by special leave.\r\n\r\nThe main contention of the appellant is that the termination of his service is punitive in nature and has been passed in violation of the principles of natural justice. It is submitted that the termination order, though innocuous in form, is, in reality, an order of dismissal based on certain allegations of misconduct for which no inquiry was held.\r\n\r\nFrom the record, it appears that certain allegations were made against the appellant regarding his involvement in a case of misappropriation of funds. A preliminary inquiry was conducted, but no formal departmental inquiry was held. The services of the appellant were terminated shortly after the preliminary inquiry.\r\n\r\nThe law is well-settled that if the termination of service of a permanent employee is founded on misconduct, it amounts to punishment and the employee is entitled to the protection of Article 311 of the Constitution. The form of the order is not decisive. The court has to look into the substance of the matter.\r\n\r\nIn the instant case, the termination of the appellant's service is clearly founded on the allegations of misconduct. The preliminary inquiry was held to ascertain the truth of the allegations. The termination order was passed soon after the inquiry. The entire exercise was a camouflage to dismiss the appellant from service without holding a proper inquiry.\r\n\r\nWe are, therefore, of the opinion that the termination of the appellant's service is punitive in nature and has been passed in violation of the principles of natural justice. The impugned order of termination is liable to be set aside.\r\n\r\nThe appeal is allowed. The judgment of the High Court is set aside. The writ petition filed by the appellant is allowed and the termination order dated 25th May, 1983 is quashed. The appellant shall be reinstated in service with all consequential benefits.",
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.6811, 0.6762],
# [0.6811, 1.0000, 0.5071],
# [0.6762, 0.5071, 1.0000]])
sentence_0, sentence_1, and label| sentence_0 | sentence_1 | label | |
|---|---|---|---|
| type | string | string | float |
| details |
|
|
|
| sentence_0 | sentence_1 | label |
|---|---|---|
G.M. Talang vs The Union Of India on 11 April, 1974 |
||
This is an appeal by special leave from the judgment of the High Court of Delhi dismissing a writ petition filed by the appellant challenging the termination of his service. |
||
The appellant was employed as a Senior Scientific Officer in the Ministry of Defence. His services were terminated by an order dated January 20, 1971, under Rule 5 of the Central Civil Services (Temporary Service) Rules, 1965. The rule provides that the services of a temporary Government servant shall be liable to termination at any time by a notice in writing given either by the Government servant to the appointing authority or by the appointing authority to the Government servant. |
||
The appellant contended that the termination order was punitive in nature and was passed in violation of Article 311 of the Constitution. He alleged that the termination was a camouflage for his dismissal on the ground of his alleged association with certain undesirable elemen... |
Radhey Shyam Gupta vs U.P. State Agro Industries on 20 November, 1998 |
|
The services of the appellant, who was a permanent employee of the U.P. State Agro Industries Corporation, were terminated by an order dated 25th May, 1983. The termination was made under Rule 41 of the U.P. State Agro Industries Corporation Service Rules, 1977, which provided for termination of service of a permanent employee by giving three months' notice or pay in lieu thereof. |
||
The appellant challenged the termination order before the Allahabad High Court, which dismissed the writ petition. The appellant then filed this appeal by special leave. |
||
The main contention of the appellant is that the termination of his service is punitive in nature and has been passed in violation of the principles of natural justice. It is submitted that the termination order, though innocuous in form, is, in reality, an order of dismissal based on certain allegations of misconduct for which no inquiry was held. |
||
From the reco... |
1.0 |
|
G.M. Talang vs The Union Of India on 11 April, 1974 |
||
This is an appeal by special leave from the judgment of the High Court of Delhi dismissing a writ petition filed by the appellant challenging the termination of his service. |
||
The appellant was employed as a Senior Scientific Officer in the Ministry of Defence. His services were terminated by an order dated January 20, 1971, under Rule 5 of the Central Civil Services (Temporary Service) Rules, 1965. The rule provides that the services of a temporary Government servant shall be liable to termination at any time by a notice in writing given either by the Government servant to the appointing authority or by the appointing authority to the Government servant. |
||
The appellant contended that the termination order was punitive in nature and was passed in violation of Article 311 of the Constitution. He alleged that the termination was a camouflage for his dismissal on the ground of his alleged association with certain undesirable elemen... |
Delhi Transport Corporation vs D.T.C. Mazdoor Congress on 4 September, 1990 |
|
This appeal by the Delhi Transport Corporation is directed against the judgment of a Division Bench of the Delhi High Court declaring certain regulations empowering the Corporation to terminate the services of a permanent employee by giving one month's notice as ultra vires Article 14 of the Constitution. |
||
The respondent, a permanent employee of the Corporation, was served with a notice of termination under Regulation 9(b) of the Delhi Road Transport Authority (Conditions of Appointment and Service) Regulations, 1952. The regulation provided that the service of an employee could be terminated by giving one month's notice or pay in lieu thereof without assigning any reason. |
||
The respondent challenged the validity of the regulation on the ground that it was arbitrary and conferred unguided power on the authority. The High Court accepted the contention and struck down the regulation. |
||
The question that ar... |
1.0 |
|
G.M. Talang vs The Union Of India on 11 April, 1974 |
||
This is an appeal by special leave from the judgment of the High Court of Delhi dismissing a writ petition filed by the appellant challenging the termination of his service. |
||
The appellant was employed as a Senior Scientific Officer in the Ministry of Defence. His services were terminated by an order dated January 20, 1971, under Rule 5 of the Central Civil Services (Temporary Service) Rules, 1965. The rule provides that the services of a temporary Government servant shall be liable to termination at any time by a notice in writing given either by the Government servant to the appointing authority or by the appointing authority to the Government servant. |
||
The appellant contended that the termination order was punitive in nature and was passed in violation of Article 311 of the Constitution. He alleged that the termination was a camouflage for his dismissal on the ground of his alleged association with certain undesirable elemen... |
Delhi Transport Corporation vs D.T.C. Mazdoor Congress on 4 September, 1990 |
|
This appeal by the Delhi Transport Corporation is directed against the judgment of a Division Bench of the Delhi High Court declaring certain regulations empowering the Corporation to terminate the services of a permanent employee by giving one month's notice as ultra vires Article 14 of the Constitution. |
||
The respondent, a permanent employee of the Corporation, was served with a notice of termination under Regulation 9(b) of the Delhi Road Transport Authority (Conditions of Appointment and Service) Regulations, 1952. The regulation provided that the service of an employee could be terminated by giving one month's notice or pay in lieu thereof without assigning any reason. |
||
The respondent challenged the validity of the regulation on the ground that it was arbitrary and conferred unguided power on the authority. The High Court accepted the contention and struck down the regulation. |
||
The question that ar... |
1.0 |
CosineSimilarityLoss with these parameters:{
"loss_fct": "torch.nn.modules.loss.MSELoss"
}
per_device_train_batch_size: 16per_device_eval_batch_size: 16num_train_epochs: 1multi_dataset_batch_sampler: round_robinoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: noprediction_loss_only: Trueper_device_train_batch_size: 16per_device_eval_batch_size: 16per_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: 1max_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: 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: Falseneftune_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: Falseprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: round_robinrouter_mapping: {}learning_rate_mapping: {}@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",
}
Unable to build the model tree, the base model loops to the model itself. Learn more.