---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:50000
- loss:CosineSimilarityLoss
base_model: google-bert/bert-base-uncased
widget:
- source_sentence: Sometimes the people who represent themselves don't even know the
significant facts of their case.
sentences:
- The law is very easy to understand, so representing yourself in court is the best
way to win a case.
- Sewage poured into upstairs windows from the streets while people whispered to
each other.
- His faith may be lacking.
- source_sentence: When he married in 1901, he and his wife (Olga Knipper of the Moscow
Art Theater) went directly from the ceremony to a honeymoon in a sanitarium.
sentences:
- if a person wants to eat you understand that
- 'His wife has never went to a sanitarium. '
- The new system appears far more complex, but ultimately easier and more thorough.
- source_sentence: it really is i heard something that their supposed to be starting
a huge campaign in New York about um child abuse and stopping child abuse and
it's supposed to be like it's starting there supposed to be like a big nationwide
campaign and you know so hopefully that will take off and really do something
i don't know there's just
sentences:
- The Washington Post was the first company to report on attempts of private companies
growing embryos.
- Me too?
- It's unfortunate that nobody is organizing a child abuse campaign.
- source_sentence: On the mainland, an invasion of even greater significance followed
in 1580, when Philip II of Spain proclaimed himself king of Portugal and marched
his armies across the border.
sentences:
- Some of the modern buildings that were erected in their place are not admired
today.
- Jon wanted to save them from the angry mob.
- Philip II of Spain invaded Portugal.
- source_sentence: The river plays a central role in all visits to Paris.
sentences:
- He said Dave Hanson.
- The river is central to all vacations to Paris.
- Trauma is the leading cause of alcohol abuse.
pipeline_tag: sentence-similarity
library_name: sentence-transformers
metrics:
- pearson_cosine
- spearman_cosine
model-index:
- name: SentenceTransformer based on google-bert/bert-base-uncased
results:
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: Unknown
type: unknown
metrics:
- type: pearson_cosine
value: 0.7301988757371918
name: Pearson Cosine
- type: spearman_cosine
value: 0.7323168725786805
name: Spearman Cosine
---
# 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). 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 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': 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("ryanhoangt/bert-base-uncased-mnli-cosine")
# Run inference
sentences = [
'The river plays a central role in all visits to Paris.',
'The river is central to all vacations to Paris.',
'Trauma is the leading cause of alcohol abuse.',
]
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
#### Semantic Similarity
* Evaluated with [EmbeddingSimilarityEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| pearson_cosine | 0.7302 |
| **spearman_cosine** | **0.7323** |
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 50,000 training samples
* Columns: sentence1
, sentence2
, and label
* Approximate statistics based on the first 1000 samples:
| | sentence1 | sentence2 | label |
|:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|
| type | string | string | float |
| details |
Conceptually cream skimming has two basic dimensions - product and geography.
| Product and geography are what make cream skimming work.
| 0.0
|
| you know during the season and i guess at at your level uh you lose them to the next level if if they decide to recall the the parent team the Braves decide to call to recall a guy from triple A then a double A guy goes up to replace him and a single A guy goes up to replace him
| You lose the things to the following level if the people recall.
| 1.0
|
| One of our number will carry out your instructions minutely.
| A member of my team will execute your orders with immense precision.
| 1.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`: 1
- `warmup_steps`: 100
- `fp16`: True
#### All Hyperparameters