---
base_model: sentence-transformers/all-mpnet-base-v2
datasets: []
language: []
library_name: sentence-transformers
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:9306
- loss:CoSENTLoss
widget:
- source_sentence: What are the name, population, and life expectancy of the largest
Asian country by land?
sentences:
- Find the names and phone numbers of customers living in California state.
- What is the age of the doctor named Zach?
- What are the name and location of the cinema with the largest capacity?
- source_sentence: What are the titles of the cartoons sorted alphabetically?
sentences:
- What are the names of wines, sorted in alphabetical order?
- Find the first and last names of people who payed more than the rooms' base prices.
- What is the name of the track that has had the greatest number of races?
- source_sentence: What is the name of each continent and how many car makers are
there in each one?
sentences:
- What are the allergy types and how many allergies correspond to each one?
- List all people names in the order of their date of birth from old to young.
- Which city has the most customers living in?
- source_sentence: Give the flight numbers of flights arriving in Aberdeen.
sentences:
- Return the device carriers that do not have Android as their software platform.
- What are the names of the pilots that have not won any matches in Australia?
- Give the phones for departments in room 268.
- source_sentence: How many total tours were there for each ranking date?
sentences:
- What is the carrier of the most expensive phone?
- How many total pounds were purchased in the year 2018 at all London branches?
- Find the number of students for the cities where have more than one student.
---
# 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 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': 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("s2593817/sft-question-embedding")
# Run inference
sentences = [
'How many total tours were there for each ranking date?',
'How many total pounds were purchased in the year 2018 at all London branches?',
'What is the carrier of the most expensive phone?',
]
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
#### Unnamed Dataset
* Size: 9,306 training samples
* Columns: sentence1
, sentence2
, and score
* Approximate statistics based on the first 1000 samples:
| | sentence1 | sentence2 | score |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:-------------------------------------------------|
| type | string | string | int |
| details |
How many singers do we have?
| How many aircrafts do we have?
| 1
|
| What is the total number of singers?
| What is the total number of students?
| 1
|
| Show name, country, age for all singers ordered by age from the oldest to the youngest.
| List all people names in the order of their date of birth from old to young.
| 1
|
* Loss: [CoSENTLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosentloss) with these parameters:
```json
{
"scale": 20.0,
"similarity_fct": "pairwise_cos_sim"
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `per_device_train_batch_size`: 160
- `learning_rate`: 2e-05
- `num_train_epochs`: 100
- `warmup_ratio`: 0.2
- `fp16`: True
- `dataloader_num_workers`: 16
- `batch_sampler`: no_duplicates
#### All Hyperparameters