---
language:
- multilingual
license: mit
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- dense
- generated_from_trainer
- dataset_size:74864
- loss:CoSENTLoss
base_model: intfloat/multilingual-e5-small
widget:
- source_sentence: Légumes mijotés Jardinière et haricots blancs
sentences:
- AMSCAN GOLD PLSTC FORKS | PARTY SUPPLY | 240 CT.
- 辣椒酱
- Pizza de verduras brasadas
- source_sentence: VTech Crazy Legs Learning Bugs, Pink
sentences:
- LEGO Creator Expert Garagem de Canto 10264 Kit de Construção, Novo 2019 (2569
Peças), Embalagem Sem Frustrações
- Silver Glitter Hanging Fans (4 ct)
- VTech Aspirateur Pop et Compte
- source_sentence: Pacon Tru-Ray Construction Paper, 18-Inches by 24-Inches, 50-Count,
Red (103094)
sentences:
- Funko POP Televisione Westworld Bernard Lowe Action figure
- Carta da costruzione Tru-Ray pesante, colori assortiti caldi, 12" x 18", 50 fogli
- Max Factory Kizuna Ai Figma Action Figure
- source_sentence: Zesty Cilantro Salsa, Medium
sentences:
- Melange de fruits
- Salsa de Texas
- T.S. Shure Rubber Band Powered Rescue Flier Model Plane Kit
- source_sentence: Fun World Angelic Maiden Child Costume
sentences:
- Melissa & Doug Personalized Pattern Blocks & Boards Classic Toy
- Winter sprats gerookt
- Rubie's Costume Co - Girls Gypsy Costume
pipeline_tag: sentence-similarity
library_name: sentence-transformers
metrics:
- cosine_accuracy@1
- cosine_accuracy@3
- cosine_accuracy@5
- cosine_accuracy@10
- cosine_precision@1
- cosine_precision@3
- cosine_precision@5
- cosine_precision@10
- cosine_recall@1
- cosine_recall@3
- cosine_recall@5
- cosine_recall@10
- cosine_ndcg@10
- cosine_mrr@10
- cosine_map@1
- cosine_map@3
- cosine_map@5
- cosine_map@10
model-index:
- name: multilingual-e5-small embeddings (CoSENTLoss on graded listwise pairs)
results:
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: ir eval
type: ir_eval
metrics:
- type: cosine_accuracy@1
value: 0.91015625
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.95703125
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.97265625
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 1.0
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.91015625
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.5104166666666666
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.40078125000000003
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.296875
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.13477527216379598
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.1739842681808551
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.1983227020362507
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.2486998357621607
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.4650339807377877
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.937943328373016
name: Cosine Mrr@10
- type: cosine_map@1
value: 0.91015625
name: Cosine Map@1
- type: cosine_map@3
value: 0.5282118055555556
name: Cosine Map@3
- type: cosine_map@5
value: 0.42098524305555557
name: Cosine Map@5
- type: cosine_map@10
value: 0.3311448220781368
name: Cosine Map@10
---
# multilingual-e5-small embeddings (CoSENTLoss on graded listwise pairs)
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [intfloat/multilingual-e5-small](https://huggingface.co/intfloat/multilingual-e5-small). 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:** 256 tokens
- **Output Dimensionality:** 384 dimensions
- **Similarity Function:** Cosine Similarity
- **Language:** multilingual
- **License:** mit
### 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': 256, 'do_lower_case': False, 'architecture': '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("Antix5/product-embed-multi-e5-small")
# Run inference
sentences = [
'Fun World Angelic Maiden Child Costume',
"Rubie's Costume Co - Girls Gypsy Costume",
'Melissa & Doug Personalized Pattern Blocks & Boards Classic Toy',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.7135, 0.6875],
# [0.7135, 1.0000, 0.6791],
# [0.6875, 0.6791, 1.0000]])
```
## Evaluation
### Metrics
#### Information Retrieval
* Dataset: `ir_eval`
* Evaluated with [InformationRetrievalEvaluator](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
| Metric | Value |
|:--------------------|:----------|
| cosine_accuracy@1 | 0.9102 |
| cosine_accuracy@3 | 0.957 |
| cosine_accuracy@5 | 0.9727 |
| cosine_accuracy@10 | 1.0 |
| cosine_precision@1 | 0.9102 |
| cosine_precision@3 | 0.5104 |
| cosine_precision@5 | 0.4008 |
| cosine_precision@10 | 0.2969 |
| cosine_recall@1 | 0.1348 |
| cosine_recall@3 | 0.174 |
| cosine_recall@5 | 0.1983 |
| cosine_recall@10 | 0.2487 |
| **cosine_ndcg@10** | **0.465** |
| cosine_mrr@10 | 0.9379 |
| cosine_map@1 | 0.9102 |
| cosine_map@3 | 0.5282 |
| cosine_map@5 | 0.421 |
| cosine_map@10 | 0.3311 |
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 74,864 training samples
* Columns: text1, text2, and label
* Approximate statistics based on the first 1000 samples:
| | text1 | text2 | label |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|
| type | string | string | float |
| details |
Premier 26764 Car Spinner, Santa, 25 by 19-1/2-Inch | Premier 26764 Tourbillon pour voiture, Santa, 25 x 19-1/2 pouces | 1.0 |
| Premier 26764 Car Spinner, Santa, 25 by 19-1/2-Inch | BNTS, ЧИПСЫ ИЗ ФАСОЛИ NV И МОРСКАЯ СОЛЬ | 0.0 |
| Premier 26764 Car Spinner, Santa, 25 by 19-1/2-Inch | Beanitos, Чипс из фасоли navy, Сыр на чо | 0.0 |
* Loss: [CoSENTLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosentloss) with these parameters:
```json
{
"scale": 20.0,
"similarity_fct": "pairwise_cos_sim"
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: steps
- `per_device_train_batch_size`: 32
- `per_device_eval_batch_size`: 256
- `learning_rate`: 2e-05
- `num_train_epochs`: 2
- `warmup_ratio`: 0.1
- `fp16`: True
- `batch_sampler`: no_duplicates
#### All Hyperparameters