---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- dense
- generated_from_trainer
- dataset_size:44114
- loss:ContrastiveLoss
widget:
- source_sentence: The Sadrist movement left the Alliance before the elections in
December 2005 , which also brought the Iraqi National Congress more firmly to
the Alliance .
sentences:
- The Iraqi National Congress left the Alliance before the December 2005 elections
, which also brought the Sadrist movement more to the Alliance .
- He pioneered important developments in the style of sculpting in wood , parallel
to those driven by Filippo Parodi in marble sculpture and Domenico Piola in painting
.
- The Mine South Deep is a large mine in the northern part of Gauteng in South Africa
.
- source_sentence: Mike Monroney was challenged by A.S. Thomas in the Democratic Prefix
in 1950 .
sentences:
- was challenged in 1950 by A.S. Mike Monroney in the Democratic Primary .
- The T helper cells then activate the B cells , which are also in the presence
of these antigens , causing the production of autoantibodies .
- Illinois Route 158 , or Washington Avenue , leads west to Columbia and east to
Belleville .
- source_sentence: Morrow can mean either the next day in particular or the future
in general .
sentences:
- Brockton is located approximately 25 miles northeast of Providence , Rhode Island
and 30 miles south of Boston .
- He had been in the state playing for Melbourne , but moved to Victoria in 1925
and appointed New Town .
- Morrow can either mean the next day in general , or the future in particular .
- source_sentence: Fotbal Club Forex Braşov was a Romanian professional club from
Braşov , Romania , who was founded in October 2002 and was dissolved in 2011 .
sentences:
- Fotbal Club Forex Braşov was a Romanian professional club from Braşov , Romania
, which was dissolved in October 2002 and was founded in 2011 .
- Nate decides to struggle for Ricky and confirms his love for her .
- Ricardo Lingan Baccay was ordained a priest on April 10 , 1987 by Diosdado Aenlle
Talamayan .
- source_sentence: He was born in July 1973 in Petroupoli ( Athens ) .
sentences:
- Carmen Aub Romero ( born October 24 , 1989 in Mexico City , DF , Mexico ) is a
Mexican actress .
- He was born in Athens in July 1973 ( Petroupoli ) .
- At the age of nine , Garcia appeared in his first concert and since then has appeared
alone or with his aunt and his uncle in all parts of France .
pipeline_tag: sentence-similarity
library_name: sentence-transformers
metrics:
- cosine_accuracy
- cosine_accuracy_threshold
- cosine_f1
- cosine_f1_threshold
- cosine_precision
- cosine_recall
- cosine_ap
- cosine_mcc
model-index:
- name: SentenceTransformer
results:
- task:
type: binary-classification
name: Binary Classification
dataset:
name: paws val deberta
type: paws-val-deberta
metrics:
- type: cosine_accuracy
value: 0.9121457489878543
name: Cosine Accuracy
- type: cosine_accuracy_threshold
value: 0.8481842279434204
name: Cosine Accuracy Threshold
- type: cosine_f1
value: 0.9024280575539567
name: Cosine F1
- type: cosine_f1_threshold
value: 0.8432618379592896
name: Cosine F1 Threshold
- type: cosine_precision
value: 0.8860927152317881
name: Cosine Precision
- type: cosine_recall
value: 0.9193770041227668
name: Cosine Recall
- type: cosine_ap
value: 0.9503471324249102
name: Cosine Ap
- type: cosine_mcc
value: 0.8230430822451054
name: Cosine Mcc
---
# SentenceTransformer
This is a [sentence-transformers](https://www.SBERT.net) model trained. 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
- **Maximum Sequence Length:** 64 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/huggingface/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': 64, 'do_lower_case': False, 'architecture': 'DebertaV2Model'})
(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 = [
'He was born in July 1973 in Petroupoli ( Athens ) .',
'He was born in Athens in July 1973 ( Petroupoli ) .',
'At the age of nine , Garcia appeared in his first concert and since then has appeared alone or with his aunt and his uncle in all parts of France .',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.9386, 0.5843],
# [0.9386, 1.0000, 0.5614],
# [0.5843, 0.5614, 1.0000]])
```
## Evaluation
### Metrics
#### Binary Classification
* Dataset: `paws-val-deberta`
* Evaluated with [BinaryClassificationEvaluator](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.BinaryClassificationEvaluator)
| Metric | Value |
|:--------------------------|:-----------|
| cosine_accuracy | 0.9121 |
| cosine_accuracy_threshold | 0.8482 |
| cosine_f1 | 0.9024 |
| cosine_f1_threshold | 0.8433 |
| cosine_precision | 0.8861 |
| cosine_recall | 0.9194 |
| **cosine_ap** | **0.9503** |
| cosine_mcc | 0.823 |
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 44,114 training samples
* Columns: sentence_0, sentence_1, and label
* Approximate statistics based on the first 1000 samples:
| | sentence_0 | sentence_1 | label |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|
| type | string | string | float |
| details |
The Song of Ceylon is a 1934 British documentary film produced by Basil Wright and directed by John Grierson for the Ceylon Tea Propaganda Board . | The Song of Ceylon is a British documentary film directed by Basil Wright by John Grierson for the Ceylon Tea Propaganda Board in 1934 . | 0.0 |
| The two leased aircraft were returned to the BAE Systems lessor on 9 November 2006 . | Centavia 's two leased aircraft were returned to the lessor , BAE Systems , on November 9 , 2006 . | 1.0 |
| When , in 1818 , Ortona was assigned to Lanciano , Campli was joined to the diocese of Teramo . | When Ortona was assigned to Lanciano in 1818 , Campli was connected to the Diocese of Teramo . | 1.0 |
* Loss: [ContrastiveLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#contrastiveloss) with these parameters:
```json
{
"distance_metric": "SiameseDistanceMetric.COSINE_DISTANCE",
"margin": 0.5,
"size_average": true
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `per_device_train_batch_size`: 16
- `per_device_eval_batch_size`: 16
- `num_train_epochs`: 2
- `multi_dataset_batch_sampler`: round_robin
#### All Hyperparameters