---
base_model: BXresearch/DeBERTa2-0.9B-ST-v2
datasets:
- sentence-transformers/stsb
language:
- en
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
- cosine_accuracy
- cosine_accuracy_threshold
- cosine_f1
- cosine_f1_threshold
- cosine_precision
- cosine_recall
- cosine_ap
- dot_accuracy
- dot_accuracy_threshold
- dot_f1
- dot_f1_threshold
- dot_precision
- dot_recall
- dot_ap
- manhattan_accuracy
- manhattan_accuracy_threshold
- manhattan_f1
- manhattan_f1_threshold
- manhattan_precision
- manhattan_recall
- manhattan_ap
- euclidean_accuracy
- euclidean_accuracy_threshold
- euclidean_f1
- euclidean_f1_threshold
- euclidean_precision
- euclidean_recall
- euclidean_ap
- max_accuracy
- max_accuracy_threshold
- max_f1
- max_f1_threshold
- max_precision
- max_recall
- max_ap
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:5749
- loss:AnglELoss
widget:
- source_sentence: Left side of a silver train engine.
sentences:
- A close-up of a black train engine.
- Two boys are in midair jumping into an inground pool.
- An older Asian couple poses with a newborn baby at the dinner table.
- source_sentence: Four girls in swimsuits are playing volleyball at the beach.
sentences:
- A little girl is walking down a hallway.
- The man is erasing the chalk board.
- Four women in bikinis are playing volleyball on the beach.
- source_sentence: A woman is cooking meat.
sentences:
- The dogs are alone in the forest.
- A man is speaking.
- A dog jumps through a hoop.
- source_sentence: A person is folding a square paper piece.
sentences:
- A woman is carrying her baby.
- A person folds a piece of paper.
- A dog is trying to get through his dog door.
- source_sentence: The boy is playing the piano.
sentences:
- The woman is pouring oil into the pan.
- A small black and white dog is swimming in water.
- Two brown dogs are playing with each other in the snow.
model-index:
- name: SentenceTransformer based on BXresearch/DeBERTa2-0.9B-ST-v2
results:
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: sts test
type: sts-test
metrics:
- type: pearson_cosine
value: 0.9174070307741418
name: Pearson Cosine
- type: spearman_cosine
value: 0.9292509717696739
name: Spearman Cosine
- type: pearson_manhattan
value: 0.9282688885676256
name: Pearson Manhattan
- type: spearman_manhattan
value: 0.9298350652202988
name: Spearman Manhattan
- type: pearson_euclidean
value: 0.9286763713344532
name: Pearson Euclidean
- type: spearman_euclidean
value: 0.9301882421673056
name: Spearman Euclidean
- type: pearson_dot
value: 0.9015673628485675
name: Pearson Dot
- type: spearman_dot
value: 0.9062672614479156
name: Spearman Dot
- type: pearson_max
value: 0.9286763713344532
name: Pearson Max
- type: spearman_max
value: 0.9301882421673056
name: Spearman Max
- task:
type: binary-classification
name: Binary Classification
dataset:
name: allNLI dev
type: allNLI-dev
metrics:
- type: cosine_accuracy
value: 0.75390625
name: Cosine Accuracy
- type: cosine_accuracy_threshold
value: 0.7934484481811523
name: Cosine Accuracy Threshold
- type: cosine_f1
value: 0.6263736263736264
name: Cosine F1
- type: cosine_f1_threshold
value: 0.7287859916687012
name: Cosine F1 Threshold
- type: cosine_precision
value: 0.5643564356435643
name: Cosine Precision
- type: cosine_recall
value: 0.7037037037037037
name: Cosine Recall
- type: cosine_ap
value: 0.5952488621962656
name: Cosine Ap
- type: dot_accuracy
value: 0.74609375
name: Dot Accuracy
- type: dot_accuracy_threshold
value: 853.7699584960938
name: Dot Accuracy Threshold
- type: dot_f1
value: 0.6106194690265486
name: Dot F1
- type: dot_f1_threshold
value: 685.536865234375
name: Dot F1 Threshold
- type: dot_precision
value: 0.47586206896551725
name: Dot Precision
- type: dot_recall
value: 0.8518518518518519
name: Dot Recall
- type: dot_ap
value: 0.5773093883122924
name: Dot Ap
- type: manhattan_accuracy
value: 0.75390625
name: Manhattan Accuracy
- type: manhattan_accuracy_threshold
value: 654.8433227539062
name: Manhattan Accuracy Threshold
- type: manhattan_f1
value: 0.6244343891402715
name: Manhattan F1
- type: manhattan_f1_threshold
value: 811.658203125
name: Manhattan F1 Threshold
- type: manhattan_precision
value: 0.4928571428571429
name: Manhattan Precision
- type: manhattan_recall
value: 0.8518518518518519
name: Manhattan Recall
- type: manhattan_ap
value: 0.596555546112473
name: Manhattan Ap
- type: euclidean_accuracy
value: 0.75390625
name: Euclidean Accuracy
- type: euclidean_accuracy_threshold
value: 21.04879379272461
name: Euclidean Accuracy Threshold
- type: euclidean_f1
value: 0.6244343891402715
name: Euclidean F1
- type: euclidean_f1_threshold
value: 26.11341094970703
name: Euclidean F1 Threshold
- type: euclidean_precision
value: 0.4928571428571429
name: Euclidean Precision
- type: euclidean_recall
value: 0.8518518518518519
name: Euclidean Recall
- type: euclidean_ap
value: 0.595001077180561
name: Euclidean Ap
- type: max_accuracy
value: 0.75390625
name: Max Accuracy
- type: max_accuracy_threshold
value: 853.7699584960938
name: Max Accuracy Threshold
- type: max_f1
value: 0.6263736263736264
name: Max F1
- type: max_f1_threshold
value: 811.658203125
name: Max F1 Threshold
- type: max_precision
value: 0.5643564356435643
name: Max Precision
- type: max_recall
value: 0.8518518518518519
name: Max Recall
- type: max_ap
value: 0.596555546112473
name: Max Ap
- task:
type: binary-classification
name: Binary Classification
dataset:
name: Qnli dev
type: Qnli-dev
metrics:
- type: cosine_accuracy
value: 0.71484375
name: Cosine Accuracy
- type: cosine_accuracy_threshold
value: 0.7152643799781799
name: Cosine Accuracy Threshold
- type: cosine_f1
value: 0.7224334600760456
name: Cosine F1
- type: cosine_f1_threshold
value: 0.6804982423782349
name: Cosine F1 Threshold
- type: cosine_precision
value: 0.6785714285714286
name: Cosine Precision
- type: cosine_recall
value: 0.7723577235772358
name: Cosine Recall
- type: cosine_ap
value: 0.7550328500735501
name: Cosine Ap
- type: dot_accuracy
value: 0.69140625
name: Dot Accuracy
- type: dot_accuracy_threshold
value: 720.3964233398438
name: Dot Accuracy Threshold
- type: dot_f1
value: 0.7058823529411764
name: Dot F1
- type: dot_f1_threshold
value: 706.561279296875
name: Dot F1 Threshold
- type: dot_precision
value: 0.6442953020134228
name: Dot Precision
- type: dot_recall
value: 0.7804878048780488
name: Dot Recall
- type: dot_ap
value: 0.7012253433472802
name: Dot Ap
- type: manhattan_accuracy
value: 0.72265625
name: Manhattan Accuracy
- type: manhattan_accuracy_threshold
value: 760.7179565429688
name: Manhattan Accuracy Threshold
- type: manhattan_f1
value: 0.7279693486590038
name: Manhattan F1
- type: manhattan_f1_threshold
value: 807.8878173828125
name: Manhattan F1 Threshold
- type: manhattan_precision
value: 0.6884057971014492
name: Manhattan Precision
- type: manhattan_recall
value: 0.7723577235772358
name: Manhattan Recall
- type: manhattan_ap
value: 0.7705323139232185
name: Manhattan Ap
- type: euclidean_accuracy
value: 0.7265625
name: Euclidean Accuracy
- type: euclidean_accuracy_threshold
value: 25.634429931640625
name: Euclidean Accuracy Threshold
- type: euclidean_f1
value: 0.7244094488188976
name: Euclidean F1
- type: euclidean_f1_threshold
value: 25.634429931640625
name: Euclidean F1 Threshold
- type: euclidean_precision
value: 0.7022900763358778
name: Euclidean Precision
- type: euclidean_recall
value: 0.7479674796747967
name: Euclidean Recall
- type: euclidean_ap
value: 0.7674294690555423
name: Euclidean Ap
- type: max_accuracy
value: 0.7265625
name: Max Accuracy
- type: max_accuracy_threshold
value: 760.7179565429688
name: Max Accuracy Threshold
- type: max_f1
value: 0.7279693486590038
name: Max F1
- type: max_f1_threshold
value: 807.8878173828125
name: Max F1 Threshold
- type: max_precision
value: 0.7022900763358778
name: Max Precision
- type: max_recall
value: 0.7804878048780488
name: Max Recall
- type: max_ap
value: 0.7705323139232185
name: Max Ap
---
# SentenceTransformer based on BXresearch/DeBERTa2-0.9B-ST-v2
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [BXresearch/DeBERTa2-0.9B-ST-v2](https://huggingface.co/BXresearch/DeBERTa2-0.9B-ST-v2) on the [sentence-transformers/stsb](https://huggingface.co/datasets/sentence-transformers/stsb) dataset. It maps sentences & paragraphs to a 1536-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:** [BXresearch/DeBERTa2-0.9B-ST-v2](https://huggingface.co/BXresearch/DeBERTa2-0.9B-ST-v2)
- **Maximum Sequence Length:** 512 tokens
- **Output Dimensionality:** 1536 tokens
- **Similarity Function:** Cosine Similarity
- **Training Dataset:**
- [sentence-transformers/stsb](https://huggingface.co/datasets/sentence-transformers/stsb)
- **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: DebertaV2Model
(1): Pooling({'word_embedding_dimension': 1536, '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("bobox/DeBERTa2-0.9B-ST-stsb")
# Run inference
sentences = [
'The boy is playing the piano.',
'The woman is pouring oil into the pan.',
'A small black and white dog is swimming in water.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1536]
# 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.9174 |
| **spearman_cosine** | **0.9293** |
| pearson_manhattan | 0.9283 |
| spearman_manhattan | 0.9298 |
| pearson_euclidean | 0.9287 |
| spearman_euclidean | 0.9302 |
| pearson_dot | 0.9016 |
| spearman_dot | 0.9063 |
| pearson_max | 0.9287 |
| spearman_max | 0.9302 |
#### Binary Classification
* Dataset: `allNLI-dev`
* Evaluated with [BinaryClassificationEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.BinaryClassificationEvaluator)
| Metric | Value |
|:-----------------------------|:-----------|
| cosine_accuracy | 0.7539 |
| cosine_accuracy_threshold | 0.7934 |
| cosine_f1 | 0.6264 |
| cosine_f1_threshold | 0.7288 |
| cosine_precision | 0.5644 |
| cosine_recall | 0.7037 |
| cosine_ap | 0.5952 |
| dot_accuracy | 0.7461 |
| dot_accuracy_threshold | 853.77 |
| dot_f1 | 0.6106 |
| dot_f1_threshold | 685.5369 |
| dot_precision | 0.4759 |
| dot_recall | 0.8519 |
| dot_ap | 0.5773 |
| manhattan_accuracy | 0.7539 |
| manhattan_accuracy_threshold | 654.8433 |
| manhattan_f1 | 0.6244 |
| manhattan_f1_threshold | 811.6582 |
| manhattan_precision | 0.4929 |
| manhattan_recall | 0.8519 |
| manhattan_ap | 0.5966 |
| euclidean_accuracy | 0.7539 |
| euclidean_accuracy_threshold | 21.0488 |
| euclidean_f1 | 0.6244 |
| euclidean_f1_threshold | 26.1134 |
| euclidean_precision | 0.4929 |
| euclidean_recall | 0.8519 |
| euclidean_ap | 0.595 |
| max_accuracy | 0.7539 |
| max_accuracy_threshold | 853.77 |
| max_f1 | 0.6264 |
| max_f1_threshold | 811.6582 |
| max_precision | 0.5644 |
| max_recall | 0.8519 |
| **max_ap** | **0.5966** |
#### Binary Classification
* Dataset: `Qnli-dev`
* Evaluated with [BinaryClassificationEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.BinaryClassificationEvaluator)
| Metric | Value |
|:-----------------------------|:-----------|
| cosine_accuracy | 0.7148 |
| cosine_accuracy_threshold | 0.7153 |
| cosine_f1 | 0.7224 |
| cosine_f1_threshold | 0.6805 |
| cosine_precision | 0.6786 |
| cosine_recall | 0.7724 |
| cosine_ap | 0.755 |
| dot_accuracy | 0.6914 |
| dot_accuracy_threshold | 720.3964 |
| dot_f1 | 0.7059 |
| dot_f1_threshold | 706.5613 |
| dot_precision | 0.6443 |
| dot_recall | 0.7805 |
| dot_ap | 0.7012 |
| manhattan_accuracy | 0.7227 |
| manhattan_accuracy_threshold | 760.718 |
| manhattan_f1 | 0.728 |
| manhattan_f1_threshold | 807.8878 |
| manhattan_precision | 0.6884 |
| manhattan_recall | 0.7724 |
| manhattan_ap | 0.7705 |
| euclidean_accuracy | 0.7266 |
| euclidean_accuracy_threshold | 25.6344 |
| euclidean_f1 | 0.7244 |
| euclidean_f1_threshold | 25.6344 |
| euclidean_precision | 0.7023 |
| euclidean_recall | 0.748 |
| euclidean_ap | 0.7674 |
| max_accuracy | 0.7266 |
| max_accuracy_threshold | 760.718 |
| max_f1 | 0.728 |
| max_f1_threshold | 807.8878 |
| max_precision | 0.7023 |
| max_recall | 0.7805 |
| **max_ap** | **0.7705** |
## Training Details
### Training Dataset
#### sentence-transformers/stsb
* Dataset: [sentence-transformers/stsb](https://huggingface.co/datasets/sentence-transformers/stsb) at [ab7a5ac](https://huggingface.co/datasets/sentence-transformers/stsb/tree/ab7a5ac0e35aa22088bdcf23e7fd99b220e53308)
* Size: 5,749 training samples
* Columns: sentence1
, sentence2
, and score
* Approximate statistics based on the first 1000 samples:
| | sentence1 | sentence2 | score |
|:--------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------|
| type | string | string | float |
| details |
A plane is taking off.
| An air plane is taking off.
| 1.0
|
| A man is playing a large flute.
| A man is playing a flute.
| 0.76
|
| A man is spreading shreded cheese on a pizza.
| A man is spreading shredded cheese on an uncooked pizza.
| 0.76
|
* Loss: [AnglELoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#angleloss) with these parameters:
```json
{
"scale": 20.0,
"similarity_fct": "pairwise_angle_sim"
}
```
### Evaluation Dataset
#### sentence-transformers/stsb
* Dataset: [sentence-transformers/stsb](https://huggingface.co/datasets/sentence-transformers/stsb) at [ab7a5ac](https://huggingface.co/datasets/sentence-transformers/stsb/tree/ab7a5ac0e35aa22088bdcf23e7fd99b220e53308)
* Size: 512 evaluation samples
* Columns: sentence1
, sentence2
, and score
* Approximate statistics based on the first 1000 samples:
| | sentence1 | sentence2 | score |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|
| type | string | string | float |
| details | A man with a hard hat is dancing.
| A man wearing a hard hat is dancing.
| 1.0
|
| A young child is riding a horse.
| A child is riding a horse.
| 0.95
|
| A man is feeding a mouse to a snake.
| The man is feeding a mouse to the snake.
| 1.0
|
* Loss: [AnglELoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#angleloss) with these parameters:
```json
{
"scale": 20.0,
"similarity_fct": "pairwise_angle_sim"
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: steps
- `per_device_eval_batch_size`: 256
- `gradient_accumulation_steps`: 2
- `learning_rate`: 1.5e-05
- `weight_decay`: 5e-05
- `num_train_epochs`: 2
- `lr_scheduler_type`: cosine_with_min_lr
- `lr_scheduler_kwargs`: {'num_cycles': 0.5, 'min_lr': 2e-06}
- `warmup_ratio`: 0.2
- `save_safetensors`: False
- `fp16`: True
- `push_to_hub`: True
- `hub_model_id`: bobox/DeBERTa2-0.9B-ST-stsb-checkpoints-tmp
- `hub_strategy`: all_checkpoints
- `batch_sampler`: no_duplicates
#### All Hyperparameters