---
language: []
library_name: sentence-transformers
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:557850
- loss:MatryoshkaLoss
- loss:MultipleNegativesRankingLoss
base_model: intfloat/multilingual-e5-small
datasets: []
metrics:
- pearson_cosine
- spearman_cosine
- pearson_manhattan
- spearman_manhattan
- pearson_euclidean
- spearman_euclidean
- pearson_dot
- spearman_dot
- pearson_max
- spearman_max
widget:
- source_sentence: ذكر متوازن بعناية يقف على قدم واحدة بالقرب من منطقة شاطئ المحيط
النظيفة
sentences:
- رجل يقدم عرضاً
- هناك رجل بالخارج قرب الشاطئ
- رجل يجلس على أريكه
- source_sentence: رجل يقفز إلى سريره القذر
sentences:
- السرير قذر.
- رجل يضحك أثناء غسيل الملابس
- الرجل على القمر
- source_sentence: الفتيات بالخارج
sentences:
- امرأة تلف الخيط إلى كرات بجانب كومة من الكرات
- فتيان يركبان في جولة متعة
- ثلاث فتيات يقفون سوية في غرفة واحدة تستمع وواحدة تكتب على الحائط والثالثة تتحدث
إليهن
- source_sentence: الرجل يرتدي قميصاً أزرق.
sentences:
- رجل يرتدي قميصاً أزرق يميل إلى الجدار بجانب الطريق مع شاحنة زرقاء وسيارة حمراء
مع الماء في الخلفية.
- كتاب القصص مفتوح
- رجل يرتدي قميص أسود يعزف على الجيتار.
- source_sentence: يجلس شاب ذو شعر أشقر على الحائط يقرأ جريدة بينما تمر امرأة وفتاة
شابة.
sentences:
- ذكر شاب ينظر إلى جريدة بينما تمر إمرأتان بجانبه
- رجل يستلقي على وجهه على مقعد في الحديقة.
- الشاب نائم بينما الأم تقود ابنتها إلى الحديقة
pipeline_tag: sentence-similarity
model-index:
- name: SentenceTransformer based on intfloat/multilingual-e5-small
results:
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: sts test 384
type: sts-test-384
metrics:
- type: pearson_cosine
value: 0.7883137447514015
name: Pearson Cosine
- type: spearman_cosine
value: 0.7971624317482785
name: Spearman Cosine
- type: pearson_manhattan
value: 0.7845904338398069
name: Pearson Manhattan
- type: spearman_manhattan
value: 0.7939541836133244
name: Spearman Manhattan
- type: pearson_euclidean
value: 0.7882887522003604
name: Pearson Euclidean
- type: spearman_euclidean
value: 0.7971601260546269
name: Spearman Euclidean
- type: pearson_dot
value: 0.7883137483129774
name: Pearson Dot
- type: spearman_dot
value: 0.7971605875966696
name: Spearman Dot
- type: pearson_max
value: 0.7883137483129774
name: Pearson Max
- type: spearman_max
value: 0.7971624317482785
name: Spearman Max
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: sts test 256
type: sts-test-256
metrics:
- type: pearson_cosine
value: 0.7851969391652749
name: Pearson Cosine
- type: spearman_cosine
value: 0.7968026743946358
name: Spearman Cosine
- type: pearson_manhattan
value: 0.7852783784725356
name: Pearson Manhattan
- type: spearman_manhattan
value: 0.7935883492889713
name: Spearman Manhattan
- type: pearson_euclidean
value: 0.7882018230746569
name: Pearson Euclidean
- type: spearman_euclidean
value: 0.7963116553267949
name: Spearman Euclidean
- type: pearson_dot
value: 0.7786421988393841
name: Pearson Dot
- type: spearman_dot
value: 0.7867782644180616
name: Spearman Dot
- type: pearson_max
value: 0.7882018230746569
name: Pearson Max
- type: spearman_max
value: 0.7968026743946358
name: Spearman Max
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: sts test 128
type: sts-test-128
metrics:
- type: pearson_cosine
value: 0.7754967709350954
name: Pearson Cosine
- type: spearman_cosine
value: 0.7933453885370457
name: Spearman Cosine
- type: pearson_manhattan
value: 0.7832834632297865
name: Pearson Manhattan
- type: spearman_manhattan
value: 0.7907589269176767
name: Spearman Manhattan
- type: pearson_euclidean
value: 0.7867583047946054
name: Pearson Euclidean
- type: spearman_euclidean
value: 0.7935816990844704
name: Spearman Euclidean
- type: pearson_dot
value: 0.7317253736607925
name: Pearson Dot
- type: spearman_dot
value: 0.7335574962775742
name: Spearman Dot
- type: pearson_max
value: 0.7867583047946054
name: Pearson Max
- type: spearman_max
value: 0.7935816990844704
name: Spearman Max
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: sts test 64
type: sts-test-64
metrics:
- type: pearson_cosine
value: 0.7625204599039478
name: Pearson Cosine
- type: spearman_cosine
value: 0.7837078735068292
name: Spearman Cosine
- type: pearson_manhattan
value: 0.7752889433866854
name: Pearson Manhattan
- type: spearman_manhattan
value: 0.7790888579029828
name: Spearman Manhattan
- type: pearson_euclidean
value: 0.777961287133872
name: Pearson Euclidean
- type: spearman_euclidean
value: 0.7815940757356076
name: Spearman Euclidean
- type: pearson_dot
value: 0.6685094830550401
name: Pearson Dot
- type: spearman_dot
value: 0.6621206899696827
name: Spearman Dot
- type: pearson_max
value: 0.777961287133872
name: Pearson Max
- type: spearman_max
value: 0.7837078735068292
name: Spearman Max
---
# SentenceTransformer based on intfloat/multilingual-e5-small
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [intfloat/multilingual-e5-small](https://huggingface.co/intfloat/multilingual-e5-small) on the Omartificial-Intelligence-Space/arabic-n_li-triplet dataset. 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:** [intfloat/multilingual-e5-small](https://huggingface.co/intfloat/multilingual-e5-small)
- **Maximum Sequence Length:** 512 tokens
- **Output Dimensionality:** 384 tokens
- **Similarity Function:** Cosine Similarity
- **Training Dataset:**
- Omartificial-Intelligence-Space/arabic-n_li-triplet
### 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': 512, '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})
(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("Omartificial-Intelligence-Space/E5-Matro")
# Run inference
sentences = [
'يجلس شاب ذو شعر أشقر على الحائط يقرأ جريدة بينما تمر امرأة وفتاة شابة.',
'ذكر شاب ينظر إلى جريدة بينما تمر إمرأتان بجانبه',
'الشاب نائم بينما الأم تقود ابنتها إلى الحديقة',
]
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
#### Semantic Similarity
* Dataset: `sts-test-384`
* Evaluated with [EmbeddingSimilarityEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| pearson_cosine | 0.7883 |
| **spearman_cosine** | **0.7972** |
| pearson_manhattan | 0.7846 |
| spearman_manhattan | 0.794 |
| pearson_euclidean | 0.7883 |
| spearman_euclidean | 0.7972 |
| pearson_dot | 0.7883 |
| spearman_dot | 0.7972 |
| pearson_max | 0.7883 |
| spearman_max | 0.7972 |
#### Semantic Similarity
* Dataset: `sts-test-256`
* Evaluated with [EmbeddingSimilarityEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| pearson_cosine | 0.7852 |
| **spearman_cosine** | **0.7968** |
| pearson_manhattan | 0.7853 |
| spearman_manhattan | 0.7936 |
| pearson_euclidean | 0.7882 |
| spearman_euclidean | 0.7963 |
| pearson_dot | 0.7786 |
| spearman_dot | 0.7868 |
| pearson_max | 0.7882 |
| spearman_max | 0.7968 |
#### Semantic Similarity
* Dataset: `sts-test-128`
* Evaluated with [EmbeddingSimilarityEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| pearson_cosine | 0.7755 |
| **spearman_cosine** | **0.7933** |
| pearson_manhattan | 0.7833 |
| spearman_manhattan | 0.7908 |
| pearson_euclidean | 0.7868 |
| spearman_euclidean | 0.7936 |
| pearson_dot | 0.7317 |
| spearman_dot | 0.7336 |
| pearson_max | 0.7868 |
| spearman_max | 0.7936 |
#### Semantic Similarity
* Dataset: `sts-test-64`
* Evaluated with [EmbeddingSimilarityEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| pearson_cosine | 0.7625 |
| **spearman_cosine** | **0.7837** |
| pearson_manhattan | 0.7753 |
| spearman_manhattan | 0.7791 |
| pearson_euclidean | 0.778 |
| spearman_euclidean | 0.7816 |
| pearson_dot | 0.6685 |
| spearman_dot | 0.6621 |
| pearson_max | 0.778 |
| spearman_max | 0.7837 |
## Training Details
### Training Dataset
#### Omartificial-Intelligence-Space/arabic-n_li-triplet
* Dataset: Omartificial-Intelligence-Space/arabic-n_li-triplet
* Size: 557,850 training samples
* Columns: anchor
, positive
, and negative
* Approximate statistics based on the first 1000 samples:
| | anchor | positive | negative |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string | string |
| details |
شخص على حصان يقفز فوق طائرة معطلة
| شخص في الهواء الطلق، على حصان.
| شخص في مطعم، يطلب عجة.
|
| أطفال يبتسمون و يلوحون للكاميرا
| هناك أطفال حاضرون
| الاطفال يتجهمون
|
| صبي يقفز على لوح التزلج في منتصف الجسر الأحمر.
| الفتى يقوم بخدعة التزلج
| الصبي يتزلج على الرصيف
|
* Loss: [MatryoshkaLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
```json
{
"loss": "MultipleNegativesRankingLoss",
"matryoshka_dims": [
384,
256,
128,
64
],
"matryoshka_weights": [
1,
1,
1,
1
],
"n_dims_per_step": -1
}
```
### Evaluation Dataset
#### Omartificial-Intelligence-Space/arabic-n_li-triplet
* Dataset: Omartificial-Intelligence-Space/arabic-n_li-triplet
* Size: 6,584 evaluation samples
* Columns: anchor
, positive
, and negative
* Approximate statistics based on the first 1000 samples:
| | anchor | positive | negative |
|:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|
| type | string | string | string |
| details | امرأتان يتعانقان بينما يحملان حزمة
| إمرأتان يحملان حزمة
| الرجال يتشاجرون خارج مطعم
|
| طفلين صغيرين يرتديان قميصاً أزرق، أحدهما يرتدي الرقم 9 والآخر يرتدي الرقم 2 يقفان على خطوات خشبية في الحمام ويغسلان أيديهما في المغسلة.
| طفلين يرتديان قميصاً مرقماً يغسلون أيديهم
| طفلين يرتديان سترة يذهبان إلى المدرسة
|
| رجل يبيع الدونات لعميل خلال معرض عالمي أقيم في مدينة أنجليس
| رجل يبيع الدونات لعميل
| امرأة تشرب قهوتها في مقهى صغير
|
* Loss: [MatryoshkaLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
```json
{
"loss": "MultipleNegativesRankingLoss",
"matryoshka_dims": [
384,
256,
128,
64
],
"matryoshka_weights": [
1,
1,
1,
1
],
"n_dims_per_step": -1
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `per_device_train_batch_size`: 32
- `per_device_eval_batch_size`: 32
- `warmup_ratio`: 0.1
- `fp16`: True
- `batch_sampler`: no_duplicates
#### All Hyperparameters