CoolFace
Modelpublic

codersan/FaLabseV13p2

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes68downloads
README.md380 linesDownload Raw Back to root
1---2tags:3- sentence-transformers4- sentence-similarity5- feature-extraction6- generated_from_trainer7- dataset_size:214848- loss:MultipleNegativesRankingLoss9base_model: codersan/FaLabseV13p110widget:11- source_sentence: زنی ماهی را سرخ می کند.12  sentences:13  - ماهی توسط زنی پخته می شود14  - در سال ۱۱۵۷ ق.م کوتیر-ناهوته حکمران ایلام برای گرفتن انتقام بابل را فتح میکند.15  - دو نفر سوار موتورسیکلت می شوند16- source_sentence: نرخ‌های بهره چگونه بر قرض‌گیری و سرمایه‌گذاری تأثیر می‌گذارند؟17  sentences:18  - چالش‌ها و تجربیات شخصی جی.K. رولینگ، از جمله مرگ مادرش، بر عمق احساسی و مضامین19    مجموعه 'هری پاتر' تأثیرگذار بود.20  - نرخ بهره می‌تواند تحت تأثیر تورم، رشد اقتصادی و سیاست‌های پولی قرار گیرد.21  - گروهی از مردم به لباس محافظتی مجهز نیستند22- source_sentence: 'شهرستان مدیسون، تگزاس (به انگلیسی: Madison County, Texas) یک سکونتگاه23    مسکونی در ایالات متحده آمریکا است که در تگزاس واقع شده‌است.'24  sentences:25  - شهرستان مدیسون در در ایالت تگزاس قرار دارد.26  - زنان  در حال پوشاندن گوش های بونی و شماره مسابقه هستند و به چیزی از دور اشاره27    می کنند28  - سوار در برف در حال دوچرخه سواری است و یک ژاکت قرمز پوشیده است29- source_sentence: خانواده ای خوشحال در کنار شومینه برای عکس ژست گرفته اند30  sentences:31  - مردی آنجا نیست که روی صندلی نشسته و چشم هایش را مالش دهد32  - آیا باید برای CAT به مربیگری بپیوندم؟33  - خانواده ای غمگین کنار شومینه ژست گرفته اند34- source_sentence: کودک جوان دارد اسکوتر سه چرخ را روبه پایین در پیاده رو می راند.35  sentences:36  - کتاب قابوس نامه اثر عنصرالمعالی کیکاووس بن اسکندر می باشد.37  - دو سگ بزرگ در چمن زار ورجه ورجه می‌کنند38  - کودک جوانی دارد اسکوتر سه چرخ را  روبه پایین در پیاده رو می راند.39pipeline_tag: sentence-similarity40library_name: sentence-transformers41---42 43# SentenceTransformer based on codersan/FaLabseV13p144 45This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [codersan/FaLabseV13p1](https://huggingface.co/codersan/FaLabseV13p1). 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.46 47## Model Details48 49### Model Description50- **Model Type:** Sentence Transformer51- **Base model:** [codersan/FaLabseV13p1](https://huggingface.co/codersan/FaLabseV13p1) <!-- at revision f3473ce8e1226d16e85793d8c2745391147e9e86 -->52- **Maximum Sequence Length:** 256 tokens53- **Output Dimensionality:** 768 dimensions54- **Similarity Function:** Cosine Similarity55<!-- - **Training Dataset:** Unknown -->56<!-- - **Language:** Unknown -->57<!-- - **License:** Unknown -->58 59### Model Sources60 61- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)62- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)63- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)64 65### Full Model Architecture66 67```68SentenceTransformer(69  (0): Transformer({'max_seq_length': 256, 'do_lower_case': False}) with Transformer model: BertModel 70  (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})71  (2): Dense({'in_features': 768, 'out_features': 768, 'bias': True, 'activation_function': 'torch.nn.modules.activation.Tanh'})72  (3): Normalize()73)74```75 76## Usage77 78### Direct Usage (Sentence Transformers)79 80First install the Sentence Transformers library:81 82```bash83pip install -U sentence-transformers84```85 86Then you can load this model and run inference.87```python88from sentence_transformers import SentenceTransformer89 90# Download from the 🤗 Hub91model = SentenceTransformer("codersan/FaLabseV13p2")92# Run inference93sentences = [94    'کودک جوان دارد اسکوتر سه چرخ را روبه پایین در پیاده رو می راند.',95    'کودک جوانی دارد اسکوتر سه چرخ را  روبه پایین در پیاده رو می راند.',96    'کتاب قابوس نامه اثر عنصرالمعالی کیکاووس بن اسکندر می باشد.',97]98embeddings = model.encode(sentences)99print(embeddings.shape)100# [3, 768]101 102# Get the similarity scores for the embeddings103similarities = model.similarity(embeddings, embeddings)104print(similarities.shape)105# [3, 3]106```107 108<!--109### Direct Usage (Transformers)110 111<details><summary>Click to see the direct usage in Transformers</summary>112 113</details>114-->115 116<!--117### Downstream Usage (Sentence Transformers)118 119You can finetune this model on your own dataset.120 121<details><summary>Click to expand</summary>122 123</details>124-->125 126<!--127### Out-of-Scope Use128 129*List how the model may foreseeably be misused and address what users ought not to do with the model.*130-->131 132<!--133## Bias, Risks and Limitations134 135*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*136-->137 138<!--139### Recommendations140 141*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*142-->143 144## Training Details145 146### Training Dataset147 148#### Unnamed Dataset149 150 151* Size: 21,484 training samples152* Columns: <code>anchor</code> and <code>positive</code>153* Approximate statistics based on the first 1000 samples:154  |         | anchor                                                                             | positive                                                                          |155  |:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|156  | type    | string                                                                             | string                                                                            |157  | details | <ul><li>min: 4 tokens</li><li>mean: 19.86 tokens</li><li>max: 106 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 19.49 tokens</li><li>max: 76 tokens</li></ul> |158* Samples:159  | anchor                                                                                                                                                                                                          | positive                                                                                                                                        |160  |:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------|161  | <code>کارگردان چگونه بر یک نمایش تئاتری تأثیر می‌گذارد؟</code>                                                                                                                                                  | <code>کارگردان نورپردازی و جلوه‌های صوتی را که در نمایش استفاده خواهد شد انتخاب می‌کند، که بر حال و هوا و جو اجرای نمایش تأثیر می‌گذارد.</code> |162  | <code>پیش از پیدایش شهر اراک گویش‌های متفاوتی در منطقه وجود داشت، اما با مهاجرت گروه‌های مختلف و ساکنان آن‌ها در شهر ترکیب خاصی از لهجه‌های مختلف به وجود آمد که امروزه به نام لهجه اراکی شناخته می‌شود.</code> | <code>لهجه اراکی ترکیبی از لهجه های مختلف است</code>                                                                                            |163  | <code>اهمیت تاریخی واتیکان چیست؟</code>                                                                                                                                                                         | <code>واتیکان مرکز روحانی و اداری کلیسای کاتولیک رومی است و برای قرن‌ها یک نهاد مذهبی و سیاسی مهم بوده است.</code>                              |164* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:165  ```json166  {167      "scale": 20.0,168      "similarity_fct": "cos_sim"169  }170  ```171 172### Training Hyperparameters173#### Non-Default Hyperparameters174 175- `per_device_train_batch_size`: 32176- `learning_rate`: 2e-05177- `weight_decay`: 0.01178- `batch_sampler`: no_duplicates179 180#### All Hyperparameters181<details><summary>Click to expand</summary>182 183- `overwrite_output_dir`: False184- `do_predict`: False185- `eval_strategy`: no186- `prediction_loss_only`: True187- `per_device_train_batch_size`: 32188- `per_device_eval_batch_size`: 8189- `per_gpu_train_batch_size`: None190- `per_gpu_eval_batch_size`: None191- `gradient_accumulation_steps`: 1192- `eval_accumulation_steps`: None193- `torch_empty_cache_steps`: None194- `learning_rate`: 2e-05195- `weight_decay`: 0.01196- `adam_beta1`: 0.9197- `adam_beta2`: 0.999198- `adam_epsilon`: 1e-08199- `max_grad_norm`: 1200- `num_train_epochs`: 3201- `max_steps`: -1202- `lr_scheduler_type`: linear203- `lr_scheduler_kwargs`: {}204- `warmup_ratio`: 0.0205- `warmup_steps`: 0206- `log_level`: passive207- `log_level_replica`: warning208- `log_on_each_node`: True209- `logging_nan_inf_filter`: True210- `save_safetensors`: True211- `save_on_each_node`: False212- `save_only_model`: False213- `restore_callback_states_from_checkpoint`: False214- `no_cuda`: False215- `use_cpu`: False216- `use_mps_device`: False217- `seed`: 42218- `data_seed`: None219- `jit_mode_eval`: False220- `use_ipex`: False221- `bf16`: False222- `fp16`: False223- `fp16_opt_level`: O1224- `half_precision_backend`: auto225- `bf16_full_eval`: False226- `fp16_full_eval`: False227- `tf32`: None228- `local_rank`: 0229- `ddp_backend`: None230- `tpu_num_cores`: None231- `tpu_metrics_debug`: False232- `debug`: []233- `dataloader_drop_last`: False234- `dataloader_num_workers`: 0235- `dataloader_prefetch_factor`: None236- `past_index`: -1237- `disable_tqdm`: False238- `remove_unused_columns`: True239- `label_names`: None240- `load_best_model_at_end`: False241- `ignore_data_skip`: False242- `fsdp`: []243- `fsdp_min_num_params`: 0244- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}245- `fsdp_transformer_layer_cls_to_wrap`: None246- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}247- `deepspeed`: None248- `label_smoothing_factor`: 0.0249- `optim`: adamw_torch250- `optim_args`: None251- `adafactor`: False252- `group_by_length`: False253- `length_column_name`: length254- `ddp_find_unused_parameters`: None255- `ddp_bucket_cap_mb`: None256- `ddp_broadcast_buffers`: False257- `dataloader_pin_memory`: True258- `dataloader_persistent_workers`: False259- `skip_memory_metrics`: True260- `use_legacy_prediction_loop`: False261- `push_to_hub`: False262- `resume_from_checkpoint`: None263- `hub_model_id`: None264- `hub_strategy`: every_save265- `hub_private_repo`: None266- `hub_always_push`: False267- `gradient_checkpointing`: False268- `gradient_checkpointing_kwargs`: None269- `include_inputs_for_metrics`: False270- `include_for_metrics`: []271- `eval_do_concat_batches`: True272- `fp16_backend`: auto273- `push_to_hub_model_id`: None274- `push_to_hub_organization`: None275- `mp_parameters`: 276- `auto_find_batch_size`: False277- `full_determinism`: False278- `torchdynamo`: None279- `ray_scope`: last280- `ddp_timeout`: 1800281- `torch_compile`: False282- `torch_compile_backend`: None283- `torch_compile_mode`: None284- `dispatch_batches`: None285- `split_batches`: None286- `include_tokens_per_second`: False287- `include_num_input_tokens_seen`: False288- `neftune_noise_alpha`: None289- `optim_target_modules`: None290- `batch_eval_metrics`: False291- `eval_on_start`: False292- `use_liger_kernel`: False293- `eval_use_gather_object`: False294- `average_tokens_across_devices`: False295- `prompts`: None296- `batch_sampler`: no_duplicates297- `multi_dataset_batch_sampler`: proportional298 299</details>300 301### Training Logs302| Epoch  | Step | Training Loss |303|:------:|:----:|:-------------:|304| 0.1488 | 100  | 0.1393        |305| 0.2976 | 200  | 0.1129        |306| 0.4464 | 300  | 0.0747        |307| 0.5952 | 400  | 0.0851        |308| 0.7440 | 500  | 0.0871        |309| 0.8929 | 600  | 0.079         |310| 1.0417 | 700  | 0.0785        |311| 1.1905 | 800  | 0.0362        |312| 1.3393 | 900  | 0.0258        |313| 1.4881 | 1000 | 0.0164        |314| 1.6369 | 1100 | 0.0254        |315| 1.7857 | 1200 | 0.0266        |316| 1.9345 | 1300 | 0.0266        |317| 2.0833 | 1400 | 0.0212        |318| 2.2321 | 1500 | 0.0142        |319| 2.3810 | 1600 | 0.0102        |320| 2.5298 | 1700 | 0.0093        |321| 2.6786 | 1800 | 0.0136        |322| 2.8274 | 1900 | 0.0118        |323| 2.9762 | 2000 | 0.0122        |324 325 326### Framework Versions327- Python: 3.10.12328- Sentence Transformers: 3.3.1329- Transformers: 4.47.0330- PyTorch: 2.5.1+cu121331- Accelerate: 1.2.1332- Datasets: 4.0.0333- Tokenizers: 0.21.0334 335## Citation336 337### BibTeX338 339#### Sentence Transformers340```bibtex341@inproceedings{reimers-2019-sentence-bert,342    title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",343    author = "Reimers, Nils and Gurevych, Iryna",344    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",345    month = "11",346    year = "2019",347    publisher = "Association for Computational Linguistics",348    url = "https://arxiv.org/abs/1908.10084",349}350```351 352#### MultipleNegativesRankingLoss353```bibtex354@misc{henderson2017efficient,355    title={Efficient Natural Language Response Suggestion for Smart Reply},356    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},357    year={2017},358    eprint={1705.00652},359    archivePrefix={arXiv},360    primaryClass={cs.CL}361}362```363 364<!--365## Glossary366 367*Clearly define terms in order to be accessible across audiences.*368-->369 370<!--371## Model Card Authors372 373*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*374-->375 376<!--377## Model Card Contact378 379*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*380-->