pjbhaumik's picture
Add new SentenceTransformer model.
23faa01 verified
---
language: []
library_name: sentence-transformers
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- dataset_size:10K<n<100K
- loss:MultipleNegativesSymmetricRankingLoss
base_model: distilbert/distilbert-base-uncased
metrics:
- pearson_cosine
- spearman_cosine
- pearson_manhattan
- spearman_manhattan
- pearson_euclidean
- spearman_euclidean
- pearson_dot
- spearman_dot
- pearson_max
- spearman_max
widget:
- source_sentence: what is GOGO
sentences:
- What is Viasat
- are we flying into Tel Aviv
- how do i correct a name in term
- source_sentence: What is EU 261
sentences:
- is puj a EU compensation country
- can i take my bicycle on af
- flight delays over 6 hours
- source_sentence: Can i get wifi
sentences:
- which aircrafts do not have wifi
- military traveling with pet
- baggage delay to carousel
- source_sentence: austin airport
sentences:
- What time is IAH open
- amex card free checked bag
- what is upgrade companion
- source_sentence: pets in cargo
sentences:
- can a pet travel in cargo
- baggage exceptions for Amex
- how do I get sky priority
pipeline_tag: sentence-similarity
model-index:
- name: SentenceTransformer based on distilbert/distilbert-base-uncased
results:
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: eval examples
type: eval_examples
metrics:
- type: pearson_cosine
value: .nan
name: Pearson Cosine
- type: spearman_cosine
value: .nan
name: Spearman Cosine
- type: pearson_manhattan
value: .nan
name: Pearson Manhattan
- type: spearman_manhattan
value: .nan
name: Spearman Manhattan
- type: pearson_euclidean
value: .nan
name: Pearson Euclidean
- type: spearman_euclidean
value: .nan
name: Spearman Euclidean
- type: pearson_dot
value: .nan
name: Pearson Dot
- type: spearman_dot
value: .nan
name: Spearman Dot
- type: pearson_max
value: .nan
name: Pearson Max
- type: spearman_max
value: .nan
name: Spearman Max
---
# SentenceTransformer based on distilbert/distilbert-base-uncased
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [distilbert/distilbert-base-uncased](https://huggingface.co/distilbert/distilbert-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:** [distilbert/distilbert-base-uncased](https://huggingface.co/distilbert/distilbert-base-uncased) <!-- at revision 12040accade4e8a0f71eabdb258fecc2e7e948be -->
- **Maximum Sequence Length:** 512 tokens
- **Output Dimensionality:** 768 tokens
- **Similarity Function:** Cosine Similarity
<!-- - **Training Dataset:** Unknown -->
<!-- - **Language:** Unknown -->
<!-- - **License:** Unknown -->
### 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: DistilBertModel
(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("pjbhaumik/biencoder-finetune-model-v9")
# Run inference
sentences = [
'pets in cargo',
'can a pet travel in cargo',
'baggage exceptions for Amex',
]
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]
```
<!--
### Direct Usage (Transformers)
<details><summary>Click to see the direct usage in Transformers</summary>
</details>
-->
<!--
### Downstream Usage (Sentence Transformers)
You can finetune this model on your own dataset.
<details><summary>Click to expand</summary>
</details>
-->
<!--
### Out-of-Scope Use
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
-->
## Evaluation
### Metrics
#### Semantic Similarity
* Dataset: `eval_examples`
* Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
| Metric | Value |
|:-------------------|:--------|
| pearson_cosine | nan |
| spearman_cosine | nan |
| pearson_manhattan | nan |
| spearman_manhattan | nan |
| pearson_euclidean | nan |
| spearman_euclidean | nan |
| pearson_dot | nan |
| spearman_dot | nan |
| pearson_max | nan |
| **spearman_max** | **nan** |
<!--
## Bias, Risks and Limitations
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
-->
<!--
### Recommendations
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
-->
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 15,488 training samples
* Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>label</code>
* Approximate statistics based on the first 1000 samples:
| | sentence_0 | sentence_1 | label |
|:--------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:-----------------------------|
| type | string | string | int |
| details | <ul><li>min: 4 tokens</li><li>mean: 10.4 tokens</li><li>max: 47 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 10.14 tokens</li><li>max: 37 tokens</li></ul> | <ul><li>1: 100.00%</li></ul> |
* Samples:
| sentence_0 | sentence_1 | label |
|:-----------------------------------------------------------------|:-------------------------------------------------------------------------------------|:---------------|
| <code>how to use a companion certificate on delta.com</code> | <code>SHOPPING ON DELTA.COM FOR AMEX CERT</code> | <code>1</code> |
| <code>is jamaica can be booked with companion certificate</code> | <code>what areas can the American Express companion certificate be applied to</code> | <code>1</code> |
| <code>how do i book award travel on klm</code> | <code>can you book an air france ticket with miles</code> | <code>1</code> |
* Loss: [<code>MultipleNegativesSymmetricRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativessymmetricrankingloss) with these parameters:
```json
{
"scale": 20.0,
"similarity_fct": "cos_sim"
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: steps
- `per_device_train_batch_size`: 16
- `per_device_eval_batch_size`: 16
- `num_train_epochs`: 12
- `multi_dataset_batch_sampler`: round_robin
#### All Hyperparameters
<details><summary>Click to expand</summary>
- `overwrite_output_dir`: False
- `do_predict`: False
- `eval_strategy`: steps
- `prediction_loss_only`: True
- `per_device_train_batch_size`: 16
- `per_device_eval_batch_size`: 16
- `per_gpu_train_batch_size`: None
- `per_gpu_eval_batch_size`: None
- `gradient_accumulation_steps`: 1
- `eval_accumulation_steps`: None
- `learning_rate`: 5e-05
- `weight_decay`: 0.0
- `adam_beta1`: 0.9
- `adam_beta2`: 0.999
- `adam_epsilon`: 1e-08
- `max_grad_norm`: 1
- `num_train_epochs`: 12
- `max_steps`: -1
- `lr_scheduler_type`: linear
- `lr_scheduler_kwargs`: {}
- `warmup_ratio`: 0.0
- `warmup_steps`: 0
- `log_level`: passive
- `log_level_replica`: warning
- `log_on_each_node`: True
- `logging_nan_inf_filter`: True
- `save_safetensors`: True
- `save_on_each_node`: False
- `save_only_model`: False
- `restore_callback_states_from_checkpoint`: False
- `no_cuda`: False
- `use_cpu`: False
- `use_mps_device`: False
- `seed`: 42
- `data_seed`: None
- `jit_mode_eval`: False
- `use_ipex`: False
- `bf16`: False
- `fp16`: False
- `fp16_opt_level`: O1
- `half_precision_backend`: auto
- `bf16_full_eval`: False
- `fp16_full_eval`: False
- `tf32`: None
- `local_rank`: 0
- `ddp_backend`: None
- `tpu_num_cores`: None
- `tpu_metrics_debug`: False
- `debug`: []
- `dataloader_drop_last`: False
- `dataloader_num_workers`: 0
- `dataloader_prefetch_factor`: None
- `past_index`: -1
- `disable_tqdm`: False
- `remove_unused_columns`: True
- `label_names`: None
- `load_best_model_at_end`: False
- `ignore_data_skip`: False
- `fsdp`: []
- `fsdp_min_num_params`: 0
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
- `fsdp_transformer_layer_cls_to_wrap`: None
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
- `deepspeed`: None
- `label_smoothing_factor`: 0.0
- `optim`: adamw_torch
- `optim_args`: None
- `adafactor`: False
- `group_by_length`: False
- `length_column_name`: length
- `ddp_find_unused_parameters`: None
- `ddp_bucket_cap_mb`: None
- `ddp_broadcast_buffers`: False
- `dataloader_pin_memory`: True
- `dataloader_persistent_workers`: False
- `skip_memory_metrics`: True
- `use_legacy_prediction_loop`: False
- `push_to_hub`: False
- `resume_from_checkpoint`: None
- `hub_model_id`: None
- `hub_strategy`: every_save
- `hub_private_repo`: False
- `hub_always_push`: False
- `gradient_checkpointing`: False
- `gradient_checkpointing_kwargs`: None
- `include_inputs_for_metrics`: False
- `eval_do_concat_batches`: True
- `fp16_backend`: auto
- `push_to_hub_model_id`: None
- `push_to_hub_organization`: None
- `mp_parameters`:
- `auto_find_batch_size`: False
- `full_determinism`: False
- `torchdynamo`: None
- `ray_scope`: last
- `ddp_timeout`: 1800
- `torch_compile`: False
- `torch_compile_backend`: None
- `torch_compile_mode`: None
- `dispatch_batches`: None
- `split_batches`: None
- `include_tokens_per_second`: False
- `include_num_input_tokens_seen`: False
- `neftune_noise_alpha`: None
- `optim_target_modules`: None
- `batch_eval_metrics`: False
- `batch_sampler`: batch_sampler
- `multi_dataset_batch_sampler`: round_robin
</details>
### Training Logs
<details><summary>Click to expand</summary>
| Epoch | Step | Training Loss | eval_examples_spearman_max |
|:-------:|:-----:|:-------------:|:--------------------------:|
| 0.1033 | 100 | - | nan |
| 0.2066 | 200 | - | nan |
| 0.3099 | 300 | - | nan |
| 0.4132 | 400 | - | nan |
| 0.5165 | 500 | 0.7655 | nan |
| 0.6198 | 600 | - | nan |
| 0.7231 | 700 | - | nan |
| 0.8264 | 800 | - | nan |
| 0.9298 | 900 | - | nan |
| 1.0 | 968 | - | nan |
| 1.0331 | 1000 | 0.3727 | nan |
| 1.1364 | 1100 | - | nan |
| 1.2397 | 1200 | - | nan |
| 1.3430 | 1300 | - | nan |
| 1.4463 | 1400 | - | nan |
| 1.5496 | 1500 | 0.2686 | nan |
| 1.6529 | 1600 | - | nan |
| 1.7562 | 1700 | - | nan |
| 1.8595 | 1800 | - | nan |
| 1.9628 | 1900 | - | nan |
| 2.0 | 1936 | - | nan |
| 2.0661 | 2000 | 0.2709 | nan |
| 2.1694 | 2100 | - | nan |
| 2.2727 | 2200 | - | nan |
| 2.3760 | 2300 | - | nan |
| 2.4793 | 2400 | - | nan |
| 2.5826 | 2500 | 0.231 | nan |
| 2.6860 | 2600 | - | nan |
| 2.7893 | 2700 | - | nan |
| 2.8926 | 2800 | - | nan |
| 2.9959 | 2900 | - | nan |
| 3.0 | 2904 | - | nan |
| 3.0992 | 3000 | 0.2461 | nan |
| 3.2025 | 3100 | - | nan |
| 3.3058 | 3200 | - | nan |
| 3.4091 | 3300 | - | nan |
| 3.5124 | 3400 | - | nan |
| 3.6157 | 3500 | 0.2181 | nan |
| 3.7190 | 3600 | - | nan |
| 3.8223 | 3700 | - | nan |
| 3.9256 | 3800 | - | nan |
| 4.0 | 3872 | - | nan |
| 4.0289 | 3900 | - | nan |
| 4.1322 | 4000 | 0.2288 | nan |
| 4.2355 | 4100 | - | nan |
| 4.3388 | 4200 | - | nan |
| 4.4421 | 4300 | - | nan |
| 4.5455 | 4400 | - | nan |
| 4.6488 | 4500 | 0.2123 | nan |
| 4.7521 | 4600 | - | nan |
| 4.8554 | 4700 | - | nan |
| 4.9587 | 4800 | - | nan |
| 5.0 | 4840 | - | nan |
| 5.0620 | 4900 | - | nan |
| 5.1653 | 5000 | 0.2254 | nan |
| 5.2686 | 5100 | - | nan |
| 5.3719 | 5200 | - | nan |
| 5.4752 | 5300 | - | nan |
| 5.5785 | 5400 | - | nan |
| 5.6818 | 5500 | 0.2077 | nan |
| 5.7851 | 5600 | - | nan |
| 5.8884 | 5700 | - | nan |
| 5.9917 | 5800 | - | nan |
| 6.0 | 5808 | - | nan |
| 6.0950 | 5900 | - | nan |
| 6.1983 | 6000 | 0.218 | nan |
| 6.3017 | 6100 | - | nan |
| 6.4050 | 6200 | - | nan |
| 6.5083 | 6300 | - | nan |
| 6.6116 | 6400 | - | nan |
| 6.7149 | 6500 | 0.206 | nan |
| 6.8182 | 6600 | - | nan |
| 6.9215 | 6700 | - | nan |
| 7.0 | 6776 | - | nan |
| 7.0248 | 6800 | - | nan |
| 7.1281 | 6900 | - | nan |
| 7.2314 | 7000 | 0.2126 | nan |
| 7.3347 | 7100 | - | nan |
| 7.4380 | 7200 | - | nan |
| 7.5413 | 7300 | - | nan |
| 7.6446 | 7400 | - | nan |
| 7.7479 | 7500 | 0.2065 | nan |
| 7.8512 | 7600 | - | nan |
| 7.9545 | 7700 | - | nan |
| 8.0 | 7744 | - | nan |
| 8.0579 | 7800 | - | nan |
| 8.1612 | 7900 | - | nan |
| 8.2645 | 8000 | 0.2068 | nan |
| 8.3678 | 8100 | - | nan |
| 8.4711 | 8200 | - | nan |
| 8.5744 | 8300 | - | nan |
| 8.6777 | 8400 | - | nan |
| 8.7810 | 8500 | 0.2014 | nan |
| 8.8843 | 8600 | - | nan |
| 8.9876 | 8700 | - | nan |
| 9.0 | 8712 | - | nan |
| 9.0909 | 8800 | - | nan |
| 9.1942 | 8900 | - | nan |
| 9.2975 | 9000 | 0.2057 | nan |
| 9.4008 | 9100 | - | nan |
| 9.5041 | 9200 | - | nan |
| 9.6074 | 9300 | - | nan |
| 9.7107 | 9400 | - | nan |
| 9.8140 | 9500 | 0.1969 | nan |
| 9.9174 | 9600 | - | nan |
| 10.0 | 9680 | - | nan |
| 10.0207 | 9700 | - | nan |
| 10.1240 | 9800 | - | nan |
| 10.2273 | 9900 | - | nan |
| 10.3306 | 10000 | 0.2023 | nan |
| 10.4339 | 10100 | - | nan |
| 10.5372 | 10200 | - | nan |
| 10.6405 | 10300 | - | nan |
| 10.7438 | 10400 | - | nan |
| 10.8471 | 10500 | 0.1946 | nan |
| 10.9504 | 10600 | - | nan |
| 11.0 | 10648 | - | nan |
| 11.0537 | 10700 | - | nan |
| 11.1570 | 10800 | - | nan |
| 11.2603 | 10900 | - | nan |
| 11.3636 | 11000 | 0.1982 | nan |
| 11.4669 | 11100 | - | nan |
| 11.5702 | 11200 | - | nan |
| 11.6736 | 11300 | - | nan |
| 11.7769 | 11400 | - | nan |
| 11.8802 | 11500 | 0.1919 | nan |
| 11.9835 | 11600 | - | nan |
| 12.0 | 11616 | - | nan |
</details>
### Framework Versions
- Python: 3.10.14
- Sentence Transformers: 3.0.0
- Transformers: 4.41.2
- PyTorch: 2.1.0
- Accelerate: 0.30.1
- Datasets: 2.19.1
- Tokenizers: 0.19.1
## Citation
### BibTeX
#### Sentence Transformers
```bibtex
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
```
<!--
## Glossary
*Clearly define terms in order to be accessible across audiences.*
-->
<!--
## Model Card Authors
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
-->
<!--
## Model Card Contact
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
-->