---
base_model: sentence-transformers/all-MiniLM-L6-v2
datasets:
- sentence-transformers/stsb
language:
- en
library_name: sentence-transformers
metrics:
- pearson_cosine
- spearman_cosine
- pearson_manhattan
- spearman_manhattan
- pearson_euclidean
- spearman_euclidean
- pearson_dot
- spearman_dot
- pearson_max
- spearman_max
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:101
- loss:CoSENTLoss
widget:
- source_sentence: The man is slicing a potato.
sentences:
- A woman is slicing carrot.
- Two women are singing.
- A man is slicing potato.
- source_sentence: A girl is playing a flute.
sentences:
- A woman stirs eggs in a bowl.
- A girl plays a wind instrument.
- A man is turning over tables in anger.
- source_sentence: People are playing baseball.
sentences:
- The cricket player hit the ball.
- A man breaks a stick.
- A woman is pouring a yellow mixture on a frying pan.
- source_sentence: A woman and man are riding in a car.
sentences:
- A woman driving a car is talking to the man seated beside her.
- A woman is placing skewered food onto a cooker.
- The man and woman are walking.
- source_sentence: A cat is on a robot.
sentences:
- A man is eating bread.
- A woman is pouring eyes into a bowl.
- A boy sits on a bed, sings and plays a guitar.
model-index:
- name: SentenceTransformer based on sentence-transformers/all-MiniLM-L6-v2
results:
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: sts dev
type: sts-dev
metrics:
- type: pearson_cosine
value: 0.9186522039312566
name: Pearson Cosine
- type: spearman_cosine
value: 0.9276278198564623
name: Spearman Cosine
- type: pearson_manhattan
value: 0.8991493568260668
name: Pearson Manhattan
- type: spearman_manhattan
value: 0.9320766471557739
name: Spearman Manhattan
- type: pearson_euclidean
value: 0.9014580823459483
name: Pearson Euclidean
- type: spearman_euclidean
value: 0.9289530024562572
name: Spearman Euclidean
- type: pearson_dot
value: 0.8789190604301875
name: Pearson Dot
- type: spearman_dot
value: 0.8957287815613981
name: Spearman Dot
- type: pearson_max
value: 0.9186522039312566
name: Pearson Max
- type: spearman_max
value: 0.9320766471557739
name: Spearman Max
---
# SentenceTransformer based on sentence-transformers/all-MiniLM-L6-v2
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2). 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:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2)
- **Maximum Sequence Length:** 512 tokens
- **Output Dimensionality:** 384 tokens
- **Similarity Function:** Cosine Similarity
- **Language:** en
### 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})
)
```
## 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("Husain/ramdam_fingerprint_embedding_model")
# Run inference
sentences = [
'A cat is on a robot.',
'A man is eating bread.',
'A woman is pouring eyes into a bowl.',
]
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-dev`
* Evaluated with [EmbeddingSimilarityEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| pearson_cosine | 0.9187 |
| **spearman_cosine** | **0.9276** |
| pearson_manhattan | 0.8991 |
| spearman_manhattan | 0.9321 |
| pearson_euclidean | 0.9015 |
| spearman_euclidean | 0.929 |
| pearson_dot | 0.8789 |
| spearman_dot | 0.8957 |
| pearson_max | 0.9187 |
| spearman_max | 0.9321 |
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 101 training samples
* Columns: sentence1
, sentence2
, and score
* Approximate statistics based on the first 101 samples:
| | sentence1 | sentence2 | score |
|:--------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------|
| type | string | string | float |
| details |
A plane is taking off.
| An air plane is taking off.
| 1.0
|
| A man is playing a large flute.
| A man is playing a flute.
| 0.76
|
| A man is spreading shreded cheese on a pizza.
| A man is spreading shredded cheese on an uncooked pizza.
| 0.76
|
* 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"
}
```
### Evaluation Dataset
#### stsb
* Dataset: [stsb](https://huggingface.co/datasets/sentence-transformers/stsb) at [ab7a5ac](https://huggingface.co/datasets/sentence-transformers/stsb/tree/ab7a5ac0e35aa22088bdcf23e7fd99b220e53308)
* Size: 1,500 evaluation samples
* Columns: sentence1
, sentence2
, and score
* Approximate statistics based on the first 1000 samples:
| | sentence1 | sentence2 | score |
|:--------|:---------------------------------------------------------------------------------|:--------------------------------------------------------------------------------|:---------------------------------------------------------------|
| type | string | string | float |
| details | A woman is riding on a horse.
| A man is turning over tables in anger.
| 0.0
|
| A man is screwing wood to a wall.
| A man is giving a woman a massage.
| 0.04
|
| A girl is playing a flute.
| A girl plays a wind instrument.
| 0.64
|
* 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
- `learning_rate`: 2e-05
- `num_train_epochs`: 10
- `warmup_ratio`: 0.1
- `save_only_model`: True
- `seed`: 33
- `fp16`: True
- `load_best_model_at_end`: True
#### All Hyperparameters