SentenceTransformer based on sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
This is a sentence-transformers model finetuned from 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
- Maximum Sequence Length: 128 tokens
- Output Dimensionality: 384 tokens
- Similarity Function: Cosine Similarity
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- HF中国镜像站: Sentence Transformers on HF中国镜像站
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 128, '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:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("hatemestinbejaia/mmarco-Arabic-mMiniLML-bi-encoder-KD-v1-Nonormalisation")
# Run inference
sentences = [
'تحديد المسح',
'المسح أو مسح الأراضي هو تقنية ومهنة وعلم تحديد المواقع الأرضية أو ثلاثية الأبعاد للنقاط والمسافات والزوايا بينها . يطلق على أخصائي مسح الأراضي اسم مساح الأراضي .',
'إجمالي المحطات . تعد المحطات الإجمالية واحدة من أكثر أدوات المسح شيوعا المستخدمة اليوم . وهي تتألف من جهاز ثيودوليت إلكتروني ومكون إلكتروني لقياس المسافة ( EDM ) . تتوفر أيضا محطات روبوتية كاملة تتيح التشغيل لشخص واحد من خلال التحكم في الجهاز باستخدام جهاز التحكم عن بعد . تاريخ',
]
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
Reranking
- Evaluated with
RerankingEvaluator
Metric | Value |
---|---|
map | 0.5526 |
mrr@10 | 0.5566 |
ndcg@10 | 0.6272 |
Training Details
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy
: stepsper_device_train_batch_size
: 128learning_rate
: 7e-05warmup_ratio
: 0.07fp16
: Truehalf_precision_backend
: ampload_best_model_at_end
: Truefp16_backend
: amp
All Hyperparameters
Click to expand
overwrite_output_dir
: Falsedo_predict
: Falseeval_strategy
: stepsprediction_loss_only
: Trueper_device_train_batch_size
: 128per_device_eval_batch_size
: 8per_gpu_train_batch_size
: Noneper_gpu_eval_batch_size
: Nonegradient_accumulation_steps
: 1eval_accumulation_steps
: Nonetorch_empty_cache_steps
: Nonelearning_rate
: 7e-05weight_decay
: 0.0adam_beta1
: 0.9adam_beta2
: 0.999adam_epsilon
: 1e-08max_grad_norm
: 1.0num_train_epochs
: 3max_steps
: -1lr_scheduler_type
: linearlr_scheduler_kwargs
: {}warmup_ratio
: 0.07warmup_steps
: 0log_level
: passivelog_level_replica
: warninglog_on_each_node
: Truelogging_nan_inf_filter
: Truesave_safetensors
: Truesave_on_each_node
: Falsesave_only_model
: Falserestore_callback_states_from_checkpoint
: Falseno_cuda
: Falseuse_cpu
: Falseuse_mps_device
: Falseseed
: 42data_seed
: Nonejit_mode_eval
: Falseuse_ipex
: Falsebf16
: Falsefp16
: Truefp16_opt_level
: O1half_precision_backend
: ampbf16_full_eval
: Falsefp16_full_eval
: Falsetf32
: Nonelocal_rank
: 0ddp_backend
: Nonetpu_num_cores
: Nonetpu_metrics_debug
: Falsedebug
: []dataloader_drop_last
: Falsedataloader_num_workers
: 0dataloader_prefetch_factor
: Nonepast_index
: -1disable_tqdm
: Falseremove_unused_columns
: Truelabel_names
: Noneload_best_model_at_end
: Trueignore_data_skip
: Falsefsdp
: []fsdp_min_num_params
: 0fsdp_config
: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap
: Noneaccelerator_config
: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}deepspeed
: Nonelabel_smoothing_factor
: 0.0optim
: adamw_torchoptim_args
: Noneadafactor
: Falsegroup_by_length
: Falselength_column_name
: lengthddp_find_unused_parameters
: Noneddp_bucket_cap_mb
: Noneddp_broadcast_buffers
: Falsedataloader_pin_memory
: Truedataloader_persistent_workers
: Falseskip_memory_metrics
: Trueuse_legacy_prediction_loop
: Falsepush_to_hub
: Falseresume_from_checkpoint
: Nonehub_model_id
: Nonehub_strategy
: every_savehub_private_repo
: Falsehub_always_push
: Falsegradient_checkpointing
: Falsegradient_checkpointing_kwargs
: Noneinclude_inputs_for_metrics
: Falseeval_do_concat_batches
: Truefp16_backend
: amppush_to_hub_model_id
: Nonepush_to_hub_organization
: Nonemp_parameters
:auto_find_batch_size
: Falsefull_determinism
: Falsetorchdynamo
: Noneray_scope
: lastddp_timeout
: 1800torch_compile
: Falsetorch_compile_backend
: Nonetorch_compile_mode
: Nonedispatch_batches
: Nonesplit_batches
: Noneinclude_tokens_per_second
: Falseinclude_num_input_tokens_seen
: Falseneftune_noise_alpha
: Noneoptim_target_modules
: Nonebatch_eval_metrics
: Falseeval_on_start
: Falseuse_liger_kernel
: Falseeval_use_gather_object
: Falsebatch_sampler
: batch_samplermulti_dataset_batch_sampler
: proportional
Training Logs
Epoch | Step | Training Loss | loss | map |
---|---|---|---|---|
0.0512 | 2000 | 60.0645 | 39.7459 | 0.4997 |
0.1024 | 4000 | 38.1556 | 34.3446 | 0.4994 |
0.1536 | 6000 | 33.7868 | 32.9171 | 0.5159 |
0.2048 | 8000 | 31.8491 | 29.9714 | 0.5282 |
0.2560 | 10000 | 29.7765 | 29.9015 | 0.5078 |
0.3072 | 12000 | 27.5914 | 26.7202 | 0.5283 |
0.3584 | 14000 | 25.8129 | 25.0254 | 0.5430 |
0.4096 | 16000 | 24.0781 | 25.0622 | 0.5207 |
0.4608 | 18000 | 22.9328 | 23.7991 | 0.5433 |
0.5120 | 20000 | 21.7429 | 22.0272 | 0.5333 |
0.5632 | 22000 | 20.9529 | 20.9957 | 0.5485 |
0.6144 | 24000 | 19.9476 | 19.8111 | 0.5304 |
0.6656 | 26000 | 19.1556 | 19.2983 | 0.5363 |
0.7168 | 28000 | 18.5506 | 20.4461 | 0.5421 |
0.7680 | 30000 | 17.8418 | 19.6846 | 0.5192 |
0.8192 | 32000 | 17.4182 | 18.3179 | 0.5268 |
0.8704 | 34000 | 16.8575 | 18.5912 | 0.5401 |
0.9216 | 36000 | 16.4331 | 17.6217 | 0.5448 |
0.9728 | 38000 | 15.8319 | 16.4225 | 0.5469 |
1.0240 | 40000 | 14.5094 | 16.8592 | 0.5283 |
1.0752 | 42000 | 13.2263 | 15.6646 | 0.5511 |
1.1264 | 44000 | 12.9718 | 16.8053 | 0.5599 |
1.1776 | 46000 | 12.9135 | 16.9315 | 0.5557 |
1.2288 | 48000 | 12.6887 | 16.6569 | 0.5588 |
1.2800 | 50000 | 12.4705 | 15.5349 | 0.5569 |
1.3312 | 52000 | 12.3431 | 15.9067 | 0.5597 |
1.3824 | 54000 | 12.0741 | 15.0079 | 0.5668 |
1.4336 | 56000 | 11.9194 | 14.9333 | 0.5532 |
1.4848 | 58000 | 11.7261 | 14.3567 | 0.5598 |
1.5360 | 60000 | 11.5138 | 14.8380 | 0.5608 |
1.5872 | 62000 | 11.3494 | 13.7454 | 0.5544 |
1.6384 | 64000 | 11.116 | 14.3529 | 0.5527 |
1.6896 | 66000 | 11.0054 | 13.8486 | 0.5403 |
1.7408 | 68000 | 10.8677 | 13.8550 | 0.5598 |
1.7920 | 70000 | 10.6486 | 15.1113 | 0.5526 |
1.8432 | 72000 | 10.4977 | 13.7056 | 0.5580 |
1.8944 | 74000 | 10.3649 | 14.4802 | 0.5526 |
- The bold row denotes the saved checkpoint.
Framework Versions
- Python: 3.11.9
- Sentence Transformers: 3.1.1
- Transformers: 4.45.2
- PyTorch: 2.4.1+cu121
- Accelerate: 1.4.0
- Datasets: 3.2.0
- Tokenizers: 0.20.3
Citation
BibTeX
Sentence Transformers
@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",
}
MarginMSELoss
@misc{hofstätter2021improving,
title={Improving Efficient Neural Ranking Models with Cross-Architecture Knowledge Distillation},
author={Sebastian Hofstätter and Sophia Althammer and Michael Schröder and Mete Sertkan and Allan Hanbury},
year={2021},
eprint={2010.02666},
archivePrefix={arXiv},
primaryClass={cs.IR}
}
- Downloads last month
- 7
Inference Providers
NEW
This model is not currently available via any of the supported Inference Providers.
Model tree for hatemestinbejaia/mmarco-Arabic-mMiniLML-bi-encoder-KD-v1-Nonormalisation
Evaluation results
- Map on Unknownself-reported0.553
- Mrr@10 on Unknownself-reported0.557
- Ndcg@10 on Unknownself-reported0.627