--- tags: - sentence-transformers - sentence-similarity - feature-extraction - generated_from_trainer - dataset_size:68828 - loss:MultipleNegativesRankingLoss base_model: sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 widget: - source_sentence: Men is de toegangssleutels verloren sentences: - De centrale verwarming - niet dringend - Weg - source_sentence: De bovenste constructie sentences: - Voldoende warm water in de hele woning - daklekkage - lek in kraan - source_sentence: De box in het souterrain sentences: - Vloer - lift niet - Nood uitgang - source_sentence: balkon sentences: - de brievenbus - uitgang garage dicht - afvoer de douche - source_sentence: De deur naar de kelderboxen is stuk sentences: - deur met dranger - De beugel om de plek vrij te houden - kelderboxen deur pipeline_tag: sentence-similarity library_name: sentence-transformers metrics: - cosine_accuracy - cosine_accuracy_threshold - cosine_f1 - cosine_f1_threshold - cosine_precision - cosine_recall - cosine_ap - cosine_mcc model-index: - name: SentenceTransformer based on sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 results: - task: type: binary-classification name: Binary Classification dataset: name: Unknown type: unknown metrics: - type: cosine_accuracy value: 0.982086820083682 name: Cosine Accuracy - type: cosine_accuracy_threshold value: 0.733125627040863 name: Cosine Accuracy Threshold - type: cosine_f1 value: 0.9821498371335505 name: Cosine F1 - type: cosine_f1_threshold value: 0.733125627040863 name: Cosine F1 Threshold - type: cosine_precision value: 0.9787068293949623 name: Cosine Precision - type: cosine_recall value: 0.9856171548117155 name: Cosine Recall - type: cosine_ap value: 0.9972864020390366 name: Cosine Ap - type: cosine_mcc value: 0.964197674565882 name: Cosine Mcc --- # SentenceTransformer based on sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2](https://huggingface.co/sentence-transformers/paraphrase-multilingual-MiniLM-L12-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. ## Model Details ### Model Description - **Model Type:** Sentence Transformer - **Base model:** [sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2](https://huggingface.co/sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2) - **Maximum Sequence Length:** 64 tokens - **Output Dimensionality:** 384 dimensions - **Similarity Function:** Cosine Similarity ### Model Sources - **Documentation:** [Sentence Transformers Documentation](https://sbert.net) - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers) - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers) ### Full Model Architecture ``` SentenceTransformer( (0): Transformer({'max_seq_length': 64, 'do_lower_case': False}) with Transformer model: BertModel (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}) ) ``` ## Usage ### Direct Usage (Sentence Transformers) First install the Sentence Transformers library: ```bash pip install -U sentence-transformers ``` Then you can load this model and run inference. ```python from sentence_transformers import SentenceTransformer # Download from the 🤗 Hub model = SentenceTransformer("PrabalAryal/Sentence_Transformer_v0.0.4") # Run inference sentences = [ 'De deur naar de kelderboxen is stuk', 'kelderboxen deur', 'deur met dranger', ] embeddings = model.encode(sentences) print(embeddings.shape) # [3, 384] # Get the similarity scores for the embeddings similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] ``` ## Evaluation ### Metrics #### Binary Classification * Evaluated with [BinaryClassificationEvaluator](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.BinaryClassificationEvaluator) | Metric | Value | |:--------------------------|:-----------| | cosine_accuracy | 0.9821 | | cosine_accuracy_threshold | 0.7331 | | cosine_f1 | 0.9821 | | cosine_f1_threshold | 0.7331 | | cosine_precision | 0.9787 | | cosine_recall | 0.9856 | | **cosine_ap** | **0.9973** | | cosine_mcc | 0.9642 | ## Training Details ### Training Dataset #### Unnamed Dataset * Size: 68,828 training samples * Columns: sentence_0, sentence_1, and label * Approximate statistics based on the first 1000 samples: | | sentence_0 | sentence_1 | label | |:--------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------| | type | string | string | float | | details | | | | * Samples: | sentence_0 | sentence_1 | label | |:------------------------------------------------------|:-------------------------|:-----------------| | De sluiting van de toegangspoort is stuk | slot defect | 1.0 | | Woning | trapafgang | 0.0 | | De sleutels zijn kwijt | Nie | 0.0 | * Loss: [MultipleNegativesRankingLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters: ```json { "scale": 20.0, "similarity_fct": "cos_sim" } ``` ### Training Hyperparameters #### Non-Default Hyperparameters - `eval_strategy`: steps - `per_device_train_batch_size`: 64 - `per_device_eval_batch_size`: 64 - `num_train_epochs`: 10 - `fp16`: True - `multi_dataset_batch_sampler`: round_robin #### All Hyperparameters
Click to expand - `overwrite_output_dir`: False - `do_predict`: False - `eval_strategy`: steps - `prediction_loss_only`: True - `per_device_train_batch_size`: 64 - `per_device_eval_batch_size`: 64 - `per_gpu_train_batch_size`: None - `per_gpu_eval_batch_size`: None - `gradient_accumulation_steps`: 1 - `eval_accumulation_steps`: None - `torch_empty_cache_steps`: None - `learning_rate`: 5e-05 - `weight_decay`: 0.0 - `adam_beta1`: 0.9 - `adam_beta2`: 0.999 - `adam_epsilon`: 1e-08 - `max_grad_norm`: 1 - `num_train_epochs`: 10 - `max_steps`: -1 - `lr_scheduler_type`: linear - `lr_scheduler_kwargs`: {} - `warmup_ratio`: 0.0 - `warmup_steps`: 0 - `log_level`: passive - `log_level_replica`: warning - `log_on_each_node`: True - `logging_nan_inf_filter`: True - `save_safetensors`: True - `save_on_each_node`: False - `save_only_model`: False - `restore_callback_states_from_checkpoint`: False - `no_cuda`: False - `use_cpu`: False - `use_mps_device`: False - `seed`: 42 - `data_seed`: None - `jit_mode_eval`: False - `use_ipex`: False - `bf16`: False - `fp16`: True - `fp16_opt_level`: O1 - `half_precision_backend`: auto - `bf16_full_eval`: False - `fp16_full_eval`: False - `tf32`: None - `local_rank`: 0 - `ddp_backend`: None - `tpu_num_cores`: None - `tpu_metrics_debug`: False - `debug`: [] - `dataloader_drop_last`: False - `dataloader_num_workers`: 0 - `dataloader_prefetch_factor`: None - `past_index`: -1 - `disable_tqdm`: False - `remove_unused_columns`: True - `label_names`: None - `load_best_model_at_end`: False - `ignore_data_skip`: False - `fsdp`: [] - `fsdp_min_num_params`: 0 - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False} - `fsdp_transformer_layer_cls_to_wrap`: None - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None} - `deepspeed`: None - `label_smoothing_factor`: 0.0 - `optim`: adamw_torch - `optim_args`: None - `adafactor`: False - `group_by_length`: False - `length_column_name`: length - `ddp_find_unused_parameters`: None - `ddp_bucket_cap_mb`: None - `ddp_broadcast_buffers`: False - `dataloader_pin_memory`: True - `dataloader_persistent_workers`: False - `skip_memory_metrics`: True - `use_legacy_prediction_loop`: False - `push_to_hub`: False - `resume_from_checkpoint`: None - `hub_model_id`: None - `hub_strategy`: every_save - `hub_private_repo`: None - `hub_always_push`: False - `hub_revision`: None - `gradient_checkpointing`: False - `gradient_checkpointing_kwargs`: None - `include_inputs_for_metrics`: False - `include_for_metrics`: [] - `eval_do_concat_batches`: True - `fp16_backend`: auto - `push_to_hub_model_id`: None - `push_to_hub_organization`: None - `mp_parameters`: - `auto_find_batch_size`: False - `full_determinism`: False - `torchdynamo`: None - `ray_scope`: last - `ddp_timeout`: 1800 - `torch_compile`: False - `torch_compile_backend`: None - `torch_compile_mode`: None - `include_tokens_per_second`: False - `include_num_input_tokens_seen`: False - `neftune_noise_alpha`: None - `optim_target_modules`: None - `batch_eval_metrics`: False - `eval_on_start`: False - `use_liger_kernel`: False - `liger_kernel_config`: None - `eval_use_gather_object`: False - `average_tokens_across_devices`: False - `prompts`: None - `batch_sampler`: batch_sampler - `multi_dataset_batch_sampler`: round_robin
### Training Logs | Epoch | Step | Training Loss | cosine_ap | |:------:|:-----:|:-------------:|:---------:| | 0.1998 | 215 | - | 0.7638 | | 0.3996 | 430 | - | 0.8723 | | 0.4647 | 500 | 4.4585 | - | | 0.5994 | 645 | - | 0.9176 | | 0.7993 | 860 | - | 0.9475 | | 0.9294 | 1000 | 3.6015 | - | | 0.9991 | 1075 | - | 0.9595 | | 1.0 | 1076 | - | 0.9593 | | 1.1989 | 1290 | - | 0.9705 | | 1.3941 | 1500 | 3.3729 | - | | 1.3987 | 1505 | - | 0.9793 | | 1.5985 | 1720 | - | 0.9818 | | 1.7983 | 1935 | - | 0.9854 | | 1.8587 | 2000 | 3.2631 | - | | 1.9981 | 2150 | - | 0.9866 | | 2.0 | 2152 | - | 0.9866 | | 2.1980 | 2365 | - | 0.9890 | | 2.3234 | 2500 | 3.1295 | - | | 2.3978 | 2580 | - | 0.9884 | | 2.5976 | 2795 | - | 0.9916 | | 2.7881 | 3000 | 3.0907 | - | | 2.7974 | 3010 | - | 0.9916 | | 2.9972 | 3225 | - | 0.9922 | | 3.0 | 3228 | - | 0.9922 | | 3.1970 | 3440 | - | 0.9928 | | 3.2528 | 3500 | 3.0105 | - | | 3.3968 | 3655 | - | 0.9932 | | 3.5967 | 3870 | - | 0.9937 | | 3.7175 | 4000 | 2.977 | - | | 3.7965 | 4085 | - | 0.9939 | | 3.9963 | 4300 | - | 0.9944 | | 4.0 | 4304 | - | 0.9945 | | 4.1822 | 4500 | 2.9488 | - | | 4.1961 | 4515 | - | 0.9947 | | 4.3959 | 4730 | - | 0.9950 | | 4.5957 | 4945 | - | 0.9952 | | 4.6468 | 5000 | 2.914 | - | | 4.7955 | 5160 | - | 0.9954 | | 4.9954 | 5375 | - | 0.9956 | | 5.0 | 5380 | - | 0.9956 | | 5.1115 | 5500 | 2.8927 | - | | 5.1952 | 5590 | - | 0.9960 | | 5.3950 | 5805 | - | 0.9959 | | 5.5762 | 6000 | 2.8505 | - | | 5.5948 | 6020 | - | 0.9963 | | 5.7946 | 6235 | - | 0.9961 | | 5.9944 | 6450 | - | 0.9962 | | 6.0 | 6456 | - | 0.9962 | | 6.0409 | 6500 | 2.8462 | - | | 6.1942 | 6665 | - | 0.9963 | | 6.3941 | 6880 | - | 0.9965 | | 6.5056 | 7000 | 2.8024 | - | | 6.5939 | 7095 | - | 0.9967 | | 6.7937 | 7310 | - | 0.9969 | | 6.9703 | 7500 | 2.8184 | - | | 6.9935 | 7525 | - | 0.9968 | | 7.0 | 7532 | - | 0.9967 | | 7.1933 | 7740 | - | 0.9967 | | 7.3931 | 7955 | - | 0.9967 | | 7.4349 | 8000 | 2.7761 | - | | 7.5929 | 8170 | - | 0.9968 | | 7.7928 | 8385 | - | 0.9969 | | 7.8996 | 8500 | 2.7736 | - | | 7.9926 | 8600 | - | 0.9970 | | 8.0 | 8608 | - | 0.9971 | | 8.1924 | 8815 | - | 0.9972 | | 8.3643 | 9000 | 2.7627 | - | | 8.3922 | 9030 | - | 0.9970 | | 8.5920 | 9245 | - | 0.9972 | | 8.7918 | 9460 | - | 0.9972 | | 8.8290 | 9500 | 2.7604 | - | | 8.9916 | 9675 | - | 0.9972 | | 9.0 | 9684 | - | 0.9972 | | 9.1914 | 9890 | - | 0.9971 | | 9.2937 | 10000 | 2.7467 | - | | 9.3913 | 10105 | - | 0.9972 | | 9.5911 | 10320 | - | 0.9973 | | 9.7584 | 10500 | 2.7441 | - | | 9.7909 | 10535 | - | 0.9973 | ### Framework Versions - Python: 3.11.13 - Sentence Transformers: 4.1.0 - Transformers: 4.53.3 - PyTorch: 2.6.0+cu124 - Accelerate: 1.9.0 - Datasets: 4.4.1 - Tokenizers: 0.21.2 ## Citation ### BibTeX #### Sentence Transformers ```bibtex @inproceedings{reimers-2019-sentence-bert, title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks", author = "Reimers, Nils and Gurevych, Iryna", booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing", month = "11", year = "2019", publisher = "Association for Computational Linguistics", url = "https://arxiv.org/abs/1908.10084", } ``` #### MultipleNegativesRankingLoss ```bibtex @misc{henderson2017efficient, title={Efficient Natural Language Response Suggestion for Smart Reply}, 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}, year={2017}, eprint={1705.00652}, archivePrefix={arXiv}, primaryClass={cs.CL} } ```