zihoo commited on
Commit
2a106f6
1 Parent(s): 4b4ad64

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": false,
4
+ "pooling_mode_mean_tokens": true,
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,323 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: sentence-transformers/all-MiniLM-L6-v2
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:200
13
+ - loss:SoftmaxLoss
14
+ widget:
15
+ - source_sentence: ' I am anxious about relying on AI for critical decisions,'
16
+ sentences:
17
+ - ' I worry about the ethical implications of using AI,'
18
+ - ' AIs data cleaning quality is impressive,'
19
+ - ' The rise of AI creates uncertainty in job markets,'
20
+ - source_sentence: ' Im apprehensive about having AI manage sensitive tasks for me,'
21
+ sentences:
22
+ - ' AIs quality in image recognition is superb,'
23
+ - ' AI might replace jobs in data entry and processing,'
24
+ - ' AI tools improve my efficiency in complex computations,'
25
+ - source_sentence: ' I am hesitant to rely on AI for financial advice,'
26
+ sentences:
27
+ - ' AI aids in streamlining industry-specific tasks,'
28
+ - ' AI can imitate human decision-making processes,'
29
+ - ' The high quality of AI in voice synthesis is staggering,'
30
+ - source_sentence: ' AI systems modify their processes based on feedback,'
31
+ sentences:
32
+ - ' AI can hold a relevant and coherent conversation,'
33
+ - ' Relying on AI for critical thinking tasks makes me nervous,'
34
+ - ' AI ensures high quality in predictive analytics,'
35
+ - source_sentence: ' AI simplifies complex data analysis tasks for me,'
36
+ sentences:
37
+ - ' AI optimizes content strategy through data analysis,'
38
+ - ' Im apprehensive about having AI manage sensitive tasks for me,'
39
+ - ' AI adapts to varying user inputs accurately,'
40
+ ---
41
+
42
+ # SentenceTransformer based on sentence-transformers/all-MiniLM-L6-v2
43
+
44
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/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.
45
+
46
+ ## Model Details
47
+
48
+ ### Model Description
49
+ - **Model Type:** Sentence Transformer
50
+ - **Base model:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) <!-- at revision 8b3219a92973c328a8e22fadcfa821b5dc75636a -->
51
+ - **Maximum Sequence Length:** 256 tokens
52
+ - **Output Dimensionality:** 384 tokens
53
+ - **Similarity Function:** Cosine Similarity
54
+ <!-- - **Training Dataset:** Unknown -->
55
+ <!-- - **Language:** Unknown -->
56
+ <!-- - **License:** Unknown -->
57
+
58
+ ### Model Sources
59
+
60
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
61
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
62
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
63
+
64
+ ### Full Model Architecture
65
+
66
+ ```
67
+ SentenceTransformer(
68
+ (0): Transformer({'max_seq_length': 256, 'do_lower_case': False}) with Transformer model: BertModel
69
+ (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})
70
+ (2): Normalize()
71
+ )
72
+ ```
73
+
74
+ ## Usage
75
+
76
+ ### Direct Usage (Sentence Transformers)
77
+
78
+ First install the Sentence Transformers library:
79
+
80
+ ```bash
81
+ pip install -U sentence-transformers
82
+ ```
83
+
84
+ Then you can load this model and run inference.
85
+ ```python
86
+ from sentence_transformers import SentenceTransformer
87
+
88
+ # Download from the 🤗 Hub
89
+ model = SentenceTransformer("zihoo/all-MiniLM-L6-v2-AINLI")
90
+ # Run inference
91
+ sentences = [
92
+ ' AI simplifies complex data analysis tasks for me,',
93
+ ' AI optimizes content strategy through data analysis,',
94
+ ' AI adapts to varying user inputs accurately,',
95
+ ]
96
+ embeddings = model.encode(sentences)
97
+ print(embeddings.shape)
98
+ # [3, 384]
99
+
100
+ # Get the similarity scores for the embeddings
101
+ similarities = model.similarity(embeddings, embeddings)
102
+ print(similarities.shape)
103
+ # [3, 3]
104
+ ```
105
+
106
+ <!--
107
+ ### Direct Usage (Transformers)
108
+
109
+ <details><summary>Click to see the direct usage in Transformers</summary>
110
+
111
+ </details>
112
+ -->
113
+
114
+ <!--
115
+ ### Downstream Usage (Sentence Transformers)
116
+
117
+ You can finetune this model on your own dataset.
118
+
119
+ <details><summary>Click to expand</summary>
120
+
121
+ </details>
122
+ -->
123
+
124
+ <!--
125
+ ### Out-of-Scope Use
126
+
127
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
128
+ -->
129
+
130
+ <!--
131
+ ## Bias, Risks and Limitations
132
+
133
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
134
+ -->
135
+
136
+ <!--
137
+ ### Recommendations
138
+
139
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
140
+ -->
141
+
142
+ ## Training Details
143
+
144
+ ### Training Dataset
145
+
146
+ #### Unnamed Dataset
147
+
148
+
149
+ * Size: 200 training samples
150
+ * Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>label</code>
151
+ * Approximate statistics based on the first 1000 samples:
152
+ | | sentence1 | sentence2 | label |
153
+ |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:------------------------------------------------------------------|
154
+ | type | string | string | int |
155
+ | details | <ul><li>min: 8 tokens</li><li>mean: 11.91 tokens</li><li>max: 16 tokens</li></ul> | <ul><li>min: 8 tokens</li><li>mean: 11.91 tokens</li><li>max: 16 tokens</li></ul> | <ul><li>0: ~9.00%</li><li>1: ~69.00%</li><li>2: ~22.00%</li></ul> |
156
+ * Samples:
157
+ | sentence1 | sentence2 | label |
158
+ |:------------------------------------------------------------------|:------------------------------------------------------------------|:---------------|
159
+ | <code> AI can simulate human emotions in interactions,</code> | <code> AI-generated voices sound remarkably human,</code> | <code>1</code> |
160
+ | <code> AI can adjust to user preferences over time,</code> | <code> AIs precision in data analysis is highly reliable,</code> | <code>1</code> |
161
+ | <code> AI consistently provides reliable recommendations,</code> | <code> AI tools support me in delivering better results,</code> | <code>0</code> |
162
+ * Loss: [<code>SoftmaxLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#softmaxloss)
163
+
164
+ ### Training Hyperparameters
165
+
166
+ #### All Hyperparameters
167
+ <details><summary>Click to expand</summary>
168
+
169
+ - `overwrite_output_dir`: False
170
+ - `do_predict`: False
171
+ - `eval_strategy`: no
172
+ - `prediction_loss_only`: True
173
+ - `per_device_train_batch_size`: 8
174
+ - `per_device_eval_batch_size`: 8
175
+ - `per_gpu_train_batch_size`: None
176
+ - `per_gpu_eval_batch_size`: None
177
+ - `gradient_accumulation_steps`: 1
178
+ - `eval_accumulation_steps`: None
179
+ - `learning_rate`: 5e-05
180
+ - `weight_decay`: 0.0
181
+ - `adam_beta1`: 0.9
182
+ - `adam_beta2`: 0.999
183
+ - `adam_epsilon`: 1e-08
184
+ - `max_grad_norm`: 1.0
185
+ - `num_train_epochs`: 3.0
186
+ - `max_steps`: -1
187
+ - `lr_scheduler_type`: linear
188
+ - `lr_scheduler_kwargs`: {}
189
+ - `warmup_ratio`: 0.0
190
+ - `warmup_steps`: 0
191
+ - `log_level`: passive
192
+ - `log_level_replica`: warning
193
+ - `log_on_each_node`: True
194
+ - `logging_nan_inf_filter`: True
195
+ - `save_safetensors`: True
196
+ - `save_on_each_node`: False
197
+ - `save_only_model`: False
198
+ - `restore_callback_states_from_checkpoint`: False
199
+ - `no_cuda`: False
200
+ - `use_cpu`: False
201
+ - `use_mps_device`: False
202
+ - `seed`: 42
203
+ - `data_seed`: None
204
+ - `jit_mode_eval`: False
205
+ - `use_ipex`: False
206
+ - `bf16`: False
207
+ - `fp16`: False
208
+ - `fp16_opt_level`: O1
209
+ - `half_precision_backend`: auto
210
+ - `bf16_full_eval`: False
211
+ - `fp16_full_eval`: False
212
+ - `tf32`: None
213
+ - `local_rank`: 0
214
+ - `ddp_backend`: None
215
+ - `tpu_num_cores`: None
216
+ - `tpu_metrics_debug`: False
217
+ - `debug`: []
218
+ - `dataloader_drop_last`: False
219
+ - `dataloader_num_workers`: 0
220
+ - `dataloader_prefetch_factor`: None
221
+ - `past_index`: -1
222
+ - `disable_tqdm`: False
223
+ - `remove_unused_columns`: True
224
+ - `label_names`: None
225
+ - `load_best_model_at_end`: False
226
+ - `ignore_data_skip`: False
227
+ - `fsdp`: []
228
+ - `fsdp_min_num_params`: 0
229
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
230
+ - `fsdp_transformer_layer_cls_to_wrap`: None
231
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
232
+ - `deepspeed`: None
233
+ - `label_smoothing_factor`: 0.0
234
+ - `optim`: adamw_torch
235
+ - `optim_args`: None
236
+ - `adafactor`: False
237
+ - `group_by_length`: False
238
+ - `length_column_name`: length
239
+ - `ddp_find_unused_parameters`: None
240
+ - `ddp_bucket_cap_mb`: None
241
+ - `ddp_broadcast_buffers`: False
242
+ - `dataloader_pin_memory`: True
243
+ - `dataloader_persistent_workers`: False
244
+ - `skip_memory_metrics`: True
245
+ - `use_legacy_prediction_loop`: False
246
+ - `push_to_hub`: False
247
+ - `resume_from_checkpoint`: None
248
+ - `hub_model_id`: None
249
+ - `hub_strategy`: every_save
250
+ - `hub_private_repo`: False
251
+ - `hub_always_push`: False
252
+ - `gradient_checkpointing`: False
253
+ - `gradient_checkpointing_kwargs`: None
254
+ - `include_inputs_for_metrics`: False
255
+ - `eval_do_concat_batches`: True
256
+ - `fp16_backend`: auto
257
+ - `push_to_hub_model_id`: None
258
+ - `push_to_hub_organization`: None
259
+ - `mp_parameters`:
260
+ - `auto_find_batch_size`: False
261
+ - `full_determinism`: False
262
+ - `torchdynamo`: None
263
+ - `ray_scope`: last
264
+ - `ddp_timeout`: 1800
265
+ - `torch_compile`: False
266
+ - `torch_compile_backend`: None
267
+ - `torch_compile_mode`: None
268
+ - `dispatch_batches`: None
269
+ - `split_batches`: None
270
+ - `include_tokens_per_second`: False
271
+ - `include_num_input_tokens_seen`: False
272
+ - `neftune_noise_alpha`: None
273
+ - `optim_target_modules`: None
274
+ - `batch_eval_metrics`: False
275
+ - `eval_on_start`: False
276
+ - `batch_sampler`: batch_sampler
277
+ - `multi_dataset_batch_sampler`: proportional
278
+
279
+ </details>
280
+
281
+ ### Framework Versions
282
+ - Python: 3.10.12
283
+ - Sentence Transformers: 3.0.1
284
+ - Transformers: 4.42.4
285
+ - PyTorch: 2.4.0+cu121
286
+ - Accelerate: 0.32.1
287
+ - Datasets: 2.21.0
288
+ - Tokenizers: 0.19.1
289
+
290
+ ## Citation
291
+
292
+ ### BibTeX
293
+
294
+ #### Sentence Transformers and SoftmaxLoss
295
+ ```bibtex
296
+ @inproceedings{reimers-2019-sentence-bert,
297
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
298
+ author = "Reimers, Nils and Gurevych, Iryna",
299
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
300
+ month = "11",
301
+ year = "2019",
302
+ publisher = "Association for Computational Linguistics",
303
+ url = "https://arxiv.org/abs/1908.10084",
304
+ }
305
+ ```
306
+
307
+ <!--
308
+ ## Glossary
309
+
310
+ *Clearly define terms in order to be accessible across audiences.*
311
+ -->
312
+
313
+ <!--
314
+ ## Model Card Authors
315
+
316
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
317
+ -->
318
+
319
+ <!--
320
+ ## Model Card Contact
321
+
322
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
323
+ -->
config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "sentence-transformers/all-MiniLM-L6-v2",
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": 384,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 1536,
14
+ "layer_norm_eps": 1e-12,
15
+ "max_position_embeddings": 512,
16
+ "model_type": "bert",
17
+ "num_attention_heads": 12,
18
+ "num_hidden_layers": 6,
19
+ "pad_token_id": 0,
20
+ "position_embedding_type": "absolute",
21
+ "torch_dtype": "float32",
22
+ "transformers_version": "4.42.4",
23
+ "type_vocab_size": 2,
24
+ "use_cache": true,
25
+ "vocab_size": 30522
26
+ }
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.4.0+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:8242933065fcf9ac1f32afd943cf9fb365b4897b90ee955e9eda0780a55ba69a
3
+ size 90864192
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": 256,
3
+ "do_lower_case": false
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": 128,
50
+ "model_max_length": 256,
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