---
base_model: google-bert/bert-base-uncased
datasets: []
language: []
library_name: sentence-transformers
metrics:
- cosine_accuracy
- dot_accuracy
- manhattan_accuracy
- euclidean_accuracy
- max_accuracy
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:91585
- loss:TripletLoss
widget:
- source_sentence: Why do people say "God bless you"?
sentences:
- Will the humanity become extinct?
- Why do people sneeze?
- Why do they say "God bless you" when you sneeze?
- source_sentence: What clarinet mouthpieces are the best?
sentences:
- What is the name of a good web design company in Delhi?
- Which instrument should I learn?
- Which clarinet mouthpiece should I buy?
- source_sentence: How do l see who viewed my videos on Instagram?
sentences:
- What is the possibility of time travel becoming a reality?
- Why can't I view a live video I posted on Facebook?
- How can I see who viewed my video on Instagram but didn't like my video?
- source_sentence: How can I become more social if I am an introvert?
sentences:
- What tricks can introverts learn to become more social?
- Nobody answers my questions on Quora, why?
- How did you become an introvert?
- source_sentence: How did Halloween Originate? What country did it originate on?
sentences:
- What was Halloween like in the 1990s?
- In what country did Halloween originate?
- What are the weirdest/creepiest dreams you have ever had?
model-index:
- name: SentenceTransformer based on google-bert/bert-base-uncased
results:
- task:
type: triplet
name: Triplet
dataset:
name: QQP nli dev
type: QQP-nli-dev
metrics:
- type: cosine_accuracy
value: 0.987814465408805
name: Cosine Accuracy
- type: dot_accuracy
value: 0.012382075471698114
name: Dot Accuracy
- type: manhattan_accuracy
value: 0.9874213836477987
name: Manhattan Accuracy
- type: euclidean_accuracy
value: 0.987814465408805
name: Euclidean Accuracy
- type: max_accuracy
value: 0.987814465408805
name: Max 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). 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 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: 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("hcy5561/distilroberta-base-sentence-transformer-triplets")
# Run inference
sentences = [
'How did Halloween Originate? What country did it originate on?',
'In what country did Halloween originate?',
'What was Halloween like in the 1990s?',
]
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: `QQP-nli-dev`
* Evaluated with [TripletEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.TripletEvaluator)
| Metric | Value |
|:-------------------|:-----------|
| cosine_accuracy | 0.9878 |
| dot_accuracy | 0.0124 |
| manhattan_accuracy | 0.9874 |
| euclidean_accuracy | 0.9878 |
| **max_accuracy** | **0.9878** |
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 91,585 training samples
* Columns: anchor
, positive
, and negative
* Approximate statistics based on the first 1000 samples:
| | anchor | positive | negative |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string | string |
| details |
How can I overcome a bad mood?
| How do I break out of a bad mood?
| The world around me seems so austere and gloomy because of my mood. It's depressing me considerably. What can I do?
|
| What are symptoms of mild schizophrenia?
| What are some symptoms of when you become schizophrenic?
| Is confusion another symptom of being schizophrenic?
|
| What are some ideas which transformed ordinary people into millionaires?
| What are some things ordinary people know but millionaires don't?
| What can billionaires do that millionaire cannot do?
|
* 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
#### Unnamed Dataset
* Size: 5,088 evaluation samples
* Columns: anchor
, positive
, and negative
* Approximate statistics based on the first 1000 samples:
| | anchor | positive | negative |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|
| type | string | string | string |
| details | Why do I see the exact same questions in my feed all the time?
| Why are too many questions repeating in my feed sometimes?
| Why does this "question" keep showing up in the Unorganized Questions global_feed? (see description for screenshot)
|
| Can we expect time travel to become a reality?
| Can we time travel anyhow?
| What do you hAve to say about time travel (I am not science student but I read it on net and its so exciting topic but still no clear idea that is it possible or it's just a rumour)?
|
| Is it too late to start medical school at 32?
| Is it too late to go to medical school at 24?
| As a 14 year old girl who wants to go to medical school, should I work extremely hard and study a lot now to be ready for it? What should I do?
|
* 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
- `per_device_train_batch_size`: 32
- `per_device_eval_batch_size`: 32
- `num_train_epochs`: 4
- `warmup_ratio`: 0.1
- `batch_sampler`: no_duplicates
#### All Hyperparameters