Ananthu357 commited on
Commit
2891bbf
1 Parent(s): 98e5e01

Add new SentenceTransformer model.

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 1024,
3
+ "pooling_mode_cls_token": true,
4
+ "pooling_mode_mean_tokens": false,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,347 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: BAAI/bge-large-en
3
+ datasets: []
4
+ language: []
5
+ library_name: sentence-transformers
6
+ pipeline_tag: sentence-similarity
7
+ tags:
8
+ - sentence-transformers
9
+ - sentence-similarity
10
+ - feature-extraction
11
+ - generated_from_trainer
12
+ - dataset_size:616
13
+ - loss:CosineSimilarityLoss
14
+ widget:
15
+ - source_sentence: Fulfilment of contractual obligations
16
+ sentences:
17
+ - Should a tenderer find discrepancies in or omissions from the drawings or any
18
+ of the Tender Forms or should he be in doubt as to their meaning
19
+ - Period of Maintenance shall mean the specified period of maintenance from the
20
+ date of completion of the works, as certified by the Engineer.
21
+ - A copy of certificate stating that they are not liable to be disqualified and
22
+ all their statements/documents
23
+ - source_sentence: Is time is of essence in the contract?
24
+ sentences:
25
+ - In exceptional cases where accommodation is provided to the Contractor at the
26
+ Railway's discretion, recoveries shall be made at such rates
27
+ - and the works must be completed not later than the dates
28
+ - The successful bidder shall submit the Performance Guarantee (PG) in any of the
29
+ following forms, amounting to 5% of the contract value
30
+ - source_sentence: Is there a way to claim consequential losses?
31
+ sentences:
32
+ - "provision has been made in Clauses 7(j), 8, 18, 22(5), 39, 43(2), 45(i)(a), 55,\
33
+ \ 55-A(5), 57, 57A,61(1), 61(2) and 62(1) of Standard General Conditions of Contract\
34
+ \ or in any Clause (stated as excepted matter) of the Special Conditions of the\
35
+ \ Contract, shall be deemed as \x91excepted matters\x92 (matters not arbitrable)\
36
+ \ and decisions of the Railway authority"
37
+ - All sums payable by way of compensation under any of these conditions shall be
38
+ considered as reasonable compensation
39
+ - Third party liability relationship is present in this contract.
40
+ - source_sentence: Valuables found during works
41
+ sentences:
42
+ - The contractor will indemnify, defend, save and hold harmless the Authority and
43
+ its officers, servants, agents, Government INstrumentalities and Government owned
44
+ and/or controlled entities/enterprises, against any and all suits, proceedings,
45
+ actions, demands and third party claims for any loss, damage, cost and expense
46
+ of whatever kind and nature, whether arising out of any breach by the contractor
47
+ of any its obligations inder this agrreement, including any errors or deficiencies
48
+ in the design documents, or tort or on any other ground whatsoever, except to
49
+ the extent that any such suits, proceedings, actions, demands and claims have
50
+ arisen due to any negligent act or omission, or breach or default of this agreement
51
+ on the part of the authority Indemnified persons.
52
+ - his position as an independent contractor specifying engineering organization
53
+ available with details of partners / staff / engineers employed with qualifications
54
+ and experience
55
+ - All gold, silver, oil, other minerals of any description, all precious stones,
56
+ coins, treasures relics antiquities and other similar things which shall be found
57
+ in or upon the site shall be the property of the Railway
58
+ - source_sentence: Project schedules like Bar chart, CPM, PERT
59
+ sentences:
60
+ -  All temporary works necessary for the proper execution of the works shall be
61
+ provided and maintained by the Contractor
62
+ - Can the excavated material be directly used in construction.
63
+ - Nothing stated herein shall preclude the Contractor in achieving earlier completion
64
+ of item or whole of the works than indicated in the programme.
65
+ ---
66
+
67
+ # SentenceTransformer based on BAAI/bge-large-en
68
+
69
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [BAAI/bge-large-en](https://huggingface.co/BAAI/bge-large-en). It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
70
+
71
+ ## Model Details
72
+
73
+ ### Model Description
74
+ - **Model Type:** Sentence Transformer
75
+ - **Base model:** [BAAI/bge-large-en](https://huggingface.co/BAAI/bge-large-en) <!-- at revision abe7d9d814b775ca171121fb03f394dc42974275 -->
76
+ - **Maximum Sequence Length:** 512 tokens
77
+ - **Output Dimensionality:** 1024 tokens
78
+ - **Similarity Function:** Cosine Similarity
79
+ <!-- - **Training Dataset:** Unknown -->
80
+ <!-- - **Language:** Unknown -->
81
+ <!-- - **License:** Unknown -->
82
+
83
+ ### Model Sources
84
+
85
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
86
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
87
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
88
+
89
+ ### Full Model Architecture
90
+
91
+ ```
92
+ SentenceTransformer(
93
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': True}) with Transformer model: BertModel
94
+ (1): Pooling({'word_embedding_dimension': 1024, '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})
95
+ (2): Normalize()
96
+ )
97
+ ```
98
+
99
+ ## Usage
100
+
101
+ ### Direct Usage (Sentence Transformers)
102
+
103
+ First install the Sentence Transformers library:
104
+
105
+ ```bash
106
+ pip install -U sentence-transformers
107
+ ```
108
+
109
+ Then you can load this model and run inference.
110
+ ```python
111
+ from sentence_transformers import SentenceTransformer
112
+
113
+ # Download from the 🤗 Hub
114
+ model = SentenceTransformer("Ananthu357/Ananthus-BAAI-for-contracts8.0")
115
+ # Run inference
116
+ sentences = [
117
+ 'Project schedules like Bar chart, CPM, PERT',
118
+ '\xa0All temporary works necessary for the proper execution of the works shall be provided and maintained by the Contractor',
119
+ 'Nothing stated herein shall preclude the Contractor in achieving earlier completion of item or whole of the works than indicated in the programme.',
120
+ ]
121
+ embeddings = model.encode(sentences)
122
+ print(embeddings.shape)
123
+ # [3, 1024]
124
+
125
+ # Get the similarity scores for the embeddings
126
+ similarities = model.similarity(embeddings, embeddings)
127
+ print(similarities.shape)
128
+ # [3, 3]
129
+ ```
130
+
131
+ <!--
132
+ ### Direct Usage (Transformers)
133
+
134
+ <details><summary>Click to see the direct usage in Transformers</summary>
135
+
136
+ </details>
137
+ -->
138
+
139
+ <!--
140
+ ### Downstream Usage (Sentence Transformers)
141
+
142
+ You can finetune this model on your own dataset.
143
+
144
+ <details><summary>Click to expand</summary>
145
+
146
+ </details>
147
+ -->
148
+
149
+ <!--
150
+ ### Out-of-Scope Use
151
+
152
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
153
+ -->
154
+
155
+ <!--
156
+ ## Bias, Risks and Limitations
157
+
158
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
159
+ -->
160
+
161
+ <!--
162
+ ### Recommendations
163
+
164
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
165
+ -->
166
+
167
+ ## Training Details
168
+
169
+ ### Training Hyperparameters
170
+ #### Non-Default Hyperparameters
171
+
172
+ - `eval_strategy`: steps
173
+ - `per_device_train_batch_size`: 16
174
+ - `per_device_eval_batch_size`: 16
175
+ - `num_train_epochs`: 15
176
+ - `warmup_ratio`: 0.1
177
+ - `fp16`: True
178
+ - `batch_sampler`: no_duplicates
179
+
180
+ #### All Hyperparameters
181
+ <details><summary>Click to expand</summary>
182
+
183
+ - `overwrite_output_dir`: False
184
+ - `do_predict`: False
185
+ - `eval_strategy`: steps
186
+ - `prediction_loss_only`: True
187
+ - `per_device_train_batch_size`: 16
188
+ - `per_device_eval_batch_size`: 16
189
+ - `per_gpu_train_batch_size`: None
190
+ - `per_gpu_eval_batch_size`: None
191
+ - `gradient_accumulation_steps`: 1
192
+ - `eval_accumulation_steps`: None
193
+ - `learning_rate`: 5e-05
194
+ - `weight_decay`: 0.0
195
+ - `adam_beta1`: 0.9
196
+ - `adam_beta2`: 0.999
197
+ - `adam_epsilon`: 1e-08
198
+ - `max_grad_norm`: 1.0
199
+ - `num_train_epochs`: 15
200
+ - `max_steps`: -1
201
+ - `lr_scheduler_type`: linear
202
+ - `lr_scheduler_kwargs`: {}
203
+ - `warmup_ratio`: 0.1
204
+ - `warmup_steps`: 0
205
+ - `log_level`: passive
206
+ - `log_level_replica`: warning
207
+ - `log_on_each_node`: True
208
+ - `logging_nan_inf_filter`: True
209
+ - `save_safetensors`: True
210
+ - `save_on_each_node`: False
211
+ - `save_only_model`: False
212
+ - `restore_callback_states_from_checkpoint`: False
213
+ - `no_cuda`: False
214
+ - `use_cpu`: False
215
+ - `use_mps_device`: False
216
+ - `seed`: 42
217
+ - `data_seed`: None
218
+ - `jit_mode_eval`: False
219
+ - `use_ipex`: False
220
+ - `bf16`: False
221
+ - `fp16`: True
222
+ - `fp16_opt_level`: O1
223
+ - `half_precision_backend`: auto
224
+ - `bf16_full_eval`: False
225
+ - `fp16_full_eval`: False
226
+ - `tf32`: None
227
+ - `local_rank`: 0
228
+ - `ddp_backend`: None
229
+ - `tpu_num_cores`: None
230
+ - `tpu_metrics_debug`: False
231
+ - `debug`: []
232
+ - `dataloader_drop_last`: False
233
+ - `dataloader_num_workers`: 0
234
+ - `dataloader_prefetch_factor`: None
235
+ - `past_index`: -1
236
+ - `disable_tqdm`: False
237
+ - `remove_unused_columns`: True
238
+ - `label_names`: None
239
+ - `load_best_model_at_end`: False
240
+ - `ignore_data_skip`: False
241
+ - `fsdp`: []
242
+ - `fsdp_min_num_params`: 0
243
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
244
+ - `fsdp_transformer_layer_cls_to_wrap`: None
245
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
246
+ - `deepspeed`: None
247
+ - `label_smoothing_factor`: 0.0
248
+ - `optim`: adamw_torch
249
+ - `optim_args`: None
250
+ - `adafactor`: False
251
+ - `group_by_length`: False
252
+ - `length_column_name`: length
253
+ - `ddp_find_unused_parameters`: None
254
+ - `ddp_bucket_cap_mb`: None
255
+ - `ddp_broadcast_buffers`: False
256
+ - `dataloader_pin_memory`: True
257
+ - `dataloader_persistent_workers`: False
258
+ - `skip_memory_metrics`: True
259
+ - `use_legacy_prediction_loop`: False
260
+ - `push_to_hub`: False
261
+ - `resume_from_checkpoint`: None
262
+ - `hub_model_id`: None
263
+ - `hub_strategy`: every_save
264
+ - `hub_private_repo`: False
265
+ - `hub_always_push`: False
266
+ - `gradient_checkpointing`: False
267
+ - `gradient_checkpointing_kwargs`: None
268
+ - `include_inputs_for_metrics`: False
269
+ - `eval_do_concat_batches`: True
270
+ - `fp16_backend`: auto
271
+ - `push_to_hub_model_id`: None
272
+ - `push_to_hub_organization`: None
273
+ - `mp_parameters`:
274
+ - `auto_find_batch_size`: False
275
+ - `full_determinism`: False
276
+ - `torchdynamo`: None
277
+ - `ray_scope`: last
278
+ - `ddp_timeout`: 1800
279
+ - `torch_compile`: False
280
+ - `torch_compile_backend`: None
281
+ - `torch_compile_mode`: None
282
+ - `dispatch_batches`: None
283
+ - `split_batches`: None
284
+ - `include_tokens_per_second`: False
285
+ - `include_num_input_tokens_seen`: False
286
+ - `neftune_noise_alpha`: None
287
+ - `optim_target_modules`: None
288
+ - `batch_eval_metrics`: False
289
+ - `eval_on_start`: False
290
+ - `batch_sampler`: no_duplicates
291
+ - `multi_dataset_batch_sampler`: proportional
292
+
293
+ </details>
294
+
295
+ ### Training Logs
296
+ | Epoch | Step | Training Loss | loss |
297
+ |:-------:|:----:|:-------------:|:------:|
298
+ | 2.4615 | 100 | 0.0629 | 0.0440 |
299
+ | 4.9231 | 200 | 0.012 | 0.0504 |
300
+ | 7.3333 | 300 | 0.0052 | 0.0462 |
301
+ | 9.7949 | 400 | 0.0031 | 0.0489 |
302
+ | 12.2051 | 500 | 0.0016 | 0.0479 |
303
+
304
+
305
+ ### Framework Versions
306
+ - Python: 3.10.12
307
+ - Sentence Transformers: 3.0.1
308
+ - Transformers: 4.42.4
309
+ - PyTorch: 2.3.1+cu121
310
+ - Accelerate: 0.32.1
311
+ - Datasets: 2.21.0
312
+ - Tokenizers: 0.19.1
313
+
314
+ ## Citation
315
+
316
+ ### BibTeX
317
+
318
+ #### Sentence Transformers
319
+ ```bibtex
320
+ @inproceedings{reimers-2019-sentence-bert,
321
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
322
+ author = "Reimers, Nils and Gurevych, Iryna",
323
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
324
+ month = "11",
325
+ year = "2019",
326
+ publisher = "Association for Computational Linguistics",
327
+ url = "https://arxiv.org/abs/1908.10084",
328
+ }
329
+ ```
330
+
331
+ <!--
332
+ ## Glossary
333
+
334
+ *Clearly define terms in order to be accessible across audiences.*
335
+ -->
336
+
337
+ <!--
338
+ ## Model Card Authors
339
+
340
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
341
+ -->
342
+
343
+ <!--
344
+ ## Model Card Contact
345
+
346
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
347
+ -->
config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "BAAI/bge-large-en",
3
+ "architectures": [
4
+ "BertModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 1024,
12
+ "id2label": {
13
+ "0": "LABEL_0"
14
+ },
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 4096,
17
+ "label2id": {
18
+ "LABEL_0": 0
19
+ },
20
+ "layer_norm_eps": 1e-12,
21
+ "max_position_embeddings": 512,
22
+ "model_type": "bert",
23
+ "num_attention_heads": 16,
24
+ "num_hidden_layers": 24,
25
+ "pad_token_id": 0,
26
+ "position_embedding_type": "absolute",
27
+ "torch_dtype": "float32",
28
+ "transformers_version": "4.42.4",
29
+ "type_vocab_size": 2,
30
+ "use_cache": true,
31
+ "vocab_size": 30522
32
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "3.0.1",
4
+ "transformers": "4.42.4",
5
+ "pytorch": "2.3.1+cu121"
6
+ },
7
+ "prompts": {},
8
+ "default_prompt_name": null,
9
+ "similarity_fn_name": null
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:932d298b8545b40b81ea6b39fd240c381c0a458b50a07632afcc737ee2776091
3
+ size 1340612432
modules.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_Pooling",
12
+ "type": "sentence_transformers.models.Pooling"
13
+ },
14
+ {
15
+ "idx": 2,
16
+ "name": "2",
17
+ "path": "2_Normalize",
18
+ "type": "sentence_transformers.models.Normalize"
19
+ }
20
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 512,
3
+ "do_lower_case": true
4
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": true,
45
+ "cls_token": "[CLS]",
46
+ "do_basic_tokenize": true,
47
+ "do_lower_case": true,
48
+ "mask_token": "[MASK]",
49
+ "model_max_length": 512,
50
+ "never_split": null,
51
+ "pad_token": "[PAD]",
52
+ "sep_token": "[SEP]",
53
+ "strip_accents": null,
54
+ "tokenize_chinese_chars": true,
55
+ "tokenizer_class": "BertTokenizer",
56
+ "unk_token": "[UNK]"
57
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff