Add new SentenceTransformer model.
Browse files- .gitattributes +1 -0
- 1_Pooling/config.json +10 -0
- README.md +360 -0
- config.json +32 -0
- config_sentence_transformers.json +10 -0
- model.safetensors +3 -0
- modules.json +20 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +37 -0
- tokenizer.json +3 -0
- tokenizer_config.json +58 -0
- vocab.txt +0 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
1_Pooling/config.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"word_embedding_dimension": 768,
|
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,360 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: sentence-transformers/use-cmlm-multilingual
|
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:6235
|
13 |
+
- loss:MegaBatchMarginLoss
|
14 |
+
widget:
|
15 |
+
- source_sentence: واسأل من أرسلنا من قبلك من رسلنا أجعلنا من دون الرحمن آلهة يعبدون
|
16 |
+
sentences:
|
17 |
+
- وجعلني مباركا أين ما كنت وأوصاني بالصلاة والزكاة ما دمت حيا
|
18 |
+
- فيومئذ وقعت الواقعة
|
19 |
+
- ولقد أرسلنا موسى بآياتنا إلى فرعون وملئه فقال إني رسول رب العالمين
|
20 |
+
- source_sentence: ولن تستطيعوا أن تعدلوا بين النساء ولو حرصتم فلا تميلوا كل الميل
|
21 |
+
فتذروها كالمعلقة وإن تصلحوا وتتقوا فإن الله كان غفورا رحيما
|
22 |
+
sentences:
|
23 |
+
- وهو الذي مرج البحرين هذا عذب فرات وهذا ملح أجاج وجعل بينهما برزخا وحجرا محجورا
|
24 |
+
- قل اللهم مالك الملك تؤتي الملك من تشاء وتنزع الملك ممن تشاء وتعز من تشاء وتذل
|
25 |
+
من تشاء بيدك الخير إنك على كل شيء قدير
|
26 |
+
- وإن يتفرقا يغن الله كلا من سعته وكان الله واسعا حكيما
|
27 |
+
- source_sentence: قالوا نريد أن نأكل منها وتطمئن قلوبنا ونعلم أن قد صدقتنا ونكون
|
28 |
+
عليها من الشاهدين
|
29 |
+
sentences:
|
30 |
+
- قال عيسى ابن مريم اللهم ربنا أنزل علينا مائدة من السماء تكون لنا عيدا لأولنا وآخرنا
|
31 |
+
وآية منك وارزقنا وأنت خير الرازقين
|
32 |
+
- ليعذب الله المنافقين والمنافقات والمشركين والمشركات ويتوب الله على المؤمنين والمؤمنات
|
33 |
+
وكان الله غفورا رحيما
|
34 |
+
- فقلت استغفروا ربكم إنه كان غفارا
|
35 |
+
- source_sentence: ولا تحسبن الذين قتلوا في سبيل الله أمواتا بل أحياء عند ربهم يرزقون
|
36 |
+
sentences:
|
37 |
+
- بل كذبوا بالحق لما جاءهم فهم في أمر مريج
|
38 |
+
- قد خسر الذين كذبوا بلقاء الله حتى إذا جاءتهم الساعة بغتة قالوا يا حسرتنا على ما
|
39 |
+
فرطنا فيها وهم يحملون أوزارهم على ظهورهم ألا ساء ما يزرون
|
40 |
+
- فرحين بما آتاهم الله من فضله ويستبشرون بالذين لم يلحقوا بهم من خلفهم ألا خوف عليهم
|
41 |
+
ولا هم يحزنون
|
42 |
+
- source_sentence: وإذ واعدنا موسى أربعين ليلة ثم اتخذتم العجل من بعده وأنتم ظالمون
|
43 |
+
sentences:
|
44 |
+
- ثم عفونا عنكم من بعد ذلك لعلكم تشكرون
|
45 |
+
- فاتقوا الله وأطيعون
|
46 |
+
- نحن أعلم بما يقولون وما أنت عليهم بجبار فذكر بالقرآن من يخاف وعيد
|
47 |
+
---
|
48 |
+
|
49 |
+
# SentenceTransformer based on sentence-transformers/use-cmlm-multilingual
|
50 |
+
|
51 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/use-cmlm-multilingual](https://huggingface.co/sentence-transformers/use-cmlm-multilingual). It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
|
52 |
+
|
53 |
+
## Model Details
|
54 |
+
|
55 |
+
### Model Description
|
56 |
+
- **Model Type:** Sentence Transformer
|
57 |
+
- **Base model:** [sentence-transformers/use-cmlm-multilingual](https://huggingface.co/sentence-transformers/use-cmlm-multilingual) <!-- at revision 6f8ff6583c371cbc4d6d3b93a5e37a888fd54574 -->
|
58 |
+
- **Maximum Sequence Length:** 256 tokens
|
59 |
+
- **Output Dimensionality:** 768 tokens
|
60 |
+
- **Similarity Function:** Cosine Similarity
|
61 |
+
<!-- - **Training Dataset:** Unknown -->
|
62 |
+
<!-- - **Language:** Unknown -->
|
63 |
+
<!-- - **License:** Unknown -->
|
64 |
+
|
65 |
+
### Model Sources
|
66 |
+
|
67 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
68 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
69 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
70 |
+
|
71 |
+
### Full Model Architecture
|
72 |
+
|
73 |
+
```
|
74 |
+
SentenceTransformer(
|
75 |
+
(0): Transformer({'max_seq_length': 256, 'do_lower_case': False}) with Transformer model: BertModel
|
76 |
+
(1): Pooling({'word_embedding_dimension': 768, '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})
|
77 |
+
(2): Normalize()
|
78 |
+
)
|
79 |
+
```
|
80 |
+
|
81 |
+
## Usage
|
82 |
+
|
83 |
+
### Direct Usage (Sentence Transformers)
|
84 |
+
|
85 |
+
First install the Sentence Transformers library:
|
86 |
+
|
87 |
+
```bash
|
88 |
+
pip install -U sentence-transformers
|
89 |
+
```
|
90 |
+
|
91 |
+
Then you can load this model and run inference.
|
92 |
+
```python
|
93 |
+
from sentence_transformers import SentenceTransformer
|
94 |
+
|
95 |
+
# Download from the 🤗 Hub
|
96 |
+
model = SentenceTransformer("Bofandra/fine-tuning-use-cmlm-multilingual-quran")
|
97 |
+
# Run inference
|
98 |
+
sentences = [
|
99 |
+
'وإذ واعدنا موسى أربعين ليلة ثم اتخذتم العجل من بعده وأنتم ظالمون',
|
100 |
+
'ثم عفونا عنكم من بعد ذلك لعلكم تشكرون',
|
101 |
+
'نحن أعلم بما يقولون وما أنت عليهم بجبار فذكر بالقرآن من يخاف وعيد',
|
102 |
+
]
|
103 |
+
embeddings = model.encode(sentences)
|
104 |
+
print(embeddings.shape)
|
105 |
+
# [3, 768]
|
106 |
+
|
107 |
+
# Get the similarity scores for the embeddings
|
108 |
+
similarities = model.similarity(embeddings, embeddings)
|
109 |
+
print(similarities.shape)
|
110 |
+
# [3, 3]
|
111 |
+
```
|
112 |
+
|
113 |
+
<!--
|
114 |
+
### Direct Usage (Transformers)
|
115 |
+
|
116 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
117 |
+
|
118 |
+
</details>
|
119 |
+
-->
|
120 |
+
|
121 |
+
<!--
|
122 |
+
### Downstream Usage (Sentence Transformers)
|
123 |
+
|
124 |
+
You can finetune this model on your own dataset.
|
125 |
+
|
126 |
+
<details><summary>Click to expand</summary>
|
127 |
+
|
128 |
+
</details>
|
129 |
+
-->
|
130 |
+
|
131 |
+
<!--
|
132 |
+
### Out-of-Scope Use
|
133 |
+
|
134 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
135 |
+
-->
|
136 |
+
|
137 |
+
<!--
|
138 |
+
## Bias, Risks and Limitations
|
139 |
+
|
140 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
141 |
+
-->
|
142 |
+
|
143 |
+
<!--
|
144 |
+
### Recommendations
|
145 |
+
|
146 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
147 |
+
-->
|
148 |
+
|
149 |
+
## Training Details
|
150 |
+
|
151 |
+
### Training Dataset
|
152 |
+
|
153 |
+
#### Unnamed Dataset
|
154 |
+
|
155 |
+
|
156 |
+
* Size: 6,235 training samples
|
157 |
+
* Columns: <code>sentence_0</code> and <code>sentence_1</code>
|
158 |
+
* Approximate statistics based on the first 1000 samples:
|
159 |
+
| | sentence_0 | sentence_1 |
|
160 |
+
|:--------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|
|
161 |
+
| type | string | string |
|
162 |
+
| details | <ul><li>min: 4 tokens</li><li>mean: 24.26 tokens</li><li>max: 122 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 25.14 tokens</li><li>max: 130 tokens</li></ul> |
|
163 |
+
* Samples:
|
164 |
+
| sentence_0 | sentence_1 |
|
165 |
+
|:-------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
166 |
+
| <code>يوم يسحبون في النار على وجوههم ذوقوا مس سقر</code> | <code>إنا كل شيء خلقناه بقدر</code> |
|
167 |
+
| <code>فإذا نقر في الناقور</code> | <code>فذلك يومئذ يوم عسير</code> |
|
168 |
+
| <code>في الدنيا والآخرة ويسألونك عن اليتامى قل إصلاح لهم خير وإن تخالطوهم فإخوانكم والله يعلم المفسد من المصلح ولو شاء الله لأعنتكم إن الله عزيز حكيم</code> | <code>ولا تنكحوا المشركات حتى يؤمن ولأمة مؤمنة خير من مشركة ولو أعجبتكم ولا تنكحوا المشركين حتى يؤمنوا ولعبد مؤمن خير من مشرك ولو أعجبكم أولئك يدعون إلى النار والله يدعو إلى الجنة والمغفرة بإذنه ويبين آياته للناس لعلهم يتذكرون</code> |
|
169 |
+
* Loss: [<code>MegaBatchMarginLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#megabatchmarginloss)
|
170 |
+
|
171 |
+
### Training Hyperparameters
|
172 |
+
#### Non-Default Hyperparameters
|
173 |
+
|
174 |
+
- `per_device_train_batch_size`: 4
|
175 |
+
- `per_device_eval_batch_size`: 4
|
176 |
+
- `num_train_epochs`: 1
|
177 |
+
- `multi_dataset_batch_sampler`: round_robin
|
178 |
+
|
179 |
+
#### All Hyperparameters
|
180 |
+
<details><summary>Click to expand</summary>
|
181 |
+
|
182 |
+
- `overwrite_output_dir`: False
|
183 |
+
- `do_predict`: False
|
184 |
+
- `eval_strategy`: no
|
185 |
+
- `prediction_loss_only`: True
|
186 |
+
- `per_device_train_batch_size`: 4
|
187 |
+
- `per_device_eval_batch_size`: 4
|
188 |
+
- `per_gpu_train_batch_size`: None
|
189 |
+
- `per_gpu_eval_batch_size`: None
|
190 |
+
- `gradient_accumulation_steps`: 1
|
191 |
+
- `eval_accumulation_steps`: None
|
192 |
+
- `learning_rate`: 5e-05
|
193 |
+
- `weight_decay`: 0.0
|
194 |
+
- `adam_beta1`: 0.9
|
195 |
+
- `adam_beta2`: 0.999
|
196 |
+
- `adam_epsilon`: 1e-08
|
197 |
+
- `max_grad_norm`: 1
|
198 |
+
- `num_train_epochs`: 1
|
199 |
+
- `max_steps`: -1
|
200 |
+
- `lr_scheduler_type`: linear
|
201 |
+
- `lr_scheduler_kwargs`: {}
|
202 |
+
- `warmup_ratio`: 0.0
|
203 |
+
- `warmup_steps`: 0
|
204 |
+
- `log_level`: passive
|
205 |
+
- `log_level_replica`: warning
|
206 |
+
- `log_on_each_node`: True
|
207 |
+
- `logging_nan_inf_filter`: True
|
208 |
+
- `save_safetensors`: True
|
209 |
+
- `save_on_each_node`: False
|
210 |
+
- `save_only_model`: False
|
211 |
+
- `restore_callback_states_from_checkpoint`: False
|
212 |
+
- `no_cuda`: False
|
213 |
+
- `use_cpu`: False
|
214 |
+
- `use_mps_device`: False
|
215 |
+
- `seed`: 42
|
216 |
+
- `data_seed`: None
|
217 |
+
- `jit_mode_eval`: False
|
218 |
+
- `use_ipex`: False
|
219 |
+
- `bf16`: False
|
220 |
+
- `fp16`: False
|
221 |
+
- `fp16_opt_level`: O1
|
222 |
+
- `half_precision_backend`: auto
|
223 |
+
- `bf16_full_eval`: False
|
224 |
+
- `fp16_full_eval`: False
|
225 |
+
- `tf32`: None
|
226 |
+
- `local_rank`: 0
|
227 |
+
- `ddp_backend`: None
|
228 |
+
- `tpu_num_cores`: None
|
229 |
+
- `tpu_metrics_debug`: False
|
230 |
+
- `debug`: []
|
231 |
+
- `dataloader_drop_last`: False
|
232 |
+
- `dataloader_num_workers`: 0
|
233 |
+
- `dataloader_prefetch_factor`: None
|
234 |
+
- `past_index`: -1
|
235 |
+
- `disable_tqdm`: False
|
236 |
+
- `remove_unused_columns`: True
|
237 |
+
- `label_names`: None
|
238 |
+
- `load_best_model_at_end`: False
|
239 |
+
- `ignore_data_skip`: False
|
240 |
+
- `fsdp`: []
|
241 |
+
- `fsdp_min_num_params`: 0
|
242 |
+
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
243 |
+
- `fsdp_transformer_layer_cls_to_wrap`: None
|
244 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
245 |
+
- `deepspeed`: None
|
246 |
+
- `label_smoothing_factor`: 0.0
|
247 |
+
- `optim`: adamw_torch
|
248 |
+
- `optim_args`: None
|
249 |
+
- `adafactor`: False
|
250 |
+
- `group_by_length`: False
|
251 |
+
- `length_column_name`: length
|
252 |
+
- `ddp_find_unused_parameters`: None
|
253 |
+
- `ddp_bucket_cap_mb`: None
|
254 |
+
- `ddp_broadcast_buffers`: False
|
255 |
+
- `dataloader_pin_memory`: True
|
256 |
+
- `dataloader_persistent_workers`: False
|
257 |
+
- `skip_memory_metrics`: True
|
258 |
+
- `use_legacy_prediction_loop`: False
|
259 |
+
- `push_to_hub`: False
|
260 |
+
- `resume_from_checkpoint`: None
|
261 |
+
- `hub_model_id`: None
|
262 |
+
- `hub_strategy`: every_save
|
263 |
+
- `hub_private_repo`: False
|
264 |
+
- `hub_always_push`: False
|
265 |
+
- `gradient_checkpointing`: False
|
266 |
+
- `gradient_checkpointing_kwargs`: None
|
267 |
+
- `include_inputs_for_metrics`: False
|
268 |
+
- `eval_do_concat_batches`: True
|
269 |
+
- `fp16_backend`: auto
|
270 |
+
- `push_to_hub_model_id`: None
|
271 |
+
- `push_to_hub_organization`: None
|
272 |
+
- `mp_parameters`:
|
273 |
+
- `auto_find_batch_size`: False
|
274 |
+
- `full_determinism`: False
|
275 |
+
- `torchdynamo`: None
|
276 |
+
- `ray_scope`: last
|
277 |
+
- `ddp_timeout`: 1800
|
278 |
+
- `torch_compile`: False
|
279 |
+
- `torch_compile_backend`: None
|
280 |
+
- `torch_compile_mode`: None
|
281 |
+
- `dispatch_batches`: None
|
282 |
+
- `split_batches`: None
|
283 |
+
- `include_tokens_per_second`: False
|
284 |
+
- `include_num_input_tokens_seen`: False
|
285 |
+
- `neftune_noise_alpha`: None
|
286 |
+
- `optim_target_modules`: None
|
287 |
+
- `batch_eval_metrics`: False
|
288 |
+
- `batch_sampler`: batch_sampler
|
289 |
+
- `multi_dataset_batch_sampler`: round_robin
|
290 |
+
|
291 |
+
</details>
|
292 |
+
|
293 |
+
### Training Logs
|
294 |
+
| Epoch | Step | Training Loss |
|
295 |
+
|:------:|:----:|:-------------:|
|
296 |
+
| 0.3207 | 500 | 0.5052 |
|
297 |
+
| 0.6414 | 1000 | 0.4827 |
|
298 |
+
| 0.9622 | 1500 | 0.466 |
|
299 |
+
|
300 |
+
|
301 |
+
### Framework Versions
|
302 |
+
- Python: 3.10.12
|
303 |
+
- Sentence Transformers: 3.0.1
|
304 |
+
- Transformers: 4.41.2
|
305 |
+
- PyTorch: 2.3.0+cu121
|
306 |
+
- Accelerate: 0.31.0
|
307 |
+
- Datasets: 2.20.0
|
308 |
+
- Tokenizers: 0.19.1
|
309 |
+
|
310 |
+
## Citation
|
311 |
+
|
312 |
+
### BibTeX
|
313 |
+
|
314 |
+
#### Sentence Transformers
|
315 |
+
```bibtex
|
316 |
+
@inproceedings{reimers-2019-sentence-bert,
|
317 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
318 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
319 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
320 |
+
month = "11",
|
321 |
+
year = "2019",
|
322 |
+
publisher = "Association for Computational Linguistics",
|
323 |
+
url = "https://arxiv.org/abs/1908.10084",
|
324 |
+
}
|
325 |
+
```
|
326 |
+
|
327 |
+
#### MegaBatchMarginLoss
|
328 |
+
```bibtex
|
329 |
+
@inproceedings{wieting-gimpel-2018-paranmt,
|
330 |
+
title = "{P}ara{NMT}-50{M}: Pushing the Limits of Paraphrastic Sentence Embeddings with Millions of Machine Translations",
|
331 |
+
author = "Wieting, John and Gimpel, Kevin",
|
332 |
+
editor = "Gurevych, Iryna and Miyao, Yusuke",
|
333 |
+
booktitle = "Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
|
334 |
+
month = jul,
|
335 |
+
year = "2018",
|
336 |
+
address = "Melbourne, Australia",
|
337 |
+
publisher = "Association for Computational Linguistics",
|
338 |
+
url = "https://aclanthology.org/P18-1042",
|
339 |
+
doi = "10.18653/v1/P18-1042",
|
340 |
+
pages = "451--462",
|
341 |
+
}
|
342 |
+
```
|
343 |
+
|
344 |
+
<!--
|
345 |
+
## Glossary
|
346 |
+
|
347 |
+
*Clearly define terms in order to be accessible across audiences.*
|
348 |
+
-->
|
349 |
+
|
350 |
+
<!--
|
351 |
+
## Model Card Authors
|
352 |
+
|
353 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
354 |
+
-->
|
355 |
+
|
356 |
+
<!--
|
357 |
+
## Model Card Contact
|
358 |
+
|
359 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
360 |
+
-->
|
config.json
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "sentence-transformers/use-cmlm-multilingual",
|
3 |
+
"architectures": [
|
4 |
+
"BertModel"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"classifier_dropout": null,
|
8 |
+
"directionality": "bidi",
|
9 |
+
"gradient_checkpointing": false,
|
10 |
+
"hidden_act": "gelu",
|
11 |
+
"hidden_dropout_prob": 0.1,
|
12 |
+
"hidden_size": 768,
|
13 |
+
"initializer_range": 0.02,
|
14 |
+
"intermediate_size": 3072,
|
15 |
+
"layer_norm_eps": 1e-12,
|
16 |
+
"max_position_embeddings": 512,
|
17 |
+
"model_type": "bert",
|
18 |
+
"num_attention_heads": 12,
|
19 |
+
"num_hidden_layers": 12,
|
20 |
+
"pad_token_id": 0,
|
21 |
+
"pooler_fc_size": 768,
|
22 |
+
"pooler_num_attention_heads": 12,
|
23 |
+
"pooler_num_fc_layers": 3,
|
24 |
+
"pooler_size_per_head": 128,
|
25 |
+
"pooler_type": "first_token_transform",
|
26 |
+
"position_embedding_type": "absolute",
|
27 |
+
"torch_dtype": "float32",
|
28 |
+
"transformers_version": "4.41.2",
|
29 |
+
"type_vocab_size": 2,
|
30 |
+
"use_cache": true,
|
31 |
+
"vocab_size": 501153
|
32 |
+
}
|
config_sentence_transformers.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "3.0.1",
|
4 |
+
"transformers": "4.41.2",
|
5 |
+
"pytorch": "2.3.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:5c425c74890196acbe917ea8e9b35939e56f3d804a583c362845b49979dcf071
|
3 |
+
size 1883730160
|
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
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:92262b29204f8fdc169a63f9005a0e311a16262cef4d96ecfe2a7ed638662ed3
|
3 |
+
size 13632172
|
tokenizer_config.json
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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": false,
|
48 |
+
"full_tokenizer_file": null,
|
49 |
+
"mask_token": "[MASK]",
|
50 |
+
"model_max_length": 256,
|
51 |
+
"never_split": null,
|
52 |
+
"pad_token": "[PAD]",
|
53 |
+
"sep_token": "[SEP]",
|
54 |
+
"strip_accents": null,
|
55 |
+
"tokenize_chinese_chars": true,
|
56 |
+
"tokenizer_class": "BertTokenizer",
|
57 |
+
"unk_token": "[UNK]"
|
58 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|