---
base_model: google-bert/bert-base-uncased
datasets:
- stanfordnlp/snli
language:
- en
library_name: sentence-transformers
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:494430
- loss:SoftmaxLoss
widget:
- source_sentence: A person out front of a business with a woman statue holding a
bottle.
sentences:
- A couple holds hands.
- The young boy is upside down.
- the man is baking some bread
- source_sentence: A person is dressed up in a weird costume with a red tongue sticking
out.
sentences:
- thhe man plays a tuba
- Four siblings are climbing on a fake black bear.
- the tongue is blue
- source_sentence: A man on a train is talking on a cellphone.
sentences:
- A man is playing a flute on a bus.
- The woman is sexy.
- two cyclists racing
- source_sentence: An elderly woman giving her daughter a hug.
sentences:
- There are two women hugging.
- A man holds a flag on the street.
- people are sitting on a red roofed bus going to a museum
- source_sentence: A pilot dressed in a dark-colored sweater is sitting in the cock-pit
of a plane with his hands crossed.
sentences:
- A pilot is sitting in his plain with his hands crossed
- The boys are playing outside on a log.
- Two men discuss their love lives.
---
# SentenceTransformer based on google-bert/bert-base-uncased
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [google-bert/bert-base-uncased](https://huggingface.co./google-bert/bert-base-uncased) on the [stanfordnlp/snli](https://huggingface.co./datasets/stanfordnlp/snli) dataset. 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:** [google-bert/bert-base-uncased](https://huggingface.co./google-bert/bert-base-uncased)
- **Maximum Sequence Length:** 512 tokens
- **Output Dimensionality:** 768 tokens
- **Similarity Function:** Cosine Similarity
- **Training Dataset:**
- [stanfordnlp/snli](https://huggingface.co./datasets/stanfordnlp/snli)
- **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': 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})
)
```
## 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("hcy5561/distilroberta-base-sentence-transformer-snli")
# Run inference
sentences = [
'A pilot dressed in a dark-colored sweater is sitting in the cock-pit of a plane with his hands crossed.',
'A pilot is sitting in his plain with his hands crossed',
'The boys are playing outside on a log.',
]
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]
```
## Training Details
### Training Dataset
#### stanfordnlp/snli
* Dataset: [stanfordnlp/snli](https://huggingface.co./datasets/stanfordnlp/snli) at [cdb5c3d](https://huggingface.co./datasets/stanfordnlp/snli/tree/cdb5c3d5eed6ead6e5a341c8e56e669bb666725b)
* Size: 494,430 training samples
* Columns: premise
, hypothesis
, and label
* Approximate statistics based on the first 1000 samples:
| | premise | hypothesis | label |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:-------------------------------------------------------------------|
| type | string | string | int |
| details |
Two men, one in yellow, are on a wooden boat.
| Two men swimming in water
| 2
|
| Two people sleep on a couch.
| Two people are asleep.
| 0
|
| a little boy is learning to swim with the help of a float board.
| The boy is crawling.
| 2
|
* Loss: [SoftmaxLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#softmaxloss)
### Evaluation Dataset
#### stanfordnlp/snli
* Dataset: [stanfordnlp/snli](https://huggingface.co./datasets/stanfordnlp/snli) at [cdb5c3d](https://huggingface.co./datasets/stanfordnlp/snli/tree/cdb5c3d5eed6ead6e5a341c8e56e669bb666725b)
* Size: 27,468 evaluation samples
* Columns: premise
, hypothesis
, and label
* Approximate statistics based on the first 1000 samples:
| | premise | hypothesis | label |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:-------------------------------------------------------------------|
| type | string | string | int |
| details | A taxi cab driver looks stressed out in his car.
| a taxi driver is stressed
| 0
|
| Two men do trick in a park.
| The men only sat on the bench in the park, doing nothing.
| 2
|
| Two woman walking, the blond is looking at the camera wearing sunglasses making an oh face.
| One lady makes a shocked face at the camera as the photographer tells the women they are lost.
| 1
|
* Loss: [SoftmaxLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#softmaxloss)
### Training Hyperparameters
#### Non-Default Hyperparameters
- `per_device_train_batch_size`: 64
- `per_device_eval_batch_size`: 64
- `num_train_epochs`: 4
- `warmup_ratio`: 0.1
- `batch_sampler`: no_duplicates
#### All Hyperparameters