Downloads · 30 days
61
17% of all-time downloads
expri34/beyan-quran-bge-m3
beyan-quran-bge-m3 is a sentence similarity model from expri34. Use it when you need a score for how close two texts are. It is set up for sentence-transformers.
This is a sentence-transformers model finetuned from BAAI/bge-m3. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for retrieval.
Downloads · 30 days
61
17% of all-time downloads
All-time downloads
364
Public
Parameters
568M
2.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.3 GB · 99%
From the Hugging Face model README
This is a sentence-transformers model finetuned from BAAI/bge-m3. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for retrieval.
SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'XLMRobertaModel'})
(1): Pooling({'embedding_dimension': 1024, 'pooling_mode': 'cls', 'include_prompt': True})
(2): Normalize({})
)
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("expri34/beyan-quran-bge-m3")
# Run inference
sentences = [
"De ki, Allah'a ve Peygamber'e itaat edin! Eğer aksine giderlerse, şüphe yok ki Allah kâfirleri sevmez.",
"De ki, Allah'a ve Peygamber'e itaat edin! Eğer aksine giderlerse, şüphe yok ki Allah kâfirleri sevmez. 31- De ki: “Eğer Allah’ı seviyorsanız Bana uyun ki Allah da sizi sevsin ve günahlarınızı bağışlasın. Allah Ğafurdur, Rahimdir.” 32- De ki: “Allah’a ve Rasûl’e itaat edin.” Eğer yüz çevirirlerse bilsinler ki Allah kâfirleri sevmez. 31. Bu âyet Allah’ı gerçek anlamı ile sevenler ile bunu mücerred bir iddia olarak ileri sürenlerin kendisi vasıtası ile bilinip ayırt edildiği bir ölçüdür. Zira Allah’ı sevmenin alâmeti Muhammed sallallahu aleyhi ve sellem’e tabi olmaktır. Yüce Allah O’na ve O’nun dave",
'فَبَدَّلَ الَّذِينَ ظَلَمُوا قَوْلًا غَيْرَ الَّذِي قِيلَ لَهُمْ فَأَنْزَلْنَا عَلَى الَّذِينَ ظَلَمُوا رِجْزًا مِنَ السَّمَاءِ بِمَا كَانُوا يَفْسُقُونَ',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.7001, 0.1396],
# [0.7001, 1.0000, 0.0754],
# [0.1396, 0.0754, 1.0000]])
<!--
### Direct Usage (Transformers)
<details><summary>Click to see the direct usage in Transformers</summary>
</details>
-->
<!--
### Downstream Usage (Sentence Transformers)
You can finetune this model on your own dataset.
<details><summary>Click to expand</summary>
</details>
-->
<!--
### Out-of-Scope Use
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
-->
<!--
## Bias, Risks and Limitations
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
-->
<!--
### Recommendations
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
-->
| anchor | positive | |
|---|---|---|
| type | string | string |
| details | <ul><li>min: 3 tokens</li><li>mean: 36.61 tokens</li><li>max: 405 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 80.45 tokens</li><li>max: 622 tokens</li></ul> |
| anchor | positive |
|---|---|
| <code>Nereden (yola) çıkarsan, yüzünü Mescid-i Haram'a doğru çevir. Siz de nerede olursanız, yüzünüzü o yana döndürün, Ta ki, zalim olanlardan başka insanların aleyhinizde bir delili bulunmasın. Artık onlar</code> | <code>zulüm</code> |
| <code>إِنْ يَنْصُرْكُمُ اللَّهُ فَلَا غَالِبَ لَكُمْ ۖ وَإِنْ يَخْذُلْكُمْ فَمَنْ ذَا الَّذِي يَنْصُرُكُمْ مِنْ بَعْدِهِ ۗ وَعَلَى اللَّهِ فَلْيَتَوَكَّلِ الْمُؤْمِنُونَ</code> | <code>Allah size yardım ederse, sizi yenecek yoktur. Eğer sizi yardımsız bırakırsa, artık ondan sonra size kim yardım edebilir? Müminler ancak Allah'a güvenip dayansınlar.</code> |
| <code>وَيْلٌ يَوْمَئِذٍ لِلْمُكَذِّبِينَ</code> | <code>O gün yalanlayanların vay haline!</code> |
{
"scale": 20.0,
"similarity_fct": "cos_sim",
"gather_across_devices": false,
"directions": [
"query_to_doc"
],
"partition_mode": "joint",
"hardness_mode": null,
"hardness_strength": 0.0
}
| anchor | positive | |
|---|---|---|
| type | string | string |
| details | <ul><li>min: 3 tokens</li><li>mean: 38.43 tokens</li><li>max: 404 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 80.54 tokens</li><li>max: 622 tokens</li></ul> |
| anchor | positive |
|---|---|
| <code>ibrahim ile ilgili Kuran ne diyor</code> | <code>Bir de dedi ki: "Ben Rabbime gidiyorum, o bana yolunu gösterir."</code> |
| <code>(Onlar mı hayırlı) yoksa, kendine yalvardığı zaman bunalmışa karşılık veren ve başındaki sıkıntıyı gideren, sizi yeryüzünün hakimleri yapan mı? Allah'ın yanında başka bir ilâh mı var? Ne kıt düşünüyorsunuz!</code> | <code>أَمَّنْ يُجِيبُ الْمُضْطَرَّ إِذَا دَعَاهُ وَيَكْشِفُ السُّوءَ وَيَجْعَلُكُمْ خُلَفَاءَ الْأَرْضِ ۗ أَإِلَٰهٌ مَعَ اللَّهِ ۚ قَلِيلًا مَا تَذَكَّرُونَ</code> |
| <code>Çünkü gündüz senin için uzun bir meşguliyet vardır.</code> | <code>Çünkü gündüz senin için uzun bir meşguliyet vardır. 1- Ey elbisesine sarınıp bürünen! 2- Kalk ve birazı müstesnâ geceyi namazla geçir; 3- Yarısını veya ondan biraz azını. 4- Yahut da ondan biraz fazlasını. Kur’ân’ı da tertil üzere (ağır ağır ve tane tane) oku. 5- Şüphesiz Biz sana ağır bir söz vahyedeceğiz. 6- Çünkü gece kalkışı hem daha etkilidir hem de ondaki okuyuş daha düzgün ve sağlamdır. 7- Gündüz vakti ise senin uzun uğraşların vardır. 8- Rabbinin ismini an ve her şeyden yüz çevirip tamamiyle O’na yönel! 9- O, doğunun da batının da Rabbidi</code> |
{
"scale": 20.0,
"similarity_fct": "cos_sim",
"gather_across_devices": false,
"directions": [
"query_to_doc"
],
"partition_mode": "joint",
"hardness_mode": null,
"hardness_strength": 0.0
}
per_device_train_batch_size: 4num_train_epochs: 1learning_rate: 2e-06warmup_steps: 0.1gradient_accumulation_steps: 8fp16: Trueeval_strategy: stepsper_device_eval_batch_size: 4per_device_train_batch_size: 4num_train_epochs: 1max_steps: -1learning_rate: 2e-06lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_steps: 0.1optim: adamw_torchoptim_args: Noneweight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08optim_target_modules: Nonegradient_accumulation_steps: 8average_tokens_across_devices: Truemax_grad_norm: 1.0label_smoothing_factor: 0.0bf16: Falsefp16: Truebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Nonetorch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneuse_liger_kernel: Falseliger_kernel_config: Noneuse_cache: Falseneftune_noise_alpha: Nonetorch_empty_cache_steps: Noneauto_find_batch_size: Falselog_on_each_node: Truelogging_nan_inf_filter: Trueinclude_num_input_tokens_seen: nolog_level: passivelog_level_replica: warningdisable_tqdm: Falseproject: huggingfacetrackio_space_id: trackioeval_strategy: stepsper_device_eval_batch_size: 4prediction_loss_only: Trueeval_on_start: Falseeval_do_concat_batches: Trueeval_use_gather_object: Falseeval_accumulation_steps: Noneinclude_for_metrics: []batch_eval_metrics: Falsesave_only_model: Falsesave_on_each_node: Falseenable_jit_checkpoint: Falsepush_to_hub: Falsehub_private_repo: Nonehub_model_id: Nonehub_strategy: every_savehub_always_push: Falsehub_revision: Noneload_best_model_at_end: Falseignore_data_skip: Falserestore_callback_states_from_checkpoint: Falsefull_determinism: Falseseed: 42data_seed: Noneuse_cpu: Falseaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedataloader_drop_last: Falsedataloader_num_workers: 0dataloader_pin_memory: Truedataloader_persistent_workers: Falsedataloader_prefetch_factor: Noneremove_unused_columns: Truelabel_names: Nonetrain_sampling_strategy: randomlength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falseddp_backend: Noneddp_timeout: 1800fsdp: []fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}deepspeed: Nonedebug: []skip_memory_metrics: Truedo_predict: Falseresume_from_checkpoint: Nonewarmup_ratio: Nonelocal_rank: -1prompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0267 | 25 | 0.6327 | - |
| 0.0535 | 50 | 0.6013 | - |
| 0.0802 | 75 | 0.5523 | - |
| 0.1069 | 100 | 0.4702 | - |
| 0.1337 | 125 | 0.4084 | - |
| 0.1604 | 150 | 0.3759 | - |
| 0.1871 | 175 | 0.3413 | - |
| 0.2139 | 200 | 0.3640 | 0.2953 |
| 0.2406 | 225 | 0.3196 | - |
| 0.2673 | 250 | 0.3098 | - |
| 0.2941 | 275 | 0.3359 | - |
| 0.3208 | 300 | 0.2916 | - |
| 0.3475 | 325 | 0.2713 | - |
| 0.3743 | 350 | 0.2880 | - |
| 0.4010 | 375 | 0.2857 | - |
| 0.4278 | 400 | 0.2396 | 0.2214 |
| 0.4545 | 425 | 0.2703 | - |
| 0.4812 | 450 | 0.2682 | - |
| 0.5080 | 475 | 0.2667 | - |
| 0.5347 | 500 | 0.2973 | - |
| 0.5614 | 525 | 0.2358 | - |
| 0.5882 | 550 | 0.2250 | - |
| 0.6149 | 575 | 0.2793 | - |
| 0.6416 | 600 | 0.2027 | 0.1898 |
| 0.6684 | 625 | 0.2154 | - |
| 0.6951 | 650 | 0.2038 | - |
| 0.7218 | 675 | 0.2249 | - |
| 0.7486 | 700 | 0.2530 | - |
| 0.7753 | 725 | 0.2012 | - |
| 0.8020 | 750 | 0.1971 | - |
| 0.8288 | 775 | 0.2232 | - |
| 0.8555 | 800 | 0.2477 | 0.1758 |
| 0.8822 | 825 | 0.2183 | - |
| 0.9090 | 850 | 0.2151 | - |
| 0.9357 | 875 | 0.1801 | - |
| 0.9624 | 900 | 0.1969 | - |
| 0.9892 | 925 | 0.1977 | - |
| 1.0 | 936 | - | 0.1730 |
@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",
}
@misc{oord2019representationlearningcontrastivepredictive,
title={Representation Learning with Contrastive Predictive Coding},
author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
year={2019},
eprint={1807.03748},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/1807.03748},
}
<!--
## Glossary
*Clearly define terms in order to be accessible across audiences.*
-->
<!--
## Model Card Authors
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
-->
<!--
## Model Card Contact
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
-->