---
base_model: UKPLab/triple-encoders-dailydialog
datasets: []
language: []
library_name: sentence-transformers
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:985575
- loss:CosineSimilarityTripleEncoderLoss
- loss:ContrastiveLoss
widget:
- source_sentence: A small white and tan dog licking up peanut butter.
sentences:
- Someone is making dinner in the kitchen.
- Someone put peanut butter on the dog's nose because that's always good for a laugh.
- Two dogs are eating food from a bowl in a kitchen
- source_sentence: A person in a heavy coat shoveling snow.
sentences:
- Someone is holding a rocket launcher.
- An old person is shoveling snow.
- The private bar's pro bono work was supported by the judges.
- source_sentence: '[B1] [O] [BEFORE] '
sentences:
- '[B2] [E] [BEFORE] '
- '[B2] [O] [BEFORE] e'
- '[AFTER] u'
- source_sentence: '[B1] [E] [BEFORE] e'
sentences:
- '[B2] [O] [BEFORE] :'
- '[B2] [O] [BEFORE] t'
- '[AFTER] C'
- source_sentence: '[B1] [O] [BEFORE] s'
sentences:
- '[B2] [O] [BEFORE] o'
- '[B2] [E] [BEFORE] '
- '[AFTER] u'
---
# SentenceTransformer based on UKPLab/triple-encoders-dailydialog
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [UKPLab/triple-encoders-dailydialog](https://huggingface.co/UKPLab/triple-encoders-dailydialog). It maps sentences & paragraphs to a 1024-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:** [UKPLab/triple-encoders-dailydialog](https://huggingface.co/UKPLab/triple-encoders-dailydialog)
- **Maximum Sequence Length:** 512 tokens
- **Output Dimensionality:** 1024 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': 1024, '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("abhiraj1/eval_triple_encoder")
# Run inference
sentences = [
'[B1] [O] [BEFORE] s',
'[B2] [E] [BEFORE] ',
'[AFTER] u',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
```
## Training Details
### Training Datasets
#### Unnamed Dataset
* Size: 43,506 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 | float |
| details |
[B1] [O] [BEFORE]
| [B2] [E] [BEFORE]
| [AFTER] u
| 0.0
|
| [B1] [E] [BEFORE] e
| [B2] [O] [BEFORE] :
| [AFTER] C
| 0.0
|
| [B1] [O] [BEFORE] s
| [B2] [E] [BEFORE]
| [AFTER] u
| 0.6000000000000001
|
* Loss: triple_encoders.losses.CosineSimilarityTripleEncoderLoss.CosineSimilarityTripleEncoderLoss
#### Unnamed Dataset
* Size: 942,069 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 | int |
| details | And the reason Lincoln and his goons had shown up? Well, not everybody was full of respect.
| Lincoln didn't show up.
| 0
|
| a rally car driving down a roadway with people on the side taking pictures
| People on the side of road taking picture of a rally car driving down
| 1
|
| The dog is wearing a purple cape.
| THE ANIMAL IS IN A PAGEANT
| 2
|
* Loss: [ContrastiveLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#contrastiveloss) with these parameters:
```json
{
"distance_metric": "SiameseDistanceMetric.COSINE_DISTANCE",
"margin": 0.5,
"size_average": true
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `per_device_train_batch_size`: 16
- `per_device_eval_batch_size`: 16
- `num_train_epochs`: 1
- `multi_dataset_batch_sampler`: round_robin
#### All Hyperparameters