---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:18963
- loss:MultipleNegativesRankingLoss
base_model: sentence-transformers/paraphrase-mpnet-base-v2
widget:
- source_sentence: If the comatose man had previously expressed a desire to be euthanized
in such a situation, respecting his autonomy would support euthanasia.
sentences:
- If the comatose man had previously expressed a desire for euthanasia in such circumstances,
there may be a duty to respect his autonomy, which would support the action.
- If the man is believed to be suffering in his comatose state or there is a significant
burden on his family, there may be a duty to alleviate suffering that supports
euthanasia.
- As a living being, the rat may warrant a duty of care from humans, which may include
providing it with appropriate medical treatment or humane euthanasia in case of
suffering.
- source_sentence: Resisting authoritarianism can defend individual freedom and undermine
oppressive regimes.
sentences:
- Resisting authoritarianism can be a means of exercising the right to free speech
and expression, which may be suppressed by the government.
- If retreating serves to protect the lives of soldiers and civilians, then it upholds
the value of the duty to protect.
- Resisting authoritarianism could result in negative consequences for safety and
security if violence is used to resist.
- source_sentence: Saving someone upholds their fundamental right to life, as it prevents
them from experiencing harm or death.
sentences:
- Donating the money to charity has the potential to benefit those in need and can
be seen as fulfilling a duty to improve the well-being of others.
- Saving someone may preserve their freedom and ability to make choices in their
life.
- If saving someone involves protecting their body from injury or harm, their right
to bodily integrity is respected.
- source_sentence: Helping those in need, such as a starving person, promotes a sense
of community and responsibility towards fellow humans.
sentences:
- We have a moral responsibility to treat others with respect and dignity, regardless
of their race. Hanging out with black people allows for the opportunity to demonstrate
this respect.
- A starving person's right to life is at stake, and providing them with food can
help protect this fundamental right.
- Providing aid and resources to someone in need is an expression of the duty to
promote the well-being of others.
- source_sentence: The marriage of Baptiste and Hannah demonstrates their commitment
to sharing their lives and supporting one another.
sentences:
- Helping others may be a moral duty, but using unethical means like cheating goes
against other moral principles.
- If the marriage brings happiness to Baptiste and Hannah, then they are pursuing
their right to happiness.
- By getting married, Baptiste and Hannah take on a duty to care for each other,
both emotionally and materially.
pipeline_tag: sentence-similarity
library_name: sentence-transformers
---
# SentenceTransformer based on sentence-transformers/paraphrase-mpnet-base-v2
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2) on the train 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:** [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2)
- **Maximum Sequence Length:** 512 tokens
- **Output Dimensionality:** 768 dimensions
- **Similarity Function:** Cosine Similarity
- **Training Dataset:**
- train
### 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})
)
```
## 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 = [
'The marriage of Baptiste and Hannah demonstrates their commitment to sharing their lives and supporting one another.',
'By getting married, Baptiste and Hannah take on a duty to care for each other, both emotionally and materially.',
'If the marriage brings happiness to Baptiste and Hannah, then they are pursuing their right to happiness.',
]
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
#### train
* Dataset: train
* Size: 18,963 training samples
* Columns: anchor, positive, and negative
* Approximate statistics based on the first 1000 samples:
| | anchor | positive | negative |
|:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|
| type | string | string | string |
| details |
Saving the group of people from harm by diverting the trolley supports the value of preserving life. | The group of people tied to the tracks have a right to life, which is protected when the trolley is diverted to save them. | Diverting the trolley reduces overall harm by preventing the deaths of many people at the cost of one person's life. |
| The bake sale could be seen as an expression of support for a particular cause, and the right to freely express oneself and associate with others who share the same views is important. | The bake sale might be seen as a form of protest or support for a specific cause, and individuals have the right to engage in peaceful protest or show support. | If the bake sale directly or indirectly promotes religious discrimination, this can infringe on the fundamental right of individuals to be free from discrimination or harm due to their religious beliefs. |
| Children have a right to life, and saving them from danger upholds this right. | Children should be protected from harm, abuse, and danger, and saving them ensures this right is respected. | Children have a right to grow up with access to healthcare, education, and a nurturing environment. Saving them may help secure these rights. |
* Loss: [MultipleNegativesRankingLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
```json
{
"scale": 40,
"similarity_fct": "cos_sim"
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `overwrite_output_dir`: True
- `per_device_train_batch_size`: 32
- `learning_rate`: 2.1456771788455288e-05
- `num_train_epochs`: 2
- `warmup_ratio`: 0.03254893834779507
- `fp16`: True
- `dataloader_num_workers`: 4
- `remove_unused_columns`: False
#### All Hyperparameters