---
base_model: FacebookAI/roberta-large-mnli
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:72338
- loss:CosineSimilarityLoss
widget:
- source_sentence: Do I need to know HTML & CSS to learn javascript?
sentences:
- What Would the Piano Chords to "Winter, You Tease" by Layla be?
- Men playing a sport outside.
- How do I learn web development as quickly as possible?
- source_sentence: Isn't it inconsistent to prefer both a well-informed electorate
and an ignorant jury?
sentences:
- Some people like when the electorate is stupid.
- Two people working on computer
- How is 0+0+0+0+0+0+0…= undefined?
- source_sentence: A fluffy white and brown puppy is playing with a white, curly-haired
puppy.
sentences:
- Why is H2O liquid and H2S solid at room temperature?
- The bird is sitting in a nest.
- The puppies are playing together.
- source_sentence: A woman in a blue shirt and sunglasses dancing.
sentences:
- The woman is dancing.
- Is Qatar part of UAE?
- Two lovers walk together in Paris.
- source_sentence: A motorbike rider is barreling across a grass lawn.
sentences:
- The girl is wearing a shirt.
- Why doesn't Java have pointers?
- The rider is outdoors on a motorbike.
model-index:
- name: SentenceTransformer based on FacebookAI/roberta-large-mnli
results:
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: eval
type: eval
metrics:
- type: pearson_cosine
value: 0.8457307745816387
name: Pearson Cosine
- type: spearman_cosine
value: 0.810079801718123
name: Spearman Cosine
- type: pearson_manhattan
value: 0.8108388961642436
name: Pearson Manhattan
- type: spearman_manhattan
value: 0.7916598710432559
name: Spearman Manhattan
- type: pearson_euclidean
value: 0.8106363007947738
name: Pearson Euclidean
- type: spearman_euclidean
value: 0.7916399795577503
name: Spearman Euclidean
- type: pearson_dot
value: 0.8566895266416593
name: Pearson Dot
- type: spearman_dot
value: 0.8163029561419852
name: Spearman Dot
- type: pearson_max
value: 0.8566895266416593
name: Pearson Max
- type: spearman_max
value: 0.8163029561419852
name: Spearman Max
---
# SentenceTransformer based on FacebookAI/roberta-large-mnli
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [FacebookAI/roberta-large-mnli](https://huggingface.co/FacebookAI/roberta-large-mnli). It maps sentences & paragraphs to a 1024-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:** [FacebookAI/roberta-large-mnli](https://huggingface.co/FacebookAI/roberta-large-mnli)
- **Maximum Sequence Length:** 512 tokens
- **Output Dimensionality:** 1024 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: RobertaModel
(1): Pooling({'word_embedding_dimension': 1024, '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("richie-ghost/sbert_facebook_large_mnli_openVino2")
# Run inference
sentences = [
'A motorbike rider is barreling across a grass lawn.',
'The rider is outdoors on a motorbike.',
'The girl is wearing a shirt.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
```
## Evaluation
### Metrics
#### Semantic Similarity
* Dataset: `eval`
* Evaluated with [EmbeddingSimilarityEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
| Metric | Value |
|:-------------------|:-----------|
| pearson_cosine | 0.8457 |
| spearman_cosine | 0.8101 |
| pearson_manhattan | 0.8108 |
| spearman_manhattan | 0.7917 |
| pearson_euclidean | 0.8106 |
| spearman_euclidean | 0.7916 |
| pearson_dot | 0.8567 |
| spearman_dot | 0.8163 |
| pearson_max | 0.8567 |
| **spearman_max** | **0.8163** |
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 72,338 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 | int |
| details |
Hows would you create strategies and tactics in various combat situations?
| I have girlfriend and their parents accepted for my marriage, I m working in Nagpur but her parents wanted me to shift Bangalore? Is it valid wish?
| 0
|
| Man from the army speaking with civilian women.
| The man is a sergeant
| 0
|
| An old man with a white shirt and black pants sits on a chair in the opening of a stone tunnel.
| Someone has black pants.
| 1
|
* 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
- `num_train_epochs`: 4
- `multi_dataset_batch_sampler`: round_robin
#### All Hyperparameters