---
language:
- en
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:101762
- loss:TripletLoss
base_model: google-bert/bert-base-uncased
widget:
- source_sentence: Why am I still afraid of the dark?
sentences:
- What one single change can change a life?
- Why do we have a dark side?
- Why are humans afraid of the dark?
- source_sentence: How did you feel when you had sex for the first time?
sentences:
- What do you mean by hypocrite?
- What is the feeling to have sexual intercourse at the first time?
- What does receiving anal sex for the first time feel like?
- source_sentence: How much sleep do we really need as an adult in a night?
sentences:
- What does histrionic personality disorder feel like physically to you?
- How much hours should we sleep daily?
- How do you sleep 7 hours a day?
- source_sentence: How can I learn English from the beginning?
sentences:
- Why am I learning English?
- How do you post a question on Quora?
- How do I learn English?
- source_sentence: How can I open my computer if I forget my password?
sentences:
- What's my state Id number?
- I forgot my security code on my Nokia 206 how can I unlock it?
- I forget my PC password what should I do to open it?
datasets:
- embedding-data/QQP_triplets
pipeline_tag: sentence-similarity
library_name: sentence-transformers
metrics:
- cosine_accuracy
model-index:
- name: SentenceTransformer based on google-bert/bert-base-uncased
results:
- task:
type: triplet
name: Triplet
dataset:
name: sentest
type: sentest
metrics:
- type: cosine_accuracy
value: 0.9882572889328003
name: Cosine Accuracy
---
# SentenceTransformer based on google-bert/bert-base-uncased
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [google-bert/bert-base-uncased](https://huggingface.co/google-bert/bert-base-uncased) on the [qqp_triplets](https://huggingface.co/datasets/embedding-data/QQP_triplets) dataset. 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:** [google-bert/bert-base-uncased](https://huggingface.co/google-bert/bert-base-uncased)
- **Maximum Sequence Length:** 512 tokens
- **Output Dimensionality:** 768 dimensions
- **Similarity Function:** Cosine Similarity
- **Training Dataset:**
- [qqp_triplets](https://huggingface.co/datasets/embedding-data/QQP_triplets)
- **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: BertModel
(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("palusi/sentest")
# Run inference
sentences = [
'How can I open my computer if I forget my password?',
'I forget my PC password what should I do to open it?',
'I forgot my security code on my Nokia 206 how can I unlock it?',
]
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
#### Triplet
* Dataset: `sentest`
* Evaluated with [TripletEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.TripletEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| **cosine_accuracy** | **0.9883** |
## Training Details
### Training Dataset
#### qqp_triplets
* Dataset: [qqp_triplets](https://huggingface.co/datasets/embedding-data/QQP_triplets) at [f475d9c](https://huggingface.co/datasets/embedding-data/QQP_triplets/tree/f475d9ca10f6eae1f39e756d14610ce7c5bb515c)
* Size: 101,762 training samples
* Columns: anchor
, positive
, and negative
* Approximate statistics based on the first 1000 samples:
| | anchor | positive | negative |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string | string |
| details |
Who are Mona Punjabi?
| Who are Mona punjabis?
| Why are Punjabis so proud of their Punjabi-hood?
|
| What are some of the best books on/by Bill Gates?
| What are the best books of Bill Gates?
| Are there any films about Bill Gates?
|
| Where can I get best pasta in Bangalore?
| Where can I get best pasta in Bangalore ?
| Where can I get best street food in Bangalore?
|
* Loss: [TripletLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#tripletloss) with these parameters:
```json
{
"distance_metric": "TripletDistanceMetric.EUCLIDEAN",
"triplet_margin": 5
}
```
### Evaluation Dataset
#### qqp_triplets
* Dataset: [qqp_triplets](https://huggingface.co/datasets/embedding-data/QQP_triplets) at [f475d9c](https://huggingface.co/datasets/embedding-data/QQP_triplets/tree/f475d9ca10f6eae1f39e756d14610ce7c5bb515c)
* Size: 101,762 evaluation samples
* Columns: anchor
, positive
, and negative
* Approximate statistics based on the first 1000 samples:
| | anchor | positive | negative |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string | string |
| details | How do l study efficiently?
| How do you study effectively?
| Why can't I study efficiently?
|
| How do you commit suicide?
| What is the easiest way to commite suicide?
| What is a way to commit suicide and not damaging your organs so that they can be donated?
|
| How do you learn to speak a foreign language?
| What is the quickest way a person can learn to speak a new language fluently?
| What's the easiest foreign language for a native English speaker, living in America, to learn to speak?
|
* Loss: [TripletLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#tripletloss) with these parameters:
```json
{
"distance_metric": "TripletDistanceMetric.EUCLIDEAN",
"triplet_margin": 5
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: steps
- `per_device_train_batch_size`: 16
- `per_device_eval_batch_size`: 16
- `learning_rate`: 2e-05
- `weight_decay`: 0.01
- `num_train_epochs`: 1
- `warmup_ratio`: 0.1
- `fp16`: True
- `load_best_model_at_end`: True
- `push_to_hub`: True
- `hub_model_id`: palusi/sentest
- `batch_sampler`: no_duplicates
#### All Hyperparameters