---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:2351
- loss:CosineSimilarityLoss
base_model: sentence-transformers/all-mpnet-base-v2
widget:
- source_sentence: Are your thoughts sometimes so strong that you can almost hear
them?
sentences:
- My emotions have almost always seemed flat regardless of what is going on around
me.
- Having powerful images or memories that sometimes come into your mind in which
you feel the experience is happening again in the here and now?
- I often think that I hear people talking only to discover that there was no one
there.
- source_sentence: Having difficulty concentrating?
sentences:
- My thoughts are so hazy and unclear that I wish that I could just reach up and
put them into place.
- Most of the time I find it is very difficult to get my thoughts in order.
- Experienced sleep disturbances?
- source_sentence: Feeling jumpy or easily startled?
sentences:
- I often worry that someone or something is controlling my behavior.
- People find my conversations to be confusing or hard to follow.
- Worried a lot about different things?
- source_sentence: Do you often have to keep an eye out to stop people from taking
advantage of you?
sentences:
- I find that I am very often confused about what is going on around me.
- I sometimes wonder if there is a small group of people who can control everyone
else's behavior.
- I have sometimes felt that strangers were reading my mind.
- source_sentence: I am not good at expressing my true feelings by the way I talk
and look.
sentences:
- Felt down or depressed for most of the day
- Felt nervous or anxious?
- Experienced sleep disturbances?
pipeline_tag: sentence-similarity
library_name: sentence-transformers
metrics:
- pearson_cosine
- spearman_cosine
model-index:
- name: SentenceTransformer based on sentence-transformers/all-mpnet-base-v2
results:
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: Unknown
type: unknown
metrics:
- type: pearson_cosine
value: 0.5680489773046146
name: Pearson Cosine
- type: spearman_cosine
value: 0.5532689999140259
name: Spearman Cosine
---
# 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:** 384 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': 384, '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("sentence_transformers_model_id")
# Run inference
sentences = [
'I am not good at expressing my true feelings by the way I talk and look.',
'Felt nervous or anxious?',
'Experienced sleep disturbances?',
]
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.568 |
| **spearman_cosine** | **0.5533** |
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 2,351 training samples
* Columns: sentence1
, sentence2
, and score
* Approximate statistics based on the first 1000 samples:
| | sentence1 | sentence2 | score |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|
| type | string | string | float |
| details |
Do you believe in telepathy (mind-reading)?
| I believe that there are secret signs in the world if you just know how to look for them.
| 0.15
|
| Irritable behavior, angry outbursts, or acting aggressively?
| Felt “on edge”?
| 0.62
|
| I have some eccentric (odd) habits.
| I often have difficulty following what someone is saying to me.
| 0.0
|
* Loss: [CosineSimilarityLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) with these parameters:
```json
{
"loss_fct": "torch.nn.modules.loss.L1Loss"
}
```
### Evaluation Dataset
#### Unnamed Dataset
* Size: 236 evaluation samples
* Columns: sentence1
, sentence2
, and score
* Approximate statistics based on the first 236 samples:
| | sentence1 | sentence2 | score |
|:--------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|
| type | string | string | float |
| details | Feeling afraid as if something awful might happen?
| I have trouble following conversations with others.
| 0.19
|
| Do you believe in telepathy (mind-reading)?
| Feeling jumpy or easily startled?
| 0.1
|
| Other people see me as slightly eccentric (odd).
| I have felt that there were messages for me in the way things were arranged, like furniture in a room.
| 0.0
|
* Loss: [CosineSimilarityLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) with these parameters:
```json
{
"loss_fct": "torch.nn.modules.loss.L1Loss"
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: steps
- `per_device_train_batch_size`: 16
#### All Hyperparameters