HasinMDG commited on
Commit
1c64875
1 Parent(s): e3a928d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +2 -376
README.md CHANGED
@@ -1,376 +1,2 @@
1
- ---
2
- language: []
3
- library_name: sentence-transformers
4
- tags:
5
- - sentence-transformers
6
- - sentence-similarity
7
- - feature-extraction
8
- - generated_from_trainer
9
- - dataset_size:2054
10
- - loss:ContrastiveLoss
11
- base_model: intfloat/multilingual-e5-large
12
- datasets: []
13
- widget:
14
- - source_sentence: 2021 parliament elections
15
- sentences:
16
- - Wolaita people
17
- - 2023 General Elections
18
- - government forces
19
- - source_sentence: Atiku Abubakar
20
- sentences:
21
- - president of Nigeria
22
- - military juntas
23
- - Federal Government
24
- - source_sentence: Election
25
- sentences:
26
- - Tomorrow's election in Nigeria
27
- - Election
28
- - Public hospital
29
- - source_sentence: Ethiopian government
30
- sentences:
31
- - President E.D Mnangagwa
32
- - Sanction on Ethiopia
33
- - Dino Melaye
34
- - source_sentence: International community
35
- sentences:
36
- - Real-time vote tallying technology
37
- - Western interference in Ethiopia
38
- - International community
39
- pipeline_tag: sentence-similarity
40
- ---
41
-
42
- # SentenceTransformer based on intfloat/multilingual-e5-large
43
-
44
- This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [intfloat/multilingual-e5-large](https://huggingface.co/intfloat/multilingual-e5-large). 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.
45
-
46
- ## Model Details
47
-
48
- ### Model Description
49
- - **Model Type:** Sentence Transformer
50
- - **Base model:** [intfloat/multilingual-e5-large](https://huggingface.co/intfloat/multilingual-e5-large) <!-- at revision ab10c1a7f42e74530fe7ae5be82e6d4f11a719eb -->
51
- - **Maximum Sequence Length:** 512 tokens
52
- - **Output Dimensionality:** 1024 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': 512, 'do_lower_case': False}) with Transformer model: XLMRobertaModel
69
- (1): Pooling({'word_embedding_dimension': 1024, '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("sentence_transformers_model_id")
90
- # Run inference
91
- sentences = [
92
- 'International community',
93
- 'International community',
94
- 'Western interference in Ethiopia',
95
- ]
96
- embeddings = model.encode(sentences)
97
- print(embeddings.shape)
98
- # [3, 1024]
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: 2,054 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: 3 tokens</li><li>mean: 5.74 tokens</li><li>max: 18 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 5.86 tokens</li><li>max: 18 tokens</li></ul> | <ul><li>0: ~60.20%</li><li>1: ~39.80%</li></ul> |
156
- * Samples:
157
- | sentence1 | sentence2 | label |
158
- |:-----------------------------------------------|:------------------------------------|:---------------|
159
- | <code>Nigerian people</code> | <code>Nigerian people</code> | <code>1</code> |
160
- | <code>EFF</code> | <code>EFF</code> | <code>1</code> |
161
- | <code>Public strikes and demonstrations</code> | <code>violent demonstrations</code> | <code>0</code> |
162
- * Loss: [<code>ContrastiveLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#contrastiveloss) with these parameters:
163
- ```json
164
- {
165
- "distance_metric": "SiameseDistanceMetric.COSINE_DISTANCE",
166
- "margin": 0.5,
167
- "size_average": true
168
- }
169
- ```
170
-
171
- ### Evaluation Dataset
172
-
173
- #### Unnamed Dataset
174
-
175
-
176
- * Size: 514 evaluation samples
177
- * Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>label</code>
178
- * Approximate statistics based on the first 1000 samples:
179
- | | sentence1 | sentence2 | label |
180
- |:--------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:------------------------------------------------|
181
- | type | string | string | int |
182
- | details | <ul><li>min: 3 tokens</li><li>mean: 5.74 tokens</li><li>max: 22 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 5.93 tokens</li><li>max: 22 tokens</li></ul> | <ul><li>0: ~59.92%</li><li>1: ~40.08%</li></ul> |
183
- * Samples:
184
- | sentence1 | sentence2 | label |
185
- |:------------------------------------------|:------------------------------------------|:---------------|
186
- | <code>military base in Namibia</code> | <code>US military bases in Africa</code> | <code>0</code> |
187
- | <code>Putin's authoritarian regime</code> | <code>Putin's authoritarian regime</code> | <code>1</code> |
188
- | <code>Election Day</code> | <code>Elections</code> | <code>1</code> |
189
- * Loss: [<code>ContrastiveLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#contrastiveloss) with these parameters:
190
- ```json
191
- {
192
- "distance_metric": "SiameseDistanceMetric.COSINE_DISTANCE",
193
- "margin": 0.5,
194
- "size_average": true
195
- }
196
- ```
197
-
198
- ### Training Hyperparameters
199
-
200
- #### All Hyperparameters
201
- <details><summary>Click to expand</summary>
202
-
203
- - `overwrite_output_dir`: False
204
- - `do_predict`: False
205
- - `eval_strategy`: no
206
- - `prediction_loss_only`: True
207
- - `per_device_train_batch_size`: 8
208
- - `per_device_eval_batch_size`: 8
209
- - `per_gpu_train_batch_size`: None
210
- - `per_gpu_eval_batch_size`: None
211
- - `gradient_accumulation_steps`: 1
212
- - `eval_accumulation_steps`: None
213
- - `learning_rate`: 5e-05
214
- - `weight_decay`: 0.0
215
- - `adam_beta1`: 0.9
216
- - `adam_beta2`: 0.999
217
- - `adam_epsilon`: 1e-08
218
- - `max_grad_norm`: 1.0
219
- - `num_train_epochs`: 3.0
220
- - `max_steps`: -1
221
- - `lr_scheduler_type`: linear
222
- - `lr_scheduler_kwargs`: {}
223
- - `warmup_ratio`: 0.0
224
- - `warmup_steps`: 0
225
- - `log_level`: passive
226
- - `log_level_replica`: warning
227
- - `log_on_each_node`: True
228
- - `logging_nan_inf_filter`: True
229
- - `save_safetensors`: True
230
- - `save_on_each_node`: False
231
- - `save_only_model`: False
232
- - `restore_callback_states_from_checkpoint`: False
233
- - `no_cuda`: False
234
- - `use_cpu`: False
235
- - `use_mps_device`: False
236
- - `seed`: 42
237
- - `data_seed`: None
238
- - `jit_mode_eval`: False
239
- - `use_ipex`: False
240
- - `bf16`: False
241
- - `fp16`: False
242
- - `fp16_opt_level`: O1
243
- - `half_precision_backend`: auto
244
- - `bf16_full_eval`: False
245
- - `fp16_full_eval`: False
246
- - `tf32`: None
247
- - `local_rank`: 0
248
- - `ddp_backend`: None
249
- - `tpu_num_cores`: None
250
- - `tpu_metrics_debug`: False
251
- - `debug`: []
252
- - `dataloader_drop_last`: False
253
- - `dataloader_num_workers`: 0
254
- - `dataloader_prefetch_factor`: None
255
- - `past_index`: -1
256
- - `disable_tqdm`: False
257
- - `remove_unused_columns`: True
258
- - `label_names`: None
259
- - `load_best_model_at_end`: False
260
- - `ignore_data_skip`: False
261
- - `fsdp`: []
262
- - `fsdp_min_num_params`: 0
263
- - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
264
- - `fsdp_transformer_layer_cls_to_wrap`: None
265
- - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
266
- - `deepspeed`: None
267
- - `label_smoothing_factor`: 0.0
268
- - `optim`: adamw_torch
269
- - `optim_args`: None
270
- - `adafactor`: False
271
- - `group_by_length`: False
272
- - `length_column_name`: length
273
- - `ddp_find_unused_parameters`: None
274
- - `ddp_bucket_cap_mb`: None
275
- - `ddp_broadcast_buffers`: False
276
- - `dataloader_pin_memory`: True
277
- - `dataloader_persistent_workers`: False
278
- - `skip_memory_metrics`: True
279
- - `use_legacy_prediction_loop`: False
280
- - `push_to_hub`: False
281
- - `resume_from_checkpoint`: None
282
- - `hub_model_id`: None
283
- - `hub_strategy`: every_save
284
- - `hub_private_repo`: False
285
- - `hub_always_push`: False
286
- - `gradient_checkpointing`: False
287
- - `gradient_checkpointing_kwargs`: None
288
- - `include_inputs_for_metrics`: False
289
- - `eval_do_concat_batches`: True
290
- - `fp16_backend`: auto
291
- - `push_to_hub_model_id`: None
292
- - `push_to_hub_organization`: None
293
- - `mp_parameters`:
294
- - `auto_find_batch_size`: False
295
- - `full_determinism`: False
296
- - `torchdynamo`: None
297
- - `ray_scope`: last
298
- - `ddp_timeout`: 1800
299
- - `torch_compile`: False
300
- - `torch_compile_backend`: None
301
- - `torch_compile_mode`: None
302
- - `dispatch_batches`: None
303
- - `split_batches`: None
304
- - `include_tokens_per_second`: False
305
- - `include_num_input_tokens_seen`: False
306
- - `neftune_noise_alpha`: None
307
- - `optim_target_modules`: None
308
- - `batch_eval_metrics`: False
309
- - `batch_sampler`: batch_sampler
310
- - `multi_dataset_batch_sampler`: proportional
311
-
312
- </details>
313
-
314
- ### Training Logs
315
- | Epoch | Step | Training Loss |
316
- |:------:|:----:|:-------------:|
317
- | 1.9455 | 500 | 0.0161 |
318
-
319
-
320
- ### Framework Versions
321
- - Python: 3.10.13
322
- - Sentence Transformers: 3.0.1
323
- - Transformers: 4.41.2
324
- - PyTorch: 2.1.2
325
- - Accelerate: 0.30.1
326
- - Datasets: 2.19.2
327
- - Tokenizers: 0.19.1
328
-
329
- ## Citation
330
-
331
- ### BibTeX
332
-
333
- #### Sentence Transformers
334
- ```bibtex
335
- @inproceedings{reimers-2019-sentence-bert,
336
- title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
337
- author = "Reimers, Nils and Gurevych, Iryna",
338
- booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
339
- month = "11",
340
- year = "2019",
341
- publisher = "Association for Computational Linguistics",
342
- url = "https://arxiv.org/abs/1908.10084",
343
- }
344
- ```
345
-
346
- #### ContrastiveLoss
347
- ```bibtex
348
- @inproceedings{hadsell2006dimensionality,
349
- author={Hadsell, R. and Chopra, S. and LeCun, Y.},
350
- booktitle={2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'06)},
351
- title={Dimensionality Reduction by Learning an Invariant Mapping},
352
- year={2006},
353
- volume={2},
354
- number={},
355
- pages={1735-1742},
356
- doi={10.1109/CVPR.2006.100}
357
- }
358
- ```
359
-
360
- <!--
361
- ## Glossary
362
-
363
- *Clearly define terms in order to be accessible across audiences.*
364
- -->
365
-
366
- <!--
367
- ## Model Card Authors
368
-
369
- *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
370
- -->
371
-
372
- <!--
373
- ## Model Card Contact
374
-
375
- *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
376
- -->
 
1
+ # NED model
2
+ Mulitilingual E5 model designed for NED