Narekatsy commited on
Commit
38f82e5
·
verified ·
1 Parent(s): 7d9de92

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,418 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - sentence-transformers
4
+ - sentence-similarity
5
+ - feature-extraction
6
+ - dense
7
+ - generated_from_trainer
8
+ - dataset_size:9984
9
+ - loss:MultipleNegativesRankingLoss
10
+ base_model: sentence-transformers/all-MiniLM-L6-v2
11
+ widget:
12
+ - source_sentence: python to dict if only one item
13
+ sentences:
14
+ - "def get_from_gnucash26_date(date_str: str) -> date:\n \"\"\" Creates a datetime\
15
+ \ from GnuCash 2.6 date string \"\"\"\n date_format = \"%Y%m%d\"\n result\
16
+ \ = datetime.strptime(date_str, date_format).date()\n return result"
17
+ - "def multidict_to_dict(d):\n \"\"\"\n Turns a werkzeug.MultiDict or django.MultiValueDict\
18
+ \ into a dict with\n list values\n :param d: a MultiDict or MultiValueDict\
19
+ \ instance\n :return: a dict instance\n \"\"\"\n return dict((k, v[0]\
20
+ \ if len(v) == 1 else v) for k, v in iterlists(d))"
21
+ - "def wipe_table(self, table: str) -> int:\n \"\"\"Delete all records from\
22
+ \ a table. Use caution!\"\"\"\n sql = \"DELETE FROM \" + self.delimit(table)\n\
23
+ \ return self.db_exec(sql)"
24
+ - source_sentence: how to add a string to a filename in python
25
+ sentences:
26
+ - "def html_to_text(content):\n \"\"\" Converts html content to plain text \"\
27
+ \"\"\n text = None\n h2t = html2text.HTML2Text()\n h2t.ignore_links =\
28
+ \ False\n text = h2t.handle(content)\n return text"
29
+ - "def _get_column_by_db_name(cls, name):\n \"\"\"\n Returns the column,\
30
+ \ mapped by db_field name\n \"\"\"\n return cls._columns.get(cls._db_map.get(name,\
31
+ \ name))"
32
+ - "def add_suffix(fullname, suffix):\n \"\"\" Add suffix to a full file name\"\
33
+ \"\"\n name, ext = os.path.splitext(fullname)\n return name + '_' + suffix\
34
+ \ + ext"
35
+ - source_sentence: human readable string of object python
36
+ sentences:
37
+ - "def pretty(obj, verbose=False, max_width=79, newline='\\n'):\n \"\"\"\n \
38
+ \ Pretty print the object's representation.\n \"\"\"\n stream = StringIO()\n\
39
+ \ printer = RepresentationPrinter(stream, verbose, max_width, newline)\n \
40
+ \ printer.pretty(obj)\n printer.flush()\n return stream.getvalue()"
41
+ - "def asMaskedArray(self):\n \"\"\" Creates converts to a masked array\n\
42
+ \ \"\"\"\n return ma.masked_array(data=self.data, mask=self.mask,\
43
+ \ fill_value=self.fill_value)"
44
+ - "def list_depth(list_, func=max, _depth=0):\n \"\"\"\n Returns the deepest\
45
+ \ level of nesting within a list of lists\n\n Args:\n list_ : a nested\
46
+ \ listlike object\n func : depth aggregation strategy (defaults to max)\n\
47
+ \ _depth : internal var\n\n Example:\n >>> # ENABLE_DOCTEST\n\
48
+ \ >>> from utool.util_list import * # NOQA\n >>> list_ = [[[[[1]]],\
49
+ \ [3]], [[1], [3]], [[1], [3]]]\n >>> result = (list_depth(list_, _depth=0))\n\
50
+ \ >>> print(result)\n\n \"\"\"\n depth_list = [list_depth(item, func=func,\
51
+ \ _depth=_depth + 1)\n for item in list_ if util_type.is_listlike(item)]\n\
52
+ \ if len(depth_list) > 0:\n return func(depth_list)\n else:\n \
53
+ \ return _depth"
54
+ - source_sentence: python parse query param
55
+ sentences:
56
+ - "def read_las(source, closefd=True):\n \"\"\" Entry point for reading las data\
57
+ \ in pylas\n\n Reads the whole file into memory.\n\n >>> las = read_las(\"\
58
+ pylastests/simple.las\")\n >>> las.classification\n array([1, 1, 1, ...,\
59
+ \ 1, 1, 1], dtype=uint8)\n\n Parameters\n ----------\n source : str or\
60
+ \ io.BytesIO\n The source to read data from\n\n closefd: bool\n \
61
+ \ if True and the source is a stream, the function will close it\n \
62
+ \ after it is done reading\n\n\n Returns\n -------\n pylas.lasdatas.base.LasBase\n\
63
+ \ The object you can interact with to get access to the LAS points & VLRs\n\
64
+ \ \"\"\"\n with open_las(source, closefd=closefd) as reader:\n return\
65
+ \ reader.read()"
66
+ - "def parse_query_string(query):\n \"\"\"\n parse_query_string:\n very\
67
+ \ simplistic. won't do the right thing with list values\n \"\"\"\n result\
68
+ \ = {}\n qparts = query.split('&')\n for item in qparts:\n key, value\
69
+ \ = item.split('=')\n key = key.strip()\n value = value.strip()\n\
70
+ \ result[key] = unquote_plus(value)\n return result"
71
+ - "def _clean_dict(target_dict, whitelist=None):\n \"\"\" Convenience function\
72
+ \ that removes a dicts keys that have falsy values\n \"\"\"\n assert isinstance(target_dict,\
73
+ \ dict)\n return {\n ustr(k).strip(): ustr(v).strip()\n for k,\
74
+ \ v in target_dict.items()\n if v not in (None, Ellipsis, [], (), \"\"\
75
+ )\n and (not whitelist or k in whitelist)\n }"
76
+ - source_sentence: python automatic figure out encoding
77
+ sentences:
78
+ - "def get_best_encoding(stream):\n \"\"\"Returns the default stream encoding\
79
+ \ if not found.\"\"\"\n rv = getattr(stream, 'encoding', None) or sys.getdefaultencoding()\n\
80
+ \ if is_ascii_encoding(rv):\n return 'utf-8'\n return rv"
81
+ - "def is_natural(x):\n \"\"\"A non-negative integer.\"\"\"\n try:\n \
82
+ \ is_integer = int(x) == x\n except (TypeError, ValueError):\n return\
83
+ \ False\n return is_integer and x >= 0"
84
+ - "def _tool_to_dict(tool):\n \"\"\"Parse a tool definition into a cwl2wdl style\
85
+ \ dictionary.\n \"\"\"\n out = {\"name\": _id_to_name(tool.tool[\"id\"]),\n\
86
+ \ \"baseCommand\": \" \".join(tool.tool[\"baseCommand\"]),\n \
87
+ \ \"arguments\": [],\n \"inputs\": [_input_to_dict(i) for i in tool.tool[\"\
88
+ inputs\"]],\n \"outputs\": [_output_to_dict(o) for o in tool.tool[\"\
89
+ outputs\"]],\n \"requirements\": _requirements_to_dict(tool.requirements\
90
+ \ + tool.hints),\n \"stdin\": None, \"stdout\": None}\n return out"
91
+ pipeline_tag: sentence-similarity
92
+ library_name: sentence-transformers
93
+ ---
94
+
95
+ # SentenceTransformer based on sentence-transformers/all-MiniLM-L6-v2
96
+
97
+ 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.
98
+
99
+ ## Model Details
100
+
101
+ ### Model Description
102
+ - **Model Type:** Sentence Transformer
103
+ - **Base model:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) <!-- at revision c9745ed1d9f207416be6d2e6f8de32d1f16199bf -->
104
+ - **Maximum Sequence Length:** 256 tokens
105
+ - **Output Dimensionality:** 384 dimensions
106
+ - **Similarity Function:** Cosine Similarity
107
+ <!-- - **Training Dataset:** Unknown -->
108
+ <!-- - **Language:** Unknown -->
109
+ <!-- - **License:** Unknown -->
110
+
111
+ ### Model Sources
112
+
113
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
114
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
115
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
116
+
117
+ ### Full Model Architecture
118
+
119
+ ```
120
+ SentenceTransformer(
121
+ (0): Transformer({'max_seq_length': 256, 'do_lower_case': False, 'architecture': 'BertModel'})
122
+ (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})
123
+ (2): Normalize()
124
+ )
125
+ ```
126
+
127
+ ## Usage
128
+
129
+ ### Direct Usage (Sentence Transformers)
130
+
131
+ First install the Sentence Transformers library:
132
+
133
+ ```bash
134
+ pip install -U sentence-transformers
135
+ ```
136
+
137
+ Then you can load this model and run inference.
138
+ ```python
139
+ from sentence_transformers import SentenceTransformer
140
+
141
+ # Download from the 🤗 Hub
142
+ model = SentenceTransformer("Narekatsy/fine-tuned-cosqa")
143
+ # Run inference
144
+ sentences = [
145
+ 'python automatic figure out encoding',
146
+ 'def get_best_encoding(stream):\n """Returns the default stream encoding if not found."""\n rv = getattr(stream, \'encoding\', None) or sys.getdefaultencoding()\n if is_ascii_encoding(rv):\n return \'utf-8\'\n return rv',
147
+ 'def _tool_to_dict(tool):\n """Parse a tool definition into a cwl2wdl style dictionary.\n """\n out = {"name": _id_to_name(tool.tool["id"]),\n "baseCommand": " ".join(tool.tool["baseCommand"]),\n "arguments": [],\n "inputs": [_input_to_dict(i) for i in tool.tool["inputs"]],\n "outputs": [_output_to_dict(o) for o in tool.tool["outputs"]],\n "requirements": _requirements_to_dict(tool.requirements + tool.hints),\n "stdin": None, "stdout": None}\n return out',
148
+ ]
149
+ embeddings = model.encode(sentences)
150
+ print(embeddings.shape)
151
+ # [3, 384]
152
+
153
+ # Get the similarity scores for the embeddings
154
+ similarities = model.similarity(embeddings, embeddings)
155
+ print(similarities)
156
+ # tensor([[ 1.0000, 0.6173, 0.1376],
157
+ # [ 0.6173, 1.0000, -0.0456],
158
+ # [ 0.1376, -0.0456, 1.0000]])
159
+ ```
160
+
161
+ <!--
162
+ ### Direct Usage (Transformers)
163
+
164
+ <details><summary>Click to see the direct usage in Transformers</summary>
165
+
166
+ </details>
167
+ -->
168
+
169
+ <!--
170
+ ### Downstream Usage (Sentence Transformers)
171
+
172
+ You can finetune this model on your own dataset.
173
+
174
+ <details><summary>Click to expand</summary>
175
+
176
+ </details>
177
+ -->
178
+
179
+ <!--
180
+ ### Out-of-Scope Use
181
+
182
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
183
+ -->
184
+
185
+ <!--
186
+ ## Bias, Risks and Limitations
187
+
188
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
189
+ -->
190
+
191
+ <!--
192
+ ### Recommendations
193
+
194
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
195
+ -->
196
+
197
+ ## Training Details
198
+
199
+ ### Training Dataset
200
+
201
+ #### Unnamed Dataset
202
+
203
+ * Size: 9,984 training samples
204
+ * Columns: <code>sentence_0</code> and <code>sentence_1</code>
205
+ * Approximate statistics based on the first 1000 samples:
206
+ | | sentence_0 | sentence_1 |
207
+ |:--------|:---------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|
208
+ | type | string | string |
209
+ | details | <ul><li>min: 6 tokens</li><li>mean: 9.69 tokens</li><li>max: 24 tokens</li></ul> | <ul><li>min: 39 tokens</li><li>mean: 87.33 tokens</li><li>max: 256 tokens</li></ul> |
210
+ * Samples:
211
+ | sentence_0 | sentence_1 |
212
+ |:--------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
213
+ | <code>how to zip files to directory in python</code> | <code>def unzip_file_to_dir(path_to_zip, output_directory):<br> """<br> Extract a ZIP archive to a directory<br> """<br> z = ZipFile(path_to_zip, 'r')<br> z.extractall(output_directory)<br> z.close()</code> |
214
+ | <code>mnist multi gpu training python tensorflow</code> | <code>def transformer_tall_pretrain_lm_tpu_adafactor():<br> """Hparams for transformer on LM pretraining (with 64k vocab) on TPU."""<br> hparams = transformer_tall_pretrain_lm()<br> update_hparams_for_tpu(hparams)<br> hparams.max_length = 1024<br> # For multi-problem on TPU we need it in absolute examples.<br> hparams.batch_size = 8<br> hparams.multiproblem_vocab_size = 2**16<br> return hparams</code> |
215
+ | <code>get file name without extension in python</code> | <code>def remove_ext(fname):<br> """Removes the extension from a filename<br> """<br> bn = os.path.basename(fname)<br> return os.path.splitext(bn)[0]</code> |
216
+ * Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
217
+ ```json
218
+ {
219
+ "scale": 20.0,
220
+ "similarity_fct": "cos_sim",
221
+ "gather_across_devices": false
222
+ }
223
+ ```
224
+
225
+ ### Training Hyperparameters
226
+ #### Non-Default Hyperparameters
227
+
228
+ - `per_device_train_batch_size`: 32
229
+ - `per_device_eval_batch_size`: 32
230
+ - `num_train_epochs`: 2
231
+ - `multi_dataset_batch_sampler`: round_robin
232
+
233
+ #### All Hyperparameters
234
+ <details><summary>Click to expand</summary>
235
+
236
+ - `overwrite_output_dir`: False
237
+ - `do_predict`: False
238
+ - `eval_strategy`: no
239
+ - `prediction_loss_only`: True
240
+ - `per_device_train_batch_size`: 32
241
+ - `per_device_eval_batch_size`: 32
242
+ - `per_gpu_train_batch_size`: None
243
+ - `per_gpu_eval_batch_size`: None
244
+ - `gradient_accumulation_steps`: 1
245
+ - `eval_accumulation_steps`: None
246
+ - `torch_empty_cache_steps`: None
247
+ - `learning_rate`: 5e-05
248
+ - `weight_decay`: 0.0
249
+ - `adam_beta1`: 0.9
250
+ - `adam_beta2`: 0.999
251
+ - `adam_epsilon`: 1e-08
252
+ - `max_grad_norm`: 1
253
+ - `num_train_epochs`: 2
254
+ - `max_steps`: -1
255
+ - `lr_scheduler_type`: linear
256
+ - `lr_scheduler_kwargs`: {}
257
+ - `warmup_ratio`: 0.0
258
+ - `warmup_steps`: 0
259
+ - `log_level`: passive
260
+ - `log_level_replica`: warning
261
+ - `log_on_each_node`: True
262
+ - `logging_nan_inf_filter`: True
263
+ - `save_safetensors`: True
264
+ - `save_on_each_node`: False
265
+ - `save_only_model`: False
266
+ - `restore_callback_states_from_checkpoint`: False
267
+ - `no_cuda`: False
268
+ - `use_cpu`: False
269
+ - `use_mps_device`: False
270
+ - `seed`: 42
271
+ - `data_seed`: None
272
+ - `jit_mode_eval`: False
273
+ - `bf16`: False
274
+ - `fp16`: False
275
+ - `fp16_opt_level`: O1
276
+ - `half_precision_backend`: auto
277
+ - `bf16_full_eval`: False
278
+ - `fp16_full_eval`: False
279
+ - `tf32`: None
280
+ - `local_rank`: 0
281
+ - `ddp_backend`: None
282
+ - `tpu_num_cores`: None
283
+ - `tpu_metrics_debug`: False
284
+ - `debug`: []
285
+ - `dataloader_drop_last`: False
286
+ - `dataloader_num_workers`: 0
287
+ - `dataloader_prefetch_factor`: None
288
+ - `past_index`: -1
289
+ - `disable_tqdm`: False
290
+ - `remove_unused_columns`: True
291
+ - `label_names`: None
292
+ - `load_best_model_at_end`: False
293
+ - `ignore_data_skip`: False
294
+ - `fsdp`: []
295
+ - `fsdp_min_num_params`: 0
296
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
297
+ - `fsdp_transformer_layer_cls_to_wrap`: None
298
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
299
+ - `parallelism_config`: None
300
+ - `deepspeed`: None
301
+ - `label_smoothing_factor`: 0.0
302
+ - `optim`: adamw_torch_fused
303
+ - `optim_args`: None
304
+ - `adafactor`: False
305
+ - `group_by_length`: False
306
+ - `length_column_name`: length
307
+ - `project`: huggingface
308
+ - `trackio_space_id`: trackio
309
+ - `ddp_find_unused_parameters`: None
310
+ - `ddp_bucket_cap_mb`: None
311
+ - `ddp_broadcast_buffers`: False
312
+ - `dataloader_pin_memory`: True
313
+ - `dataloader_persistent_workers`: False
314
+ - `skip_memory_metrics`: True
315
+ - `use_legacy_prediction_loop`: False
316
+ - `push_to_hub`: False
317
+ - `resume_from_checkpoint`: None
318
+ - `hub_model_id`: None
319
+ - `hub_strategy`: every_save
320
+ - `hub_private_repo`: None
321
+ - `hub_always_push`: False
322
+ - `hub_revision`: None
323
+ - `gradient_checkpointing`: False
324
+ - `gradient_checkpointing_kwargs`: None
325
+ - `include_inputs_for_metrics`: False
326
+ - `include_for_metrics`: []
327
+ - `eval_do_concat_batches`: True
328
+ - `fp16_backend`: auto
329
+ - `push_to_hub_model_id`: None
330
+ - `push_to_hub_organization`: None
331
+ - `mp_parameters`:
332
+ - `auto_find_batch_size`: False
333
+ - `full_determinism`: False
334
+ - `torchdynamo`: None
335
+ - `ray_scope`: last
336
+ - `ddp_timeout`: 1800
337
+ - `torch_compile`: False
338
+ - `torch_compile_backend`: None
339
+ - `torch_compile_mode`: None
340
+ - `include_tokens_per_second`: False
341
+ - `include_num_input_tokens_seen`: no
342
+ - `neftune_noise_alpha`: None
343
+ - `optim_target_modules`: None
344
+ - `batch_eval_metrics`: False
345
+ - `eval_on_start`: False
346
+ - `use_liger_kernel`: False
347
+ - `liger_kernel_config`: None
348
+ - `eval_use_gather_object`: False
349
+ - `average_tokens_across_devices`: True
350
+ - `prompts`: None
351
+ - `batch_sampler`: batch_sampler
352
+ - `multi_dataset_batch_sampler`: round_robin
353
+ - `router_mapping`: {}
354
+ - `learning_rate_mapping`: {}
355
+
356
+ </details>
357
+
358
+ ### Training Logs
359
+ | Epoch | Step | Training Loss |
360
+ |:------:|:----:|:-------------:|
361
+ | 1.6026 | 500 | 0.1512 |
362
+
363
+
364
+ ### Framework Versions
365
+ - Python: 3.11.3
366
+ - Sentence Transformers: 5.1.2
367
+ - Transformers: 4.57.1
368
+ - PyTorch: 2.9.0+cpu
369
+ - Accelerate: 1.11.0
370
+ - Datasets: 4.4.1
371
+ - Tokenizers: 0.22.1
372
+
373
+ ## Citation
374
+
375
+ ### BibTeX
376
+
377
+ #### Sentence Transformers
378
+ ```bibtex
379
+ @inproceedings{reimers-2019-sentence-bert,
380
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
381
+ author = "Reimers, Nils and Gurevych, Iryna",
382
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
383
+ month = "11",
384
+ year = "2019",
385
+ publisher = "Association for Computational Linguistics",
386
+ url = "https://arxiv.org/abs/1908.10084",
387
+ }
388
+ ```
389
+
390
+ #### MultipleNegativesRankingLoss
391
+ ```bibtex
392
+ @misc{henderson2017efficient,
393
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
394
+ 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},
395
+ year={2017},
396
+ eprint={1705.00652},
397
+ archivePrefix={arXiv},
398
+ primaryClass={cs.CL}
399
+ }
400
+ ```
401
+
402
+ <!--
403
+ ## Glossary
404
+
405
+ *Clearly define terms in order to be accessible across audiences.*
406
+ -->
407
+
408
+ <!--
409
+ ## Model Card Authors
410
+
411
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
412
+ -->
413
+
414
+ <!--
415
+ ## Model Card Contact
416
+
417
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
418
+ -->
config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertModel"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "classifier_dropout": null,
7
+ "dtype": "float32",
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
+ "transformers_version": "4.57.1",
22
+ "type_vocab_size": 2,
23
+ "use_cache": true,
24
+ "vocab_size": 30522
25
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "5.1.2",
4
+ "transformers": "4.57.1",
5
+ "pytorch": "2.9.0+cpu"
6
+ },
7
+ "model_type": "SentenceTransformer",
8
+ "prompts": {
9
+ "query": "",
10
+ "document": ""
11
+ },
12
+ "default_prompt_name": null,
13
+ "similarity_fn_name": "cosine"
14
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b22034c3d5ea67bd613cff69ab219db0a5cedc5bbf13e13aff9d9eedb770e0a1
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,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": false,
45
+ "cls_token": "[CLS]",
46
+ "do_basic_tokenize": true,
47
+ "do_lower_case": true,
48
+ "extra_special_tokens": {},
49
+ "mask_token": "[MASK]",
50
+ "max_length": 128,
51
+ "model_max_length": 256,
52
+ "never_split": null,
53
+ "pad_to_multiple_of": null,
54
+ "pad_token": "[PAD]",
55
+ "pad_token_type_id": 0,
56
+ "padding_side": "right",
57
+ "sep_token": "[SEP]",
58
+ "stride": 0,
59
+ "strip_accents": null,
60
+ "tokenize_chinese_chars": true,
61
+ "tokenizer_class": "BertTokenizer",
62
+ "truncation_side": "right",
63
+ "truncation_strategy": "longest_first",
64
+ "unk_token": "[UNK]"
65
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff