---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- loss:CosineSimilarityLoss
base_model: sentence-transformers/all-MiniLM-L6-v2
widget:
- source_sentence: Oracle Cloud - Infrastructure and Platform Services for Enterprises
sentences:
- PulseAudio - Ubuntu Wiki
- Documentation page not found - Read the Docs
- Dwarf Fortress beginner tips - Video Games on Sports Illustrated
- source_sentence: Suggest opt in User Test - Google Slides
sentences:
- ReleaseEngineering/TryServer - MozillaWiki
- Dwarf Fortress beginner tips - Video Games on Sports Illustrated
- Tutanota - Private Mailbox with End-to-End Encryption and Calendar
- source_sentence: https://portal.naviabenefits.com/part/prioritytasks.aspx
sentences:
- What to Expect - Pregnancy and Parenting Tips, Week-by-Week Guides
- Parents.com - Articles, Recipes, and Ideas for Family Activities
- Pinterest - Boards for Collecting and Sharing Inspiration on Any Topic
- source_sentence: Tidal - High-Fidelity Music Streaming with Master Quality Audio
sentences:
- Walmart - Everyday Low Prices on Groceries, Electronics, and More
- Notion - Integrated Workspace for Notes, Tasks, Databases, and Wikis
- Ambient Dreams Playlist on Amazon Music
pipeline_tag: sentence-similarity
library_name: sentence-transformers
metrics:
- pearson_cosine
- spearman_cosine
model-index:
- name: SentenceTransformer based on sentence-transformers/all-MiniLM-L6-v2
results:
- task:
type: semantic-similarity
name: Semantic Similarity
metrics:
- type: pearson_cosine
value: 0.982180856269761
name: Pearson Cosine
- type: spearman_cosine
value: 0.24020738836963906
name: Spearman Cosine
---
# 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:** 256 tokens
- **Output Dimensionality:** 384 dimensions
- **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': 256, '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("sentence_transformers_model_id")
# Run inference
sentences = [
'Tabletop Simulator Hub - Workshop Mods and Board Game Fans',
'PC Gamer Club - Official Community for PC Gaming Enthusiasts',
'Booking.com - Hotels, Homes, and Vacation Rentals Worldwide',
]
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
* Evaluated with [EmbeddingSimilarityEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| pearson_cosine | 0.9822 |
| **spearman_cosine** | **0.2402** |
## Training Details
### Training Dataset
* Size: 49,800 training samples
* Columns: sentence_0
, sentence_1
, and label
* Approximate statistics based on the first 1000 samples:
| | sentence_0 | sentence_1 | label |
|:--------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:---------------------------------------------------------------|
| type | string | string | float |
| details |
TripAdvisor - Hotel Reviews, Photos, and Travel Forums
| Docker Hub - Container Image Repository for DevOps Environments
| 0.0
|
| Mastodon - Decentralized Social Media for Niche Communities
| Allrecipes - User-Submitted Recipes, Reviews, and Cooking Tips
| 0.0
|
| YouTube Music - Music Videos, Official Albums, and Live Performances
| ESPN - Sports News, Live Scores, Stats, and Highlights
| 0.0
|
* Loss: [CosineSimilarityLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) with these parameters:
```json
{
"loss_fct": "torch.nn.modules.loss.MSELoss"
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `per_device_train_batch_size`: 32
- `per_device_eval_batch_size`: 32
- `num_train_epochs`: 6
- `multi_dataset_batch_sampler`: round_robin
#### All Hyperparameters