CoolFace
Modelpublic

codersan/e5Fa_small_v1_phase2

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes10downloads
README.md378 linesDownload Raw Back to root
1---2tags:3- sentence-transformers4- sentence-similarity5- feature-extraction6- generated_from_trainer7- dataset_size:120008- loss:CosineSimilarityLoss9- loss:MultipleNegativesRankingLoss10base_model: intfloat/multilingual-e5-small11widget:12- source_sentence: تفاوت‌های کلیدی بین موتورهای دیزلی و بنزینی چیست؟13  sentences:14  - یک VPN یا شبکه خصوصی مجازی، ارتباط اینترنتی شما را رمزنگاری کرده و آن را از طریق15    یک سرور در مکانی که خودتان انتخاب کرده‌اید هدایت می‌کند و حفظ حریم خصوصی و امنیت16    را فراهم می‌آورد.17  - طراحان صدا روی عناصر صوتی یک فیلم کار می‌کنند، از جمله افکت‌های صوتی و دیالوگ.18  - سوخت دیزل چگال‌تر است و انرژی بیشتری در هر گالن نسبت به بنزین دارد.19- source_sentence: ماده تاریک چیست؟20  sentences:21  - مطالعه موجودات بیلومینسانس می‌تواند به بهبود درک ما از فرآیندهای سلولی کمک کند.22  - رِف بزرگ مرجانی بزرگترین سیستم مرجانی جهان است که در استرالیا واقع شده است.23  - بسیاری از دانشمندان در حال انجام آزمایش‌هایی برای شناسایی مستقیم ذرات ماده تاریک24    هستند.25- source_sentence: کشاورزی دقیق چه معنایی دارد؟26  sentences:27  - پستانداران با وجود غده‌های شیری مشخص می‌شوند که شیر تولید می‌کنند تا فرزندان خود28    را تغذیه کنند و معمولاً دارای مو یا پشم هستند.29  - در حالی که آنتی‌بیوتیک‌ها برای درمان عفونت‌های باکتریایی استفاده می‌شوند، آنها30    در برابر عفونت‌های ویروسی مانند سرماخوردگی یا آنفولانزا بی‌اثر هستند.31  - کشاورزان از کشاورزی دقیق استفاده می‌کنند تا تصمیمات بهتری درباره کاشت، کوددهی32    و برداشت محصولات بگیرند.33- source_sentence: کشف رنگ تغییر می‌دهد؟34  sentences:35  - داسته‌زبان‌ها نوعی از مارمولک‌ها هستند که در بخش‌های مختلف جهان یافت می‌شوند.36  - استفاده از مالچ برای پوشاندن خاک می‌تواند به حفظ رطوبت کمک کرده و نیاز به آبیاری37    مکرر را کاهش دهد.38  - در حین همجوشی باکتریایی، یک سلول اهداکننده DNA را از طریق پیلاسی که ساختاری شبیه39    به پل است به یک سلول گیرنده منتقل می‌کند.40- source_sentence: مصریان باستان چگونه هرم‌ها را ساختند؟41  sentences:42  - جنگ سرد بر توسعه سازمان‌های بین‌المللی که به حفظ صلح و امنیت می‌پردازند، تأثیر43    گذاشت.44  - مزایای بیکاری بین کشورها به طور وسیعی متفاوت است، به طوری که برخی از آنها حمایت45    بیشتری نسبت به دیگران ارائه می‌دهند.46  - هرمی‌ها به عنوان مقبره‌هایی برای فراعنه ساخته شدند و هدف از آن‌ها تأمین عبور ایمن47    آن‌ها به زندگی پس از مرگ بود.48pipeline_tag: sentence-similarity49library_name: sentence-transformers50---51 52# SentenceTransformer based on intfloat/multilingual-e5-small53 54This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [intfloat/multilingual-e5-small](https://huggingface.co/intfloat/multilingual-e5-small). 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.55 56## Model Details57 58### Model Description59- **Model Type:** Sentence Transformer60- **Base model:** [intfloat/multilingual-e5-small](https://huggingface.co/intfloat/multilingual-e5-small) <!-- at revision c007d7ef6fd86656326059b28395a7a03a7c5846 -->61- **Maximum Sequence Length:** 512 tokens62- **Output Dimensionality:** 384 dimensions63- **Similarity Function:** Cosine Similarity64<!-- - **Training Dataset:** Unknown -->65<!-- - **Language:** Unknown -->66<!-- - **License:** Unknown -->67 68### Model Sources69 70- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)71- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)72- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)73 74### Full Model Architecture75 76```77SentenceTransformer(78  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel 79  (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})80  (2): Normalize()81)82```83 84## Usage85 86### Direct Usage (Sentence Transformers)87 88First install the Sentence Transformers library:89 90```bash91pip install -U sentence-transformers92```93 94Then you can load this model and run inference.95```python96from sentence_transformers import SentenceTransformer97 98# Download from the 🤗 Hub99model = SentenceTransformer("codersan/e5Fa_small_v1_phase2")100# Run inference101sentences = [102    'مصریان باستان چگونه هرم\u200cها را ساختند؟',103    'هرمی\u200cها به عنوان مقبره\u200cهایی برای فراعنه ساخته شدند و هدف از آن\u200cها تأمین عبور ایمن آن\u200cها به زندگی پس از مرگ بود.',104    'مزایای بیکاری بین کشورها به طور وسیعی متفاوت است، به طوری که برخی از آنها حمایت بیشتری نسبت به دیگران ارائه می\u200cدهند.',105]106embeddings = model.encode(sentences)107print(embeddings.shape)108# [3, 384]109 110# Get the similarity scores for the embeddings111similarities = model.similarity(embeddings, embeddings)112print(similarities.shape)113# [3, 3]114```115 116<!--117### Direct Usage (Transformers)118 119<details><summary>Click to see the direct usage in Transformers</summary>120 121</details>122-->123 124<!--125### Downstream Usage (Sentence Transformers)126 127You can finetune this model on your own dataset.128 129<details><summary>Click to expand</summary>130 131</details>132-->133 134<!--135### Out-of-Scope Use136 137*List how the model may foreseeably be misused and address what users ought not to do with the model.*138-->139 140<!--141## Bias, Risks and Limitations142 143*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*144-->145 146<!--147### Recommendations148 149*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*150-->151 152## Training Details153 154### Training Dataset155 156#### Unnamed Dataset157 158 159* Size: 12,000 training samples160* Columns: <code>anchor</code> and <code>positive</code>161* Approximate statistics based on the first 1000 samples:162  |         | anchor                                                                            | positive                                                                          |163  |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|164  | type    | string                                                                            | string                                                                            |165  | details | <ul><li>min: 3 tokens</li><li>mean: 23.7 tokens</li><li>max: 113 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 17.04 tokens</li><li>max: 75 tokens</li></ul> |166* Samples:167  | anchor                                                    | positive                                                 |168  |:----------------------------------------------------------|:---------------------------------------------------------|169  | <code>آدمهایی هستند که وقتی خوشحالی کنارت نیستند؟</code>  | <code>یک آدمهایی هستند که وقتی شادی کنارت نیستند؟</code> |170  | <code>گله گوزن ها از جاده عبور نمی کنند</code>            | <code>یک گله از گوزن ها  از خیابان عبور می کنند</code>   |171  | <code>هیچ مردی روی مسواک خم نمی‌شود و عکس نمی‌گیرد</code> | <code>یک مرد خم می‌شود و دوربینی را نگه می‌دارد</code>   |172* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:173  ```json174  {175      "scale": 20.0,176      "similarity_fct": "cos_sim"177  }178  ```179 180### Training Hyperparameters181#### Non-Default Hyperparameters182 183- `per_device_train_batch_size`: 64184- `learning_rate`: 2e-05185- `weight_decay`: 0.01186- `num_train_epochs`: 2187- `batch_sampler`: no_duplicates188 189#### All Hyperparameters190<details><summary>Click to expand</summary>191 192- `overwrite_output_dir`: False193- `do_predict`: False194- `eval_strategy`: no195- `prediction_loss_only`: True196- `per_device_train_batch_size`: 64197- `per_device_eval_batch_size`: 8198- `per_gpu_train_batch_size`: None199- `per_gpu_eval_batch_size`: None200- `gradient_accumulation_steps`: 1201- `eval_accumulation_steps`: None202- `torch_empty_cache_steps`: None203- `learning_rate`: 2e-05204- `weight_decay`: 0.01205- `adam_beta1`: 0.9206- `adam_beta2`: 0.999207- `adam_epsilon`: 1e-08208- `max_grad_norm`: 1209- `num_train_epochs`: 2210- `max_steps`: -1211- `lr_scheduler_type`: linear212- `lr_scheduler_kwargs`: {}213- `warmup_ratio`: 0.0214- `warmup_steps`: 0215- `log_level`: passive216- `log_level_replica`: warning217- `log_on_each_node`: True218- `logging_nan_inf_filter`: True219- `save_safetensors`: True220- `save_on_each_node`: False221- `save_only_model`: False222- `restore_callback_states_from_checkpoint`: False223- `no_cuda`: False224- `use_cpu`: False225- `use_mps_device`: False226- `seed`: 42227- `data_seed`: None228- `jit_mode_eval`: False229- `use_ipex`: False230- `bf16`: False231- `fp16`: False232- `fp16_opt_level`: O1233- `half_precision_backend`: auto234- `bf16_full_eval`: False235- `fp16_full_eval`: False236- `tf32`: None237- `local_rank`: 0238- `ddp_backend`: None239- `tpu_num_cores`: None240- `tpu_metrics_debug`: False241- `debug`: []242- `dataloader_drop_last`: False243- `dataloader_num_workers`: 0244- `dataloader_prefetch_factor`: None245- `past_index`: -1246- `disable_tqdm`: False247- `remove_unused_columns`: True248- `label_names`: None249- `load_best_model_at_end`: False250- `ignore_data_skip`: False251- `fsdp`: []252- `fsdp_min_num_params`: 0253- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}254- `fsdp_transformer_layer_cls_to_wrap`: None255- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}256- `deepspeed`: None257- `label_smoothing_factor`: 0.0258- `optim`: adamw_torch259- `optim_args`: None260- `adafactor`: False261- `group_by_length`: False262- `length_column_name`: length263- `ddp_find_unused_parameters`: None264- `ddp_bucket_cap_mb`: None265- `ddp_broadcast_buffers`: False266- `dataloader_pin_memory`: True267- `dataloader_persistent_workers`: False268- `skip_memory_metrics`: True269- `use_legacy_prediction_loop`: False270- `push_to_hub`: False271- `resume_from_checkpoint`: None272- `hub_model_id`: None273- `hub_strategy`: every_save274- `hub_private_repo`: None275- `hub_always_push`: False276- `gradient_checkpointing`: False277- `gradient_checkpointing_kwargs`: None278- `include_inputs_for_metrics`: False279- `include_for_metrics`: []280- `eval_do_concat_batches`: True281- `fp16_backend`: auto282- `push_to_hub_model_id`: None283- `push_to_hub_organization`: None284- `mp_parameters`: 285- `auto_find_batch_size`: False286- `full_determinism`: False287- `torchdynamo`: None288- `ray_scope`: last289- `ddp_timeout`: 1800290- `torch_compile`: False291- `torch_compile_backend`: None292- `torch_compile_mode`: None293- `dispatch_batches`: None294- `split_batches`: None295- `include_tokens_per_second`: False296- `include_num_input_tokens_seen`: False297- `neftune_noise_alpha`: None298- `optim_target_modules`: None299- `batch_eval_metrics`: False300- `eval_on_start`: False301- `use_liger_kernel`: False302- `eval_use_gather_object`: False303- `average_tokens_across_devices`: False304- `prompts`: None305- `batch_sampler`: no_duplicates306- `multi_dataset_batch_sampler`: proportional307 308</details>309 310### Training Logs311| Epoch  | Step | Training Loss |312|:------:|:----:|:-------------:|313| 0.5319 | 100  | 0.0535        |314| 1.0638 | 200  | 0.0364        |315| 1.5957 | 300  | 0.032         |316| 2.1277 | 400  | 0.0306        |317| 2.6596 | 500  | 0.0282        |318| 0.4098 | 100  | 0.2321        |319| 0.8197 | 200  | 0.154         |320| 1.2295 | 300  | 0.1436        |321| 1.6393 | 400  | 0.1118        |322 323 324### Framework Versions325- Python: 3.10.12326- Sentence Transformers: 3.3.1327- Transformers: 4.47.0328- PyTorch: 2.5.1+cu121329- Accelerate: 1.2.1330- Datasets: 4.0.0331- Tokenizers: 0.21.0332 333## Citation334 335### BibTeX336 337#### Sentence Transformers338```bibtex339@inproceedings{reimers-2019-sentence-bert,340    title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",341    author = "Reimers, Nils and Gurevych, Iryna",342    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",343    month = "11",344    year = "2019",345    publisher = "Association for Computational Linguistics",346    url = "https://arxiv.org/abs/1908.10084",347}348```349 350#### MultipleNegativesRankingLoss351```bibtex352@misc{henderson2017efficient,353    title={Efficient Natural Language Response Suggestion for Smart Reply},354    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},355    year={2017},356    eprint={1705.00652},357    archivePrefix={arXiv},358    primaryClass={cs.CL}359}360```361 362<!--363## Glossary364 365*Clearly define terms in order to be accessible across audiences.*366-->367 368<!--369## Model Card Authors370 371*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*372-->373 374<!--375## Model Card Contact376 377*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*378-->