---
base_model: intfloat/multilingual-e5-small
datasets: []
language: []
library_name: sentence-transformers
metrics:
- cosine_accuracy
- dot_accuracy
- manhattan_accuracy
- euclidean_accuracy
- max_accuracy
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:509
- loss:TripletLoss
widget:
- source_sentence: How to create a PowerPoint presentation?
sentences:
- Steps to make a presentation in PowerPoint
- How to create a spreadsheet in Excel?
- Steps to get a Canadian visa
- source_sentence: When was the first World War?
sentences:
- Capital city of Brazil
- When was the Vietnam War?
- Dates of World War I
- source_sentence: How can I make a chocolate cake?
sentences:
- World's tallest mountain
- How do I bake a chocolate cake?
- How can I make a vanilla cake?
- source_sentence: Who wrote 'Pride and Prejudice'?
sentences:
- Steps to cultivate tomatoes at home
- Author of 'Pride and Prejudice'
- Who wrote 'Moby Dick'?
- source_sentence: What is the population of New York City?
sentences:
- New York City's population in 2023
- What is the population of Los Angeles?
- Total number of planets in our solar system
model-index:
- name: SentenceTransformer based on intfloat/multilingual-e5-small
results:
- task:
type: triplet
name: Triplet
dataset:
name: my evaluator
type: my_evaluator
metrics:
- type: cosine_accuracy
value: 0.98
name: Cosine Accuracy
- type: dot_accuracy
value: 0.02
name: Dot Accuracy
- type: manhattan_accuracy
value: 0.98
name: Manhattan Accuracy
- type: euclidean_accuracy
value: 0.98
name: Euclidean Accuracy
- type: max_accuracy
value: 0.98
name: Max Accuracy
---
# 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). 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
### 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("srikarvar/fine_tuned_model")
# Run inference
sentences = [
'What is the population of New York City?',
"New York City's population in 2023",
'What is the population of Los Angeles?',
]
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
#### Triplet
* Dataset: `my_evaluator`
* Evaluated with [TripletEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.TripletEvaluator)
| Metric | Value |
|:-------------------|:---------|
| cosine_accuracy | 0.98 |
| dot_accuracy | 0.02 |
| manhattan_accuracy | 0.98 |
| euclidean_accuracy | 0.98 |
| **max_accuracy** | **0.98** |
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 509 training samples
* Columns: sentence_0
, sentence_1
, sentence_2
, and label
* Approximate statistics based on the first 1000 samples:
| | sentence_0 | sentence_1 | sentence_2 | label |
|:--------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:-----------------------------|
| type | string | string | string | int |
| details |
What is the chemical formula for carbon dioxide?
| Chemical composition of carbon dioxide
| What is the chemical formula for methane?
| 1
|
| What is the speed of a bullet train?
| Maximum speed of a bullet train
| What is the speed of a jet plane?
| 1
|
| What is the chemical name for vitamin C?
| Scientific name for vitamin C
| What is the chemical name for vitamin D?
| 1
|
* Loss: [TripletLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#tripletloss) with these parameters:
```json
{
"distance_metric": "TripletDistanceMetric.EUCLIDEAN",
"triplet_margin": 5
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: steps
- `per_device_train_batch_size`: 16
- `per_device_eval_batch_size`: 16
- `multi_dataset_batch_sampler`: round_robin
#### All Hyperparameters