SentenceTransformer based on abdoelsayed/AraDPR
This is a sentence-transformers model finetuned from abdoelsayed/AraDPR. 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.
Model Details
Model Description
- Model Type: Sentence Transformer
- Base model: abdoelsayed/AraDPR
- Maximum Sequence Length: 512 tokens
- Output Dimensionality: 768 tokens
- Similarity Function: Cosine Similarity
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
(1): Pooling({'word_embedding_dimension': 768, '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/KDAraDPR2_initialversion0")
# Run inference
sentences = [
'تحديد المسح',
'المسح أو مسح الأراضي هو تقنية ومهنة وعلم تحديد المواقع الأرضية أو ثلاثية الأبعاد للنقاط والمسافات والزوايا بينها . يطلق على أخصائي مسح الأراضي اسم مساح الأراضي .',
'إجمالي المحطات . تعد المحطات الإجمالية واحدة من أكثر أدوات المسح شيوعا المستخدمة اليوم . وهي تتألف من جهاز ثيودوليت إلكتروني ومكون إلكتروني لقياس المسافة ( EDM ) . تتوفر أيضا محطات روبوتية كاملة تتيح التشغيل لشخص واحد من خلال التحكم في الجهاز باستخدام جهاز التحكم عن بعد . تاريخ',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# 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.547 |
mrr@10 | 0.5489 |
ndcg@10 | 0.6231 |
Training Details
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy
: stepsper_device_train_batch_size
: 16gradient_accumulation_steps
: 8learning_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
: 16per_device_eval_batch_size
: 8per_gpu_train_batch_size
: Noneper_gpu_eval_batch_size
: Nonegradient_accumulation_steps
: 8eval_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 | 0.0019 | 0.0045 | 0.4548 |
0.1024 | 4000 | 0.0011 | 0.0039 | 0.4988 |
0.1536 | 6000 | 0.001 | 0.0034 | 0.4871 |
0.2048 | 8000 | 0.0009 | 0.0032 | 0.4811 |
0.256 | 10000 | 0.0009 | 0.0032 | 0.4641 |
0.3072 | 12000 | 0.0008 | 0.0028 | 0.4540 |
0.3584 | 14000 | 0.0007 | 0.0027 | 0.4918 |
0.4096 | 16000 | 0.0007 | 0.0024 | 0.5039 |
0.4608 | 18000 | 0.0006 | 0.0024 | 0.5051 |
0.512 | 20000 | 0.0006 | 0.0021 | 0.4772 |
0.5632 | 22000 | 0.0006 | 0.0021 | 0.5110 |
0.6144 | 24000 | 0.0005 | 0.0020 | 0.5286 |
0.6656 | 26000 | 0.0005 | 0.0020 | 0.5217 |
0.7168 | 28000 | 0.0005 | 0.0018 | 0.5193 |
0.768 | 30000 | 0.0005 | 0.0018 | 0.5152 |
0.8192 | 32000 | 0.0005 | 0.0017 | 0.5322 |
0.8704 | 34000 | 0.0004 | 0.0016 | 0.5296 |
0.9216 | 36000 | 0.0004 | 0.0016 | 0.5266 |
0.9728 | 38000 | 0.0004 | 0.0015 | 0.5244 |
1.024 | 40000 | 0.0004 | 0.0014 | 0.5251 |
1.0752 | 42000 | 0.0003 | 0.0014 | 0.5202 |
1.1264 | 44000 | 0.0003 | 0.0014 | 0.5089 |
1.1776 | 46000 | 0.0003 | 0.0013 | 0.5030 |
1.2288 | 48000 | 0.0003 | 0.0013 | 0.5184 |
1.28 | 50000 | 0.0003 | 0.0012 | 0.5267 |
1.3312 | 52000 | 0.0003 | 0.0012 | 0.5386 |
1.3824 | 54000 | 0.0003 | 0.0012 | 0.5254 |
1.4336 | 56000 | 0.0003 | 0.0012 | 0.5378 |
1.4848 | 58000 | 0.0003 | 0.0011 | 0.5324 |
1.536 | 60000 | 0.0003 | 0.0011 | 0.5364 |
1.5872 | 62000 | 0.0003 | 0.0011 | 0.5412 |
1.6384 | 64000 | 0.0003 | 0.0010 | 0.5339 |
1.6896 | 66000 | 0.0003 | 0.0010 | 0.5452 |
1.7408 | 68000 | 0.0003 | 0.0010 | 0.5557 |
1.792 | 70000 | 0.0002 | 0.001 | 0.5619 |
1.8432 | 72000 | 0.0002 | 0.0010 | 0.5512 |
1.8944 | 74000 | 0.0002 | 0.0010 | 0.5434 |
1.9456 | 76000 | 0.0002 | 0.0009 | 0.5367 |
1.9968 | 78000 | 0.0002 | 0.0009 | 0.5497 |
2.048 | 80000 | 0.0002 | 0.0009 | 0.5459 |
2.0992 | 82000 | 0.0002 | 0.0009 | 0.5616 |
2.1504 | 84000 | 0.0002 | 0.0009 | 0.5573 |
2.2016 | 86000 | 0.0002 | 0.0009 | 0.5526 |
2.2528 | 88000 | 0.0002 | 0.0008 | 0.5557 |
2.304 | 90000 | 0.0002 | 0.0008 | 0.5470 |
- 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.2.0
- Datasets: 3.0.1
- Tokenizers: 0.20.1
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
- 18
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social
visibility and check back later, or deploy to Inference Endpoints (dedicated)
instead.
Model tree for hatemestinbejaia/mmarco-Arabic-AraDPR-bi-encoder-KD-v1
Base model
abdoelsayed/AraDPREvaluation results
- Map on Unknownself-reported0.547
- Mrr@10 on Unknownself-reported0.549
- Ndcg@10 on Unknownself-reported0.623