---
base_model: sentence-transformers/all-mpnet-base-v2
datasets: []
language: []
library_name: sentence-transformers
metrics:
- pearson_cosine
- spearman_cosine
- pearson_manhattan
- spearman_manhattan
- pearson_euclidean
- spearman_euclidean
- pearson_dot
- spearman_dot
- pearson_max
- spearman_max
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:17093
- loss:CosineSimilarityLoss
widget:
- source_sentence: In the realm of genetics , it is far better to be safe than sorry
.
sentences:
- Marijuana use harms the brain, and legalization will increase mental health problems.
- We are god now !
- Likewise , the proposal that addictive drugs should be legalized , regulated and
opened to " free market dynamics " is immediately belied by the recognition that
the drug market for an addict is no longer a free market – it is clear that they
will pay any price when needing their drug .
- source_sentence: The worldwide anti-nuclear power movement has provided enormous
stimulation to the Australian movement , and the decline in nuclear power expansion
since the late 1970s - due substantially to worldwide citizen opposition - has
been a great setback for Australian uranium mining interests .
sentences:
- Just as the state has the authority ( and duty ) to act justly in allocating scarce
resources , in meeting minimal needs of its ( deserving ) citizens , in defending
its citizens from violence and crime , and in not waging unjust wars ; so too
does it have the authority , flowing from its mission to promote justice and the
good of its people , to punish the criminal .
- The long lead times for construction that invalidate nuclear power as a way of
mitigating climate change was a point recognized in 2009 by the body whose mission
is to promote the use of nuclear power , the International Atomic Energy Agency
( IAEA ) .
- Gun control laws would reduce the societal costs associated with gun violence.
- source_sentence: Requiring uniforms enhances school security by permitting identification
of non-students who try to enter the campus .
sentences:
- Many students who are against school uniforms argue that they lose their â € ‹
self identity when they lose their right to express themselves through fashion
.
- If reproductive cloning is perfected , a quadriplegic can also choose to have
himself cloned , so someone can take his place .
- A higher minimum wage might also decrease turnover and thus keep training costs
down , supporters say .
- source_sentence: Minimum wage has long been a minimum standard of living .
sentences:
- A minimum wage job is suppose to be an entry level stepping stone – not a career
goal .
- It is argued that just as it would be permissible to " unplug " and thereby cause
the death of the person who is using one 's kidneys , so it is permissible to
abort the fetus ( who similarly , it is said , has no right to use one 's body
's life-support functions against one 's will ) .
- Abortion reduces welfare costs to taxpayers .
- source_sentence: Fanatics of the pro – life argument are sometimes so focused on
the fetus that they put no value to the mother ’s life and do not even consider
the viability of the fetus .
sentences:
- Life is life , whether it s outside the womb or not .
- Legalization of marijuana is phasing out black markets and taking money away from
drug cartels, organized crime, and street gangs.
- 'Response 2 : A child is not replaceable .'
model-index:
- name: SentenceTransformer based on sentence-transformers/all-mpnet-base-v2
results:
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: sts test
type: sts-test
metrics:
- type: pearson_cosine
value: 0.7294675022492696
name: Pearson Cosine
- type: spearman_cosine
value: 0.7234943835496113
name: Spearman Cosine
- type: pearson_manhattan
value: 0.7104391963353577
name: Pearson Manhattan
- type: spearman_manhattan
value: 0.7118078150763045
name: Spearman Manhattan
- type: pearson_euclidean
value: 0.7212412855224142
name: Pearson Euclidean
- type: spearman_euclidean
value: 0.7234943835496113
name: Spearman Euclidean
- type: pearson_dot
value: 0.7294674862347428
name: Pearson Dot
- type: spearman_dot
value: 0.7234943835496113
name: Spearman Dot
- type: pearson_max
value: 0.7294675022492696
name: Pearson Max
- type: spearman_max
value: 0.7234943835496113
name: Spearman Max
- type: pearson_cosine
value: 0.7146126101962849
name: Pearson Cosine
- type: spearman_cosine
value: 0.6886131469202397
name: Spearman Cosine
- type: pearson_manhattan
value: 0.7069653659670995
name: Pearson Manhattan
- type: spearman_manhattan
value: 0.6837201725651982
name: Spearman Manhattan
- type: pearson_euclidean
value: 0.7115078495768724
name: Pearson Euclidean
- type: spearman_euclidean
value: 0.6886131469202397
name: Spearman Euclidean
- type: pearson_dot
value: 0.7146126206763159
name: Pearson Dot
- type: spearman_dot
value: 0.6886131469202397
name: Spearman Dot
- type: pearson_max
value: 0.7146126206763159
name: Pearson Max
- type: spearman_max
value: 0.6886131469202397
name: Spearman Max
---
# 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:** 512 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': 512, '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("armaniii/all-mpnet-base-v2-augmentation-indomain-bm25-sts")
# Run inference
sentences = [
'Fanatics of the pro – life argument are sometimes so focused on the fetus that they put no value to the mother ’s life and do not even consider the viability of the fetus .',
'Life is life , whether it s outside the womb or not .',
'Legalization of marijuana is phasing out black markets and taking money away from drug cartels, organized crime, and street gangs.',
]
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
* Dataset: `sts-test`
* Evaluated with [EmbeddingSimilarityEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| pearson_cosine | 0.7295 |
| **spearman_cosine** | **0.7235** |
| pearson_manhattan | 0.7104 |
| spearman_manhattan | 0.7118 |
| pearson_euclidean | 0.7212 |
| spearman_euclidean | 0.7235 |
| pearson_dot | 0.7295 |
| spearman_dot | 0.7235 |
| pearson_max | 0.7295 |
| spearman_max | 0.7235 |
#### Semantic Similarity
* Dataset: `sts-test`
* Evaluated with [EmbeddingSimilarityEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| pearson_cosine | 0.7146 |
| **spearman_cosine** | **0.6886** |
| pearson_manhattan | 0.707 |
| spearman_manhattan | 0.6837 |
| pearson_euclidean | 0.7115 |
| spearman_euclidean | 0.6886 |
| pearson_dot | 0.7146 |
| spearman_dot | 0.6886 |
| pearson_max | 0.7146 |
| spearman_max | 0.6886 |
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 17,093 training samples
* Columns: sentence1
, sentence2
, and score
* Approximate statistics based on the first 1000 samples:
| | sentence1 | sentence2 | score |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:-----------------------------------------------------------------|
| type | string | string | float |
| details |
It is true that a Colorado study found a post-legalization increase in youths being treated for marijuana exposure .
| In Colorado , recent figures correlate with the years since marijuana legalization to show a dramatic decrease in overall highway fatalities – and a two-fold increase in the frequency of marijuana-positive drivers in fatal auto crashes .
| 0.4642857142857143
|
| The idea of a school uniform is that students wear the uniform at school , but do not wear the uniform , say , at a disco or other events outside school .
| If it means that the schoolrooms will be more orderly , more disciplined , and that our young people will learn to evaluate themselves by what they are on the inside instead of what they 're wearing on the outside , then our public schools should be able to require their students to wear school uniforms . "
| 0.5714285714285714
|
| The resulting embryonic stem cells could then theoretically be grown into adult cells to replace the ailing person 's mutated cells .
| However , there is a more serious , less cartoonish objection to turning procreation into manufacturing .
| 0.4464285714285714
|
* Loss: [CosineSimilarityLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) with these parameters:
```json
{
"loss_fct": "torch.nn.modules.loss.MSELoss"
}
```
### Evaluation Dataset
#### Unnamed Dataset
* Size: 340 evaluation samples
* Columns: sentence1
, sentence2
, and score
* Approximate statistics based on the first 1000 samples:
| | sentence1 | sentence2 | score |
|:--------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------|
| type | string | string | float |
| details | [ quoting himself from Furman v. Georgia , 408 U.S. 238 , 257 ( 1972 ) ] As such it is a penalty that ' subjects the individual to a fate forbidden by the principle of civilized treatment guaranteed by the [ Clause ] . '
| It provides a deterrent for prisoners already serving a life sentence .
| 0.3214285714285714
|
| Of those savings , $ 25.7 billion would accrue to state and local governments , while $ 15.6 billion would accrue to the federal government .
| Jaime Smith , deputy communications director for the governor ’s office , said , “ The legalization initiative was not driven by a desire for a revenue , but it has provided a small assist for our state budget . ”
| 0.5357142857142857
|
| If the uterus is designed to sustain an unborn child ’s life , do n’t unborn children have a right to receive nutrition and shelter through the one organ designed to provide them with that ordinary care ?
| We as parents are supposed to protect our children at all costs whether they are in the womb or not .
| 0.7678571428571428
|
* 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
- `eval_strategy`: steps
- `per_device_train_batch_size`: 16
- `per_device_eval_batch_size`: 16
- `warmup_ratio`: 0.1
- `bf16`: True
#### All Hyperparameters