---
base_model: BAAI/bge-m3
library_name: sentence-transformers
metrics:
- src2trg_accuracy
- trg2src_accuracy
- mean_accuracy
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:477170
- loss:MultipleNegativesRankingLoss
widget:
- source_sentence: These bodhisattvas were named
sentences:
- अमुष्मै त्वा वज्रम् प्रहरामीति यद्यभिचरेद्वज्रो वै स्फ्य स्तृणुते हैवैनेन ॥
- तद्यत्स्रुचः सम्मार्ष्टि यथा वै देवानां चरणं तद्वा अनु मनुष्याणां तस्माद्यदामनुष्याणाम्
परिवेषणमुपक्ल्प्तम् भवति ॥
- सुमतिना च । सुजातेन च ।
- source_sentence: The cart further is (one of the means of) the sacrifice; for the
cart is indeed (one of the means of) sacrifice. To the cart, therefore, refer
the (following) Yagus-texts, and not to a store-room, nor to a jar.
sentences:
- अररो दिवम् मा पप्त इति यत्र वै देवा अररुमसुररक्षसमपाघ्नत स दिवमपिपतिषत्तमग्निरभिन्यदधादररो
दिवम् मा पप्त इति स न दिवमपत्तथो एवैनमेतदध्वर्युरेवास्माल्लोकादन्तरेति दिवो ऽध्यग्नीत्तस्मादेवं
करोति ॥ अथ तृतीयम् प्रहरति । द्रप्सस्ते द्याम् मा स्कन्नित्ययं वाअस्यै द्रप्सो
यमस्या इमं रस प्रजा उपजीवन्त्येष ते दिवम् मा पप्तदित्येवैतदाह व्रजं गच गो । ।
। मौगिति ॥
- अचिद्रमेवैनमेतदग्निना परिगृह्णाति नेदेनं नाष्ट्रा रक्षांसि प्रमृशानित्यग्निर्हि
रक्षसामपहन्ता तस्मात्पर्यग्निं करोति ॥
- गृहा वै गार्हपत्यो गृहा वै प्रतिष्ठायाम् प्रतितिष्ठति तथो हैनमेष वज्रो न हिनस्ति
तस्माद्गार्हपत्ये सादयति ॥
- source_sentence: He lived with the deportment of a buddha, and his superior intelligence
was as wide as an ocean.
sentences:
- न हि भदन्तोपाले आपत्तिर् अध्यात्मप्रतिष्ठिता न बहिर्धासंक्रान्तो नोभयम् अन्तरेणोपलभ्यते
।
- बुद्धेर्यापथप्रतिष्ठितः । सागरवरबुद्ध्यनुप्रविष्टः ।
- सर्वत्रानुगता बोधिर् आकाशस्वभावत्वात् ।
- source_sentence: 'Further, ''The leader of oblations (yagña), the carrier of (Soma-)sacrifices
(adhvara), '' for through him they lead forward all oblations, both the domestic
oblations and the others: this is why he says ''the leader of oblations. '''
sentences:
- प्रणीर्यज्ञानां रथीरध्वराणामिति । एतेन वै सर्वान्यज्ञान्प्रणयन्ति ये च पाकयज्ञा
ये चेतरे तस्मादाह प्रणीर्यज्ञानामिति ॥
- चत्वारि संग्रहवस्तूनि कुलपुत्र बोधिसत्वस्य बुद्धक्षेत्रम् ।
- अग्ने दीद्यतम् बृहदिति । चक्षुर्वै दीदयेव चक्षुरेवैतया समिन्द्धे ॥
- source_sentence: O Śākyamuni, conquering the powerful host of Māra, You found peace,
immortality, and the happiness of that supreme enlightenment
sentences:
- न हि तथता द्वयप्रभाविता नानात्वप्रभाविता ।
- अश्वो न देववाहन इति । अश्वो ह वा एष भूत्वा देवेभ्यो यज्ञं वहति यद्वै नेत्यृच्योमिति
तत्तस्मादाहाश्वो न देववाहन इति ॥
- मारस् त्वयास्तु विजितस् सबलो मुनीन्द्रः प्राप्ता शिवा अमृतशान्तवराग्रबोधिः ।
model-index:
- name: SentenceTransformer based on BAAI/bge-m3
results:
- task:
type: translation
name: Translation
dataset:
name: translate val
type: translate-val
metrics:
- type: src2trg_accuracy
value: 0.9422661870503597
name: Src2Trg Accuracy
- type: trg2src_accuracy
value: 0.9381294964028777
name: Trg2Src Accuracy
- type: mean_accuracy
value: 0.9401978417266187
name: Mean Accuracy
- task:
type: translation
name: Translation
dataset:
name: translate test
type: translate-test
metrics:
- type: src2trg_accuracy
value: 0.9304629796433075
name: Src2Trg Accuracy
- type: trg2src_accuracy
value: 0.9270401729418123
name: Trg2Src Accuracy
- type: mean_accuracy
value: 0.9287515762925599
name: Mean Accuracy
---
# SentenceTransformer based on BAAI/bge-m3
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [BAAI/bge-m3](https://huggingface.co/BAAI/bge-m3) on the mitrasamgraha dataset. It maps sentences & paragraphs to a 1024-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:** [BAAI/bge-m3](https://huggingface.co/BAAI/bge-m3)
- **Maximum Sequence Length:** 8192 tokens
- **Output Dimensionality:** 1024 tokens
- **Similarity Function:** Cosine Similarity
- **Training Dataset:**
- mitrasamgraha
### 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': 8192, 'do_lower_case': False}) with Transformer model: XLMRobertaModel
(1): Pooling({'word_embedding_dimension': 1024, '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})
(2): Normalize()
)
```
## 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("sanganaka/bge-m3-sanskritFT")
# Run inference
sentences = [
'O Śākyamuni, conquering the powerful host of Māra, You found peace, immortality, and the happiness of that supreme enlightenment',
'मारस् त्वयास्तु विजितस् सबलो मुनीन्द्रः प्राप्ता शिवा अमृतशान्तवराग्रबोधिः ।',
'न हि तथता द्वयप्रभाविता नानात्वप्रभाविता ।',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
```
## Evaluation
### Metrics
#### Translation
* Dataset: `translate-val`
* Evaluated with [TranslationEvaluator](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.TranslationEvaluator)
| Metric | Value |
|:------------------|:-----------|
| src2trg_accuracy | 0.9423 |
| trg2src_accuracy | 0.9381 |
| **mean_accuracy** | **0.9402** |
#### Translation
* Dataset: `translate-test`
* Evaluated with [TranslationEvaluator](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.TranslationEvaluator)
| Metric | Value |
|:------------------|:-----------|
| src2trg_accuracy | 0.9305 |
| trg2src_accuracy | 0.927 |
| **mean_accuracy** | **0.9288** |
## Training Details
### Training Dataset
#### mitrasamgraha
* Dataset: mitrasamgraha
* Size: 477,170 training samples
* Columns: english and sanskrit_Deva
* Approximate statistics based on the first 1000 samples:
| | english | sanskrit_Deva |
|:--------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|
| type | string | string |
| details |
My patience is almost worn out, like that of a creeper under the winter frost. It is decayed, and neither lives nor perishes at once. | जर्जरीकृत्य वस्तूनि त्यजन्ती विभ्रती तथा । मार्गशीर्षान्तवल्लीव धृतिर्विधुरतां गता ॥ |
| Our minds are partly settled in worldly things, and partly fixed in their giver (the Supreme soul). This divided state of the mind is termed its half waking condition. | अपहस्तितसर्वार्थमनवस्थितिरास्थिता । गृहीत्वोत्सृज्य चात्मानं भवस्थितिरवस्थिता ॥ |
| My mind is in a state of suspense, being unable to ascertain the real nature of my soul. I am like one in the dark, who is deceived by the stump of a fallen tree at a distance, to think it a human figure. | चलिताचलितेनान्तरवष्टम्भेन मे मतिः । दरिद्रा छिन्नवृक्षस्य मूलेनेव विडम्ब्यते ॥ |
* Loss: [MultipleNegativesRankingLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
```json
{
"scale": 20.0,
"similarity_fct": "cos_sim"
}
```
### Evaluation Dataset
#### mitrasamgraha
* Dataset: mitrasamgraha
* Size: 5,560 evaluation samples
* Columns: english and sanskrit_Deva
* Approximate statistics based on the first 1000 samples:
| | english | sanskrit_Deva |
|:--------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|
| type | string | string |
| details | Thereupon he takes the winnowing basket and the Agnihotra ladle , with the text : 'For the work (I take) you, for pervasion (or accomplishment) you two! ' For the sacrifice is a work: hence, in saying 'for the work you two, ' he says, 'for the sacrifice. ' And 'for pervasion you two, ' he says, because he, as it were, pervades (goes through, accomplishes) the sacrifice. He then restrains his speech; for (restrained) speech means undisturbed sacrifice; so that (in so doing) he thinks: 'May I accomplish the sacrifice! ' He now heats (the two objects on the Grhapatya), with the formula : 'Scorched is the Rakshas, scorched are the enemies! ' or : 'Burnt out is the Rakshas, burnt out are the enemies! ' | अग्ने व्रतपते व्रतं चरिष्यामि तचकेयं तन्मे राध्यतामित्यग्निर्वै देवानां व्रतपतिस्तस्मा एवैतत्प्राह व्रतं चरिष्यामि तच्चकेयं तन्मे राध्यतामिति नात्र तिरोहितमिवास्ति ॥ अथ संस्थिते विसृजते । अग्ने व्रतपते व्रतमचारिषं तादशकम् तन्मे राधीत्यशकद्येतद्यो यज्ञस्य संस्थामगन्नराधि ह्यस्मै यो यज्ञस्य संस्थामगन्नेतेन न्वेव भूयिष्ठा इव व्रतमुपयन्त्यनेन त्वेवोपेयात् ॥ द्वयं वा इदं न तृतीयमस्ति । |
| For the gods, when they were performing the sacrifice, were afraid of a disturbance on the part of the Asuras and Rakshas: hence by this means he expels from here, at the very opening of the sacrifice, the evil spirits, the Rakshas. | एतद्धवै देवा व्रतं चरन्ति यत्सत्यं तस्मात्ते यशो यशो ह भवति य एवं विद्वांत्सत्यंवदति ॥ अथ संस्थिते विसृजते । |
| He now steps forward (to the cart ), with the text : 'I move along the wide arial realm. ' For the Rakshas roams about in the air, rootless and unfettered in both directions (below and above); and in order that this man (the Adhvaryu) may move about the air, rootless and unfettered in both directions, he by this very prayer renders the atmosphere free from danger and evil spirits. | स वा आरण्यमेवाश्नीयात् । या वारण्या ओषधयो यद्वा वृक्ष्यं तदु ह स्माहापि बर्कुर्वार्ष्णो मासान्मे पचत न वा एतेसां हविर्गृह्णन्तीति तदु तथा न कुर्याद्व्रीहियवयोर्वा एतदुपजं यचमीधान्यं तद्व्रीहियवावेवैतेन भूयांसौ करोति तस्मादारण्यमेवाश्नीयात् ॥ |
* 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`: epoch
- `per_device_train_batch_size`: 32
- `per_device_eval_batch_size`: 128
- `learning_rate`: 2e-05
- `num_train_epochs`: 5
- `warmup_ratio`: 0.1
- `bf16`: True
- `batch_sampler`: no_duplicates
#### All Hyperparameters