---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:49500
- loss:MultipleNegativesRankingLoss
base_model: prestoai/qwen3-embedding-0.6b-arabic-ecom
widget:
- source_sentence: 'Instruct: Given an Arabic e-commerce search query, retrieve the
product that best matches it
Query: عناية بالفم'
sentences:
- تن ريقا بزيت الزيتون 160جم
- Foramen Denture Clean Box
- صبغة شعر L'Oréal Paris - 5.45 Excellence
- source_sentence: 'Instruct: Given an Arabic e-commerce search query, retrieve the
product that best matches it
Query: بسكويت شوكولاتة بالحليب'
sentences:
- بسكويت - Bahlsen
- حقيبة هدايا - RA040
- Cicabio Arnica+ - Bioderma
- source_sentence: 'Instruct: Given an Arabic e-commerce search query, retrieve the
product that best matches it
Query: بيتر صودا'
sentences:
- ميرندا صودا
- زبدة فول السوداني حدائق كاليفورنيا ناعمه - 510 غ
- مشروب بيتر صودا - ميرندا
- source_sentence: 'Instruct: Given an Arabic e-commerce search query, retrieve the
product that best matches it
Query: شيجلام بودرة'
sentences:
- بودرة SHEGLAM - High Coverage Linen
- برايمر فائق الترطيب - SHEGLAM
- سباتلة حجم صغير تريبولي سنتر
- source_sentence: 'Instruct: Given an Arabic e-commerce search query, retrieve the
product that best matches it
Query: عطور نسائية'
sentences:
- تن الوفاء سكيب جاك بالزيت الزيتون - 160 غ
- مجموعة عطر نسائي - ابراهيم القرشي سكر
- قبعة رجالية - 07
pipeline_tag: sentence-similarity
library_name: sentence-transformers
---
# SentenceTransformer based on prestoai/qwen3-embedding-0.6b-arabic-ecom
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [prestoai/qwen3-embedding-0.6b-arabic-ecom](https://huggingface.co/prestoai/qwen3-embedding-0.6b-arabic-ecom) on the pairs_with_negatives and positives datasets. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for retrieval.
## Model Details
### Model Description
- **Model Type:** Sentence Transformer
- **Base model:** [prestoai/qwen3-embedding-0.6b-arabic-ecom](https://huggingface.co/prestoai/qwen3-embedding-0.6b-arabic-ecom)
- **Maximum Sequence Length:** 128 tokens
- **Output Dimensionality:** 1024 dimensions
- **Similarity Function:** Cosine Similarity
- **Supported Modality:** Text
- **Training Datasets:**
- pairs_with_negatives
- positives
### Model Sources
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
### Full Model Architecture
```
SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'Qwen3Model'})
(1): Pooling({'embedding_dimension': 1024, 'pooling_mode': 'lasttoken', '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("leafxyz/main_v2")
# Run inference
queries = [
'Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it\nQuery: عطور نسائية',
]
documents = [
'مجموعة عطر نسائي - ابراهيم القرشي سكر',
'قبعة رجالية - 07',
'تن الوفاء سكيب جاك بالزيت الزيتون - 160 غ',
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings.shape)
# [1, 1024] [3, 1024]
# Get the similarity scores for the embeddings
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
# tensor([[ 0.5593, -0.0069, 0.0400]])
```
## Training Details
### Training Datasets
#### pairs_with_negatives
* Dataset: pairs_with_negatives
* Size: 9,900 training samples
* Columns: anchor, positive, and negative
* Approximate statistics based on the first 1000 samples:
| | anchor | positive | negative |
|:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string | string |
| details |
Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: زيت بابايا WKL | زيت جسم - WKL Papaya | زيت جسم - Vaseline Cocoa |
| Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: منكير | اظافر هيفا - TWINKLE | اظافر هيفا - SPARKLE |
| Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: توب فريش حفاضات | توب فريش حفاضات رقم 1 - 44 قطعة | توب فريش حفاضات رقم 2 - 40 قطعة |
* Loss: [MultipleNegativesRankingLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
```json
{
"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
}
```
#### positives
* Dataset: positives
* Size: 39,600 training samples
* Columns: anchor and positive
* Approximate statistics based on the first 1000 samples:
| | anchor | positive |
|:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string |
| details | Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: نبي فيكسول ارجواني | منظف الحمام الذكي فيكسول ارجواني - 900 مل |
| Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: شربة نجمة اريغي 500 | شربة نجمة اريغي - 500 غ |
| Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: Gas relife drops | Gas relife drops |
* Loss: [MultipleNegativesRankingLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
```json
{
"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
}
```
### Evaluation Datasets
#### pairs_with_negatives
* Dataset: pairs_with_negatives
* Size: 100 evaluation samples
* Columns: anchor, positive, and negative
* Approximate statistics based on the first 100 samples:
| | anchor | positive | negative |
|:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|
| type | string | string | string |
| details | Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: عناية بالجسم | معطر جسم وشعر نسائي - Sol de Janeiro Água Mística | قارورة عصير - AS02 |
| Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: بخاخ تشيكو 100 مل | بخاخ تشيكو للحماية من البعوض - 100 مل | مناديل الحماية من البعوض تشيكو - 20 قطعة |
| Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: بخاخ مانع التصاق | بخاخ الطبخ بنكهة الفلفل مانع للالتصاق - 200 مل | بخاخ الطبخ بنكهة الثوم مانع للالتصاق - 200 مل |
* Loss: [MultipleNegativesRankingLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
```json
{
"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
}
```
#### positives
* Dataset: positives
* Size: 400 evaluation samples
* Columns: anchor and positive
* Approximate statistics based on the first 400 samples:
| | anchor | positive |
|:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string |
| details | Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: سوار نسائي ذهبي | سوار نسائي - DX052 |
| Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: سناكس | شوكلاتة كندر ترونكي 8*48 |
| Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: مشروب حليب | حليب - Safi |
* Loss: [MultipleNegativesRankingLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
```json
{
"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
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `gradient_accumulation_steps`: 4
- `learning_rate`: 3e-05
- `num_train_epochs`: 1
- `warmup_steps`: 0.05
- `fp16`: True
- `dataloader_num_workers`: 2
- `gradient_checkpointing`: True
#### All Hyperparameters