---
base_model: sentence-transformers/all-mpnet-base-v2
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@100
- dot_accuracy@1
- dot_accuracy@3
- dot_accuracy@5
- dot_accuracy@10
- dot_precision@1
- dot_precision@3
- dot_precision@5
- dot_precision@10
- dot_recall@1
- dot_recall@3
- dot_recall@5
- dot_recall@10
- dot_ndcg@10
- dot_mrr@10
- dot_map@100
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:48393
- loss:MultipleNegativesRankingLoss
widget:
- source_sentence: Tennis champ Rafael Nadal lunges to return a ball.
sentences:
- The tennis champ has decided to quit playing tennis.
- A woman stands alone at a restaurant.
- A blond woman running
- source_sentence: Small girl getting her face painted.
sentences:
- A Meijer in Illinois selling groceries.
- Two men are posing together.
- A small girl washing her face.
- source_sentence: because too too often they're can be extremism that that hurts
from from any direction regardless of whatever whatever you're arguing or concerned
about and
sentences:
- If you could stir the mothers, you are done.
- Extremism is bad.
- Steve Ballmer is a college friend of mine.
- source_sentence: The dog jumps over the log with a stick in its mouth.
sentences:
- A girl in red jumps outdoors.
- The dog is running around with something in it's mouth.
- The price is lower than what they pay.
- source_sentence: A man in black shirt sits on a stool while trying to sell stuffed
animals.
sentences:
- A man is sitting on a stool.
- A pooch runs through the grass.
- A young lady is sitting on a bench at the bus stop.
model-index:
- name: SentenceTransformer based on sentence-transformers/all-mpnet-base-v2
results:
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: eval
type: eval
metrics:
- type: cosine_accuracy@1
value: 0.0004959394953815635
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.36964023722439193
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.4739321802740066
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.5881015849399707
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.0004959394953815635
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.12321341240813066
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.09478643605480129
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.05881015849399707
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.0004959394953815635
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.36964023722439193
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.4739321802740066
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.5881015849399707
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.3037659752455345
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.2120033429995685
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.22559046634335145
name: Cosine Map@100
- type: dot_accuracy@1
value: 0.0005579319323042589
name: Dot Accuracy@1
- type: dot_accuracy@3
value: 0.3696609013700329
name: Dot Accuracy@3
- type: dot_accuracy@5
value: 0.4739321802740066
name: Dot Accuracy@5
- type: dot_accuracy@10
value: 0.5881429132312525
name: Dot Accuracy@10
- type: dot_precision@1
value: 0.0005579319323042589
name: Dot Precision@1
- type: dot_precision@3
value: 0.12322030045667762
name: Dot Precision@3
- type: dot_precision@5
value: 0.09478643605480132
name: Dot Precision@5
- type: dot_precision@10
value: 0.05881429132312524
name: Dot Precision@10
- type: dot_recall@1
value: 0.0005579319323042589
name: Dot Recall@1
- type: dot_recall@3
value: 0.3696609013700329
name: Dot Recall@3
- type: dot_recall@5
value: 0.4739321802740066
name: Dot Recall@5
- type: dot_recall@10
value: 0.5881429132312525
name: Dot Recall@10
- type: dot_ndcg@10
value: 0.30380430047413587
name: Dot Ndcg@10
- type: dot_mrr@10
value: 0.2120435150827015
name: Dot Mrr@10
- type: dot_map@100
value: 0.22562658480145822
name: Dot Map@100
---
# SentenceTransformer based on sentence-transformers/all-mpnet-base-v2
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/all-mpnet-base-v2](https://huggingface.co/sentence-transformers/all-mpnet-base-v2). It maps sentences & paragraphs to a 768-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-mpnet-base-v2](https://huggingface.co/sentence-transformers/all-mpnet-base-v2)
- **Maximum Sequence Length:** 384 tokens
- **Output Dimensionality:** 768 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': 384, 'do_lower_case': False}) with Transformer model: MPNetModel
(1): Pooling({'word_embedding_dimension': 768, '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("richie-ghost/sentence-transformers-all-mpnet-base-v2")
# Run inference
sentences = [
'A man in black shirt sits on a stool while trying to sell stuffed animals.',
'A man is sitting on a stool.',
'A young lady is sitting on a bench at the bus stop.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
```
## Evaluation
### Metrics
#### Information Retrieval
* Dataset: `eval`
* Evaluated with [InformationRetrievalEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| cosine_accuracy@1 | 0.0005 |
| cosine_accuracy@3 | 0.3696 |
| cosine_accuracy@5 | 0.4739 |
| cosine_accuracy@10 | 0.5881 |
| cosine_precision@1 | 0.0005 |
| cosine_precision@3 | 0.1232 |
| cosine_precision@5 | 0.0948 |
| cosine_precision@10 | 0.0588 |
| cosine_recall@1 | 0.0005 |
| cosine_recall@3 | 0.3696 |
| cosine_recall@5 | 0.4739 |
| cosine_recall@10 | 0.5881 |
| cosine_ndcg@10 | 0.3038 |
| cosine_mrr@10 | 0.212 |
| cosine_map@100 | 0.2256 |
| dot_accuracy@1 | 0.0006 |
| dot_accuracy@3 | 0.3697 |
| dot_accuracy@5 | 0.4739 |
| dot_accuracy@10 | 0.5881 |
| dot_precision@1 | 0.0006 |
| dot_precision@3 | 0.1232 |
| dot_precision@5 | 0.0948 |
| dot_precision@10 | 0.0588 |
| dot_recall@1 | 0.0006 |
| dot_recall@3 | 0.3697 |
| dot_recall@5 | 0.4739 |
| dot_recall@10 | 0.5881 |
| dot_ndcg@10 | 0.3038 |
| dot_mrr@10 | 0.212 |
| **dot_map@100** | **0.2256** |
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 48,393 training samples
* Columns: sentence_0
and sentence_1
* Approximate statistics based on the first 1000 samples:
| | sentence_0 | sentence_1 |
|:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string |
| details |
A group of kids in red and white playing soccer.
| There are kids playing ball in a soccer tournament.
|
| I had a great time at the theme park with my family.
| Did you have fun at the theme park with your family?
|
| A black and white elderly gentlemen riding an am-track.
| A man is on a train.
|
* Loss: [MultipleNegativesRankingLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
```json
{
"scale": 20.0,
"similarity_fct": "cos_sim"
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: steps
- `per_device_train_batch_size`: 16
- `per_device_eval_batch_size`: 16
- `num_train_epochs`: 4
- `multi_dataset_batch_sampler`: round_robin
#### All Hyperparameters