Huzaifa68 commited on
Commit
9a73aa4
1 Parent(s): 3d2e64d

Add new SentenceTransformer model.

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 384,
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,352 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: Huzaifa68/investment_v1
3
+ library_name: sentence-transformers
4
+ pipeline_tag: sentence-similarity
5
+ tags:
6
+ - sentence-transformers
7
+ - sentence-similarity
8
+ - feature-extraction
9
+ - generated_from_trainer
10
+ - dataset_size:34
11
+ - loss:MultipleNegativesRankingLoss
12
+ widget:
13
+ - source_sentence: Fund Statistics
14
+ sentences:
15
+ - Investment Objective
16
+ - information
17
+ - statistics
18
+ - source_sentence: Investment Objective
19
+ sentences:
20
+ - Asset Allocation
21
+ - 1 Year - Rolling Returns
22
+ - objective
23
+ - source_sentence: Basic Information
24
+ sentences:
25
+ - Asset Allocation (as % of Total Assets)
26
+ - information
27
+ - investment committee
28
+ - source_sentence: Asset Allocation (as % of Total Assets)
29
+ sentences:
30
+ - investment objective
31
+ - Credit Quality (as % of Total Assets)
32
+ - Asset Allocation
33
+ - source_sentence: Asset Allocation (as % of Total Assets)
34
+ sentences:
35
+ - fund performance
36
+ - Asset Allocation
37
+ - 1 Year - Rolling Returns
38
+ ---
39
+
40
+ # SentenceTransformer based on Huzaifa68/investment_v1
41
+
42
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [Huzaifa68/investment_v1](https://huggingface.co/Huzaifa68/investment_v1) on the csv dataset. 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.
43
+
44
+ ## Model Details
45
+
46
+ ### Model Description
47
+ - **Model Type:** Sentence Transformer
48
+ - **Base model:** [Huzaifa68/investment_v1](https://huggingface.co/Huzaifa68/investment_v1) <!-- at revision 27d3f59a04e7b99eaaefce04446b00b7ca617c79 -->
49
+ - **Maximum Sequence Length:** 512 tokens
50
+ - **Output Dimensionality:** 384 tokens
51
+ - **Similarity Function:** Cosine Similarity
52
+ - **Training Dataset:**
53
+ - csv
54
+ <!-- - **Language:** Unknown -->
55
+ <!-- - **License:** Unknown -->
56
+
57
+ ### Model Sources
58
+
59
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
60
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
61
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
62
+
63
+ ### Full Model Architecture
64
+
65
+ ```
66
+ SentenceTransformer(
67
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': True}) with Transformer model: BertModel
68
+ (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})
69
+ (2): Normalize()
70
+ )
71
+ ```
72
+
73
+ ## Usage
74
+
75
+ ### Direct Usage (Sentence Transformers)
76
+
77
+ First install the Sentence Transformers library:
78
+
79
+ ```bash
80
+ pip install -U sentence-transformers
81
+ ```
82
+
83
+ Then you can load this model and run inference.
84
+ ```python
85
+ from sentence_transformers import SentenceTransformer
86
+
87
+ # Download from the 🤗 Hub
88
+ model = SentenceTransformer("Huzaifa68/investment_v3")
89
+ # Run inference
90
+ sentences = [
91
+ 'Asset Allocation (as % of Total Assets)',
92
+ 'Asset Allocation',
93
+ '1 Year - Rolling Returns',
94
+ ]
95
+ embeddings = model.encode(sentences)
96
+ print(embeddings.shape)
97
+ # [3, 384]
98
+
99
+ # Get the similarity scores for the embeddings
100
+ similarities = model.similarity(embeddings, embeddings)
101
+ print(similarities.shape)
102
+ # [3, 3]
103
+ ```
104
+
105
+ <!--
106
+ ### Direct Usage (Transformers)
107
+
108
+ <details><summary>Click to see the direct usage in Transformers</summary>
109
+
110
+ </details>
111
+ -->
112
+
113
+ <!--
114
+ ### Downstream Usage (Sentence Transformers)
115
+
116
+ You can finetune this model on your own dataset.
117
+
118
+ <details><summary>Click to expand</summary>
119
+
120
+ </details>
121
+ -->
122
+
123
+ <!--
124
+ ### Out-of-Scope Use
125
+
126
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
127
+ -->
128
+
129
+ <!--
130
+ ## Bias, Risks and Limitations
131
+
132
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
133
+ -->
134
+
135
+ <!--
136
+ ### Recommendations
137
+
138
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
139
+ -->
140
+
141
+ ## Training Details
142
+
143
+ ### Training Dataset
144
+
145
+ #### csv
146
+
147
+ * Dataset: csv
148
+ * Size: 34 training samples
149
+ * Columns: <code>anchor</code>, <code>postive</code>, and <code>negative</code>
150
+ * Approximate statistics based on the first 34 samples:
151
+ | | anchor | postive | negative |
152
+ |:--------|:---------------------------------------------------------------------------------|:--------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|
153
+ | type | string | string | string |
154
+ | details | <ul><li>min: 4 tokens</li><li>mean: 5.29 tokens</li><li>max: 11 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 3.68 tokens</li><li>max: 4 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 6.76 tokens</li><li>max: 11 tokens</li></ul> |
155
+ * Samples:
156
+ | anchor | postive | negative |
157
+ |:----------------------------------|:----------------------------------|:-----------------------------------------------------|
158
+ | <code>Investment Objective</code> | <code>investment objective</code> | <code>Asset Allocation (as % of Total Assets)</code> |
159
+ | <code>Investment Objective</code> | <code>investment objective</code> | <code>Fund Statistics</code> |
160
+ | <code>Investment Objective</code> | <code>investment objective</code> | <code>Fund Performance</code> |
161
+ * Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
162
+ ```json
163
+ {
164
+ "scale": 20.0,
165
+ "similarity_fct": "cos_sim"
166
+ }
167
+ ```
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`: 2
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
+ - `torch_empty_cache_steps`: None
194
+ - `learning_rate`: 5e-05
195
+ - `weight_decay`: 0.0
196
+ - `adam_beta1`: 0.9
197
+ - `adam_beta2`: 0.999
198
+ - `adam_epsilon`: 1e-08
199
+ - `max_grad_norm`: 1.0
200
+ - `num_train_epochs`: 2
201
+ - `max_steps`: -1
202
+ - `lr_scheduler_type`: linear
203
+ - `lr_scheduler_kwargs`: {}
204
+ - `warmup_ratio`: 0.1
205
+ - `warmup_steps`: 0
206
+ - `log_level`: passive
207
+ - `log_level_replica`: warning
208
+ - `log_on_each_node`: True
209
+ - `logging_nan_inf_filter`: True
210
+ - `save_safetensors`: True
211
+ - `save_on_each_node`: False
212
+ - `save_only_model`: False
213
+ - `restore_callback_states_from_checkpoint`: False
214
+ - `no_cuda`: False
215
+ - `use_cpu`: False
216
+ - `use_mps_device`: False
217
+ - `seed`: 42
218
+ - `data_seed`: None
219
+ - `jit_mode_eval`: False
220
+ - `use_ipex`: False
221
+ - `bf16`: False
222
+ - `fp16`: True
223
+ - `fp16_opt_level`: O1
224
+ - `half_precision_backend`: auto
225
+ - `bf16_full_eval`: False
226
+ - `fp16_full_eval`: False
227
+ - `tf32`: None
228
+ - `local_rank`: 0
229
+ - `ddp_backend`: None
230
+ - `tpu_num_cores`: None
231
+ - `tpu_metrics_debug`: False
232
+ - `debug`: []
233
+ - `dataloader_drop_last`: False
234
+ - `dataloader_num_workers`: 0
235
+ - `dataloader_prefetch_factor`: None
236
+ - `past_index`: -1
237
+ - `disable_tqdm`: False
238
+ - `remove_unused_columns`: True
239
+ - `label_names`: None
240
+ - `load_best_model_at_end`: False
241
+ - `ignore_data_skip`: False
242
+ - `fsdp`: []
243
+ - `fsdp_min_num_params`: 0
244
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
245
+ - `fsdp_transformer_layer_cls_to_wrap`: None
246
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
247
+ - `deepspeed`: None
248
+ - `label_smoothing_factor`: 0.0
249
+ - `optim`: adamw_torch
250
+ - `optim_args`: None
251
+ - `adafactor`: False
252
+ - `group_by_length`: False
253
+ - `length_column_name`: length
254
+ - `ddp_find_unused_parameters`: None
255
+ - `ddp_bucket_cap_mb`: None
256
+ - `ddp_broadcast_buffers`: False
257
+ - `dataloader_pin_memory`: True
258
+ - `dataloader_persistent_workers`: False
259
+ - `skip_memory_metrics`: True
260
+ - `use_legacy_prediction_loop`: False
261
+ - `push_to_hub`: False
262
+ - `resume_from_checkpoint`: None
263
+ - `hub_model_id`: None
264
+ - `hub_strategy`: every_save
265
+ - `hub_private_repo`: False
266
+ - `hub_always_push`: False
267
+ - `gradient_checkpointing`: False
268
+ - `gradient_checkpointing_kwargs`: None
269
+ - `include_inputs_for_metrics`: False
270
+ - `eval_do_concat_batches`: True
271
+ - `fp16_backend`: auto
272
+ - `push_to_hub_model_id`: None
273
+ - `push_to_hub_organization`: None
274
+ - `mp_parameters`:
275
+ - `auto_find_batch_size`: False
276
+ - `full_determinism`: False
277
+ - `torchdynamo`: None
278
+ - `ray_scope`: last
279
+ - `ddp_timeout`: 1800
280
+ - `torch_compile`: False
281
+ - `torch_compile_backend`: None
282
+ - `torch_compile_mode`: None
283
+ - `dispatch_batches`: None
284
+ - `split_batches`: None
285
+ - `include_tokens_per_second`: False
286
+ - `include_num_input_tokens_seen`: False
287
+ - `neftune_noise_alpha`: None
288
+ - `optim_target_modules`: None
289
+ - `batch_eval_metrics`: False
290
+ - `eval_on_start`: False
291
+ - `use_liger_kernel`: False
292
+ - `eval_use_gather_object`: False
293
+ - `batch_sampler`: no_duplicates
294
+ - `multi_dataset_batch_sampler`: proportional
295
+
296
+ </details>
297
+
298
+ ### Framework Versions
299
+ - Python: 3.10.12
300
+ - Sentence Transformers: 3.1.1
301
+ - Transformers: 4.45.0
302
+ - PyTorch: 2.4.1+cu121
303
+ - Accelerate: 0.34.2
304
+ - Datasets: 3.0.1
305
+ - Tokenizers: 0.20.0
306
+
307
+ ## Citation
308
+
309
+ ### BibTeX
310
+
311
+ #### Sentence Transformers
312
+ ```bibtex
313
+ @inproceedings{reimers-2019-sentence-bert,
314
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
315
+ author = "Reimers, Nils and Gurevych, Iryna",
316
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
317
+ month = "11",
318
+ year = "2019",
319
+ publisher = "Association for Computational Linguistics",
320
+ url = "https://arxiv.org/abs/1908.10084",
321
+ }
322
+ ```
323
+
324
+ #### MultipleNegativesRankingLoss
325
+ ```bibtex
326
+ @misc{henderson2017efficient,
327
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
328
+ 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},
329
+ year={2017},
330
+ eprint={1705.00652},
331
+ archivePrefix={arXiv},
332
+ primaryClass={cs.CL}
333
+ }
334
+ ```
335
+
336
+ <!--
337
+ ## Glossary
338
+
339
+ *Clearly define terms in order to be accessible across audiences.*
340
+ -->
341
+
342
+ <!--
343
+ ## Model Card Authors
344
+
345
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
346
+ -->
347
+
348
+ <!--
349
+ ## Model Card Contact
350
+
351
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
352
+ -->
config.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "Huzaifa68/investment_v1",
3
+ "architectures": [
4
+ "BertModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 384,
11
+ "id2label": {
12
+ "0": "LABEL_0"
13
+ },
14
+ "initializer_range": 0.02,
15
+ "intermediate_size": 1536,
16
+ "label2id": {
17
+ "LABEL_0": 0
18
+ },
19
+ "layer_norm_eps": 1e-12,
20
+ "max_position_embeddings": 512,
21
+ "model_type": "bert",
22
+ "num_attention_heads": 12,
23
+ "num_hidden_layers": 12,
24
+ "pad_token_id": 0,
25
+ "position_embedding_type": "absolute",
26
+ "torch_dtype": "float32",
27
+ "transformers_version": "4.45.0",
28
+ "type_vocab_size": 2,
29
+ "use_cache": true,
30
+ "vocab_size": 30522
31
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "3.1.1",
4
+ "transformers": "4.45.0",
5
+ "pytorch": "2.4.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:a8a919cd27f5bc800c2d0ab5beeb63991f0de901b0344e84d9616c2f7c2c2807
3
+ size 133462128
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,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "max_length": 512,
50
+ "model_max_length": 512,
51
+ "never_split": null,
52
+ "pad_to_multiple_of": null,
53
+ "pad_token": "[PAD]",
54
+ "pad_token_type_id": 0,
55
+ "padding_side": "right",
56
+ "sep_token": "[SEP]",
57
+ "stride": 0,
58
+ "strip_accents": null,
59
+ "tokenize_chinese_chars": true,
60
+ "tokenizer_class": "BertTokenizer",
61
+ "truncation_side": "right",
62
+ "truncation_strategy": "longest_first",
63
+ "unk_token": "[UNK]"
64
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff