---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:342061
- loss:CachedMultipleNegativesRankingLoss
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: نسونكس Spray'
sentences:
- Nasonex - Nasal Spray
- كابل شحن مايكرو XKIN - 2.4A
- حلوى الشوكولاتة - Choco Lapki
- source_sentence: 'Instruct: Given an Arabic e-commerce search query, retrieve the
product that best matches it
Query: مكرونة رقم 42'
sentences:
- بنطلون رجالي - 0112
- حقيبة حزام خصر - 4862
- مكرونة الجيد معكوفة رقم 42 - 500 غ
- source_sentence: 'Instruct: Given an Arabic e-commerce search query, retrieve the
product that best matches it
Query: سباغيتي'
sentences:
- ملعب كرة قدم - DD18
- مكرونة معكوفة - Favelli
- مكرونة سباغيتي - Favelli
- source_sentence: 'Instruct: Given an Arabic e-commerce search query, retrieve the
product that best matches it
Query: جبنة هواء'
sentences:
- جبنة - ابو الولد
- جبنة - Hawaa
- كاني طعام كلاب البالغين دجاج - 3 ك
- source_sentence: 'Instruct: Given an Arabic e-commerce search query, retrieve the
product that best matches it
Query: شاحن تايب سي للسيارة'
sentences:
- شاحن سيارة قرين ليون مدخلين 36 وات مع كابل تايب سي - CBK
- صوص المكرونة هاينز - 365 غ
- بسكويت جولون بدون سكر شكلاتة ساندوتش
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("sentence_transformers_model_id")
# Run inference
queries = [
'Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it\nQuery: شاحن تايب سي للسيارة',
]
documents = [
'شاحن سيارة قرين ليون مدخلين 36 وات مع كابل تايب سي - CBK',
'بسكويت جولون بدون سكر شكلاتة ساندوتش',
'صوص المكرونة هاينز - 365 غ',
]
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.6773, -0.0849, -0.0875]])
```
## Training Details
### Training Datasets
#### pairs_with_negatives
* Dataset: pairs_with_negatives
* Size: 124,261 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: واقي للوجه دهني | Anthelios Oil Control (Dry Touch) - La Roche Posay | Anthelios Invisible Mist (Dry Touch) - La Roche Posay |
| Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: تن منارة زليتن | تن منارة زليتن بزيت دوار الشمس - 160 غ | تن فاني بزيت دوار الشمس - 160 غ |
| Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: فانتا زجاجة صغيرة | مشروب فانتا برتقال زجاجة - 330 مل | مشروب فانتا - 1 ل (برتقال) |
* Loss: [CachedMultipleNegativesRankingLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cachedmultiplenegativesrankingloss) with these parameters:
```json
{
"scale": 20.0,
"similarity_fct": "cos_sim",
"mini_batch_size": 8,
"gather_across_devices": false,
"directions": [
"query_to_doc"
],
"partition_mode": "joint",
"hardness_mode": null,
"hardness_strength": 0.0
}
```
#### positives
* Dataset: positives
* Size: 217,800 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: نحب جبنة القرية | ميرسين جبنة القرية 200 جم |
| Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: كابل شحن مايكرو Moxom A2.4 | كابل شحن مايكرو Moxom - A2.4 |
| Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: dry idea | Dry idea (powder fresh) |
* Loss: [CachedMultipleNegativesRankingLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cachedmultiplenegativesrankingloss) with these parameters:
```json
{
"scale": 20.0,
"similarity_fct": "cos_sim",
"mini_batch_size": 8,
"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: 1,256 evaluation 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: هيبوتك بوزن | عطر Hypnotic Poison - PERFECTO COLLECTION | عطر Poison Girl - Dior |
| Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: شاحن مايكرو 2.4A | شحن مايكرو Smila - 2.4A | شحن تايب سي Smila - 2.4A |
| Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: تمر صعيدي | تمر صعيدي مشفوط | تمر قصيم مشفوط |
* Loss: [CachedMultipleNegativesRankingLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cachedmultiplenegativesrankingloss) with these parameters:
```json
{
"scale": 20.0,
"similarity_fct": "cos_sim",
"mini_batch_size": 8,
"gather_across_devices": false,
"directions": [
"query_to_doc"
],
"partition_mode": "joint",
"hardness_mode": null,
"hardness_strength": 0.0
}
```
#### positives
* Dataset: positives
* Size: 2,200 evaluation 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: حاملة أدوات القطط | حاملة أدوات القطة - AA04 |
| Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: كريم شمس أطفال | واقي شمس كريمي - Chicco |
| Instruct: Given an Arabic e-commerce search query, retrieve the product that best matches it
Query: كانديسارتان هيدروكلوروثيازيد | Candesartan and Hydrochlorothiazide 16mg/12.5mg |
* Loss: [CachedMultipleNegativesRankingLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cachedmultiplenegativesrankingloss) with these parameters:
```json
{
"scale": 20.0,
"similarity_fct": "cos_sim",
"mini_batch_size": 8,
"gather_across_devices": false,
"directions": [
"query_to_doc"
],
"partition_mode": "joint",
"hardness_mode": null,
"hardness_strength": 0.0
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `per_device_train_batch_size`: 32
- `learning_rate`: 0.0001
- `num_train_epochs`: 1
- `warmup_steps`: 0.05
- `fp16`: True
#### All Hyperparameters