metadata
language: []
library_name: sentence-transformers
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:300000
- loss:DenoisingAutoEncoderLoss
base_model: intfloat/e5-base-unsupervised
datasets: []
metrics:
- pearson_cosine
- spearman_cosine
- pearson_manhattan
- spearman_manhattan
- pearson_euclidean
- spearman_euclidean
- pearson_dot
- spearman_dot
- pearson_max
- spearman_max
widget:
- source_sentence: >-
One mole of a substance of substance such atoms or). The is known or
Avogadro's constant
sentences:
- how effective are birth control pills and pulling out?
- can pvc be phthalate free?
- >-
One mole of a substance is equal to 6.022 × 10²³ units of that substance
(such as atoms, molecules, or ions). The number 6.022 × 10²³ is known as
Avogadro's number or Avogadro's constant.
- source_sentence: >-
is the difference between disability broadly defined a or to be
significantly impaired relative to the standard an individual group . To
the term disabled still just more, this or function
sentences:
- >-
how to open pkf format? On a Windows PC, right-click the file, click
"Properties", then look under “Type of File.” On a Mac computer,
right-click the file, click “More Info,” then look under “Kind”. Tip: If
it's the PKF file extension, it probably falls under the Audio Files
type, so any program used for Audio Files should open your PKF file.
- >-
When someone dreams you died, it means that whatever you mean to that
person's psychological state of mind 'has ended' or 'is absent'. ...
People dream of dead people because they miss something about them that
was very strong emotionally present when they were there, yet is missing
in their daily-life now.
- >-
what is the difference between disability and disabled? A disability is
broadly defined as a condition or function judged to be significantly
impaired relative to the usual standard of an individual or group. ...
To most people today the term "disabled" still means just that, and,
more broadly, means "unable to perform" this or that physical or mental
function.
- source_sentence: how you contagious when
sentences:
- how long are you contagious when you have rsv?
- >-
With WiFi on your camera you establish a wireless connection between
your camera and your phone, tablet, computer, or printer. It's also
possible to connect two cameras with each other via WiFi. The camera has
its own WiFi network that transmits signals.
- >-
So, what does it mean when a guy looks you up and down? It will often
mean that he is checking you out especially if he only does it to you
and he shows other signs of attraction when around you. It can also be
that he is initially observing to see if you're a threat or that he is
observing your outfit.
- source_sentence: >-
you light east while is you can the of the . understanding The on left is
basically fajr time black you
sentences:
- >-
A future - contract to buy (or sell) something in the future. An option
- right BUT NOT the obligation to buy (or sell) something in the future.
A swap - two parties exchanging something at agreed points in time. This
could be an exchange of currencies, of returns on assets, of different
interest rate returns, etc..
- >-
can i connect my iphone to my windows laptop? You can sync an iPhone
with a Windows 10 computer wirelessly (over your local WiFi network) or
via the Lightning cable. ... Open iTunes in Windows 10. Plug your iPhone
(or iPad or iPod) into the computer using a Lightning cable (or older
30-pin connector). Click on Device in iTunes and choose your iPhone.
- >-
Yes, Fajr is when you can see the light in the east while Sunrise is
when you can see the disk of the sun. For those who have a trouble
understanding: The blue area on the left is basically fajr time. The
black area is when you can eat.
- source_sentence: >-
should eat diarrhea should solid as soon able you're bottle your have, try
to them as . at home until 48 last spreading others.
sentences:
- >-
which countries were not affected by world war 2? There were eight
countries that declared neutrality; Portugal, Switzerland, Spain,
Sweden, The Vatican, Andorra, Ireland and Liechtenstein. However, all of
these countries were still involved in small ways.
- how to copy multiple cells in excel and paste?
- >-
how long should you wait to eat after having diarrhea? You should eat
solid food as soon as you feel able to. If you're breastfeeding or
bottle feeding your baby and they have diarrhoea, you should try to feed
them as normal. Stay at home until at least 48 hours after the last
episode of diarrhoea to prevent spreading any infection to others.
pipeline_tag: sentence-similarity
model-index:
- name: SentenceTransformer based on intfloat/e5-base-unsupervised
results:
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: sts test
type: sts-test
metrics:
- type: pearson_cosine
value: 0.7707098586060571
name: Pearson Cosine
- type: spearman_cosine
value: 0.7583632499035035
name: Spearman Cosine
- type: pearson_manhattan
value: 0.7590199401674214
name: Pearson Manhattan
- type: spearman_manhattan
value: 0.747524480818435
name: Spearman Manhattan
- type: pearson_euclidean
value: 0.760482148803808
name: Pearson Euclidean
- type: spearman_euclidean
value: 0.7488744991502696
name: Spearman Euclidean
- type: pearson_dot
value: 0.5774036226110284
name: Pearson Dot
- type: spearman_dot
value: 0.5600384269062831
name: Spearman Dot
- type: pearson_max
value: 0.7707098586060571
name: Pearson Max
- type: spearman_max
value: 0.7583632499035035
name: Spearman Max
SentenceTransformer based on intfloat/e5-base-unsupervised
This is a sentence-transformers model finetuned from intfloat/e5-base-unsupervised. 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: intfloat/e5-base-unsupervised
- Maximum Sequence Length: 512 tokens
- Output Dimensionality: 768 tokens
- Similarity Function: Cosine Similarity
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
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:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("bobox/E5-base-unsupervised-TSDAE")
# Run inference
sentences = [
"should eat diarrhea should solid as soon able you're bottle your have, try to them as . at home until 48 last spreading others.",
"how long should you wait to eat after having diarrhea? You should eat solid food as soon as you feel able to. If you're breastfeeding or bottle feeding your baby and they have diarrhoea, you should try to feed them as normal. Stay at home until at least 48 hours after the last episode of diarrhoea to prevent spreading any infection to others.",
'how to copy multiple cells in excel and paste?',
]
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
Semantic Similarity
- Dataset:
sts-test
- Evaluated with
EmbeddingSimilarityEvaluator
Metric | Value |
---|---|
pearson_cosine | 0.7707 |
spearman_cosine | 0.7584 |
pearson_manhattan | 0.759 |
spearman_manhattan | 0.7475 |
pearson_euclidean | 0.7605 |
spearman_euclidean | 0.7489 |
pearson_dot | 0.5774 |
spearman_dot | 0.56 |
pearson_max | 0.7707 |
spearman_max | 0.7584 |
Training Details
Training Dataset
Unnamed Dataset
- Size: 300,000 training samples
- Columns:
sentence_0
andsentence_1
- Approximate statistics based on the first 1000 samples:
sentence_0 sentence_1 type string string details - min: 3 tokens
- mean: 20.46 tokens
- max: 69 tokens
- min: 8 tokens
- mean: 47.85 tokens
- max: 132 tokens
- Samples:
sentence_0 sentence_1 matter An unit of retains all subatomic neutrons Hydrogen (one one neutrons
are particles of matter atoms? An atom is the smallest unit of matter that retains all of the chemical properties of an element. ... Most atoms contain all three of these types of subatomic particles—protons, electrons, and neutrons. Hydrogen (H) is an exception because it typically has one proton and one electron, but no neutrons.
equals how
5 ml equals how many ounces?
"A Country Boy School is poor is forced to its boy to school following official, ignoring mean a jail
"A Country Boy Quits School" by Lao Hsiang is an endearing social satire. It is about a poor Chinese family which is forced to send its boy to school following an official proclamation, ignoring which would mean a jail term.
- Loss:
DenoisingAutoEncoderLoss
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy
: stepsper_device_train_batch_size
: 14per_device_eval_batch_size
: 14num_train_epochs
: 1multi_dataset_batch_sampler
: round_robin
All Hyperparameters
Click to expand
overwrite_output_dir
: Falsedo_predict
: Falseeval_strategy
: stepsprediction_loss_only
: Trueper_device_train_batch_size
: 14per_device_eval_batch_size
: 14per_gpu_train_batch_size
: Noneper_gpu_eval_batch_size
: Nonegradient_accumulation_steps
: 1eval_accumulation_steps
: Nonelearning_rate
: 5e-05weight_decay
: 0.0adam_beta1
: 0.9adam_beta2
: 0.999adam_epsilon
: 1e-08max_grad_norm
: 1num_train_epochs
: 1max_steps
: -1lr_scheduler_type
: linearlr_scheduler_kwargs
: {}warmup_ratio
: 0.0warmup_steps
: 0log_level
: passivelog_level_replica
: warninglog_on_each_node
: Truelogging_nan_inf_filter
: Truesave_safetensors
: Truesave_on_each_node
: Falsesave_only_model
: Falserestore_callback_states_from_checkpoint
: Falseno_cuda
: Falseuse_cpu
: Falseuse_mps_device
: Falseseed
: 42data_seed
: Nonejit_mode_eval
: Falseuse_ipex
: Falsebf16
: Falsefp16
: Falsefp16_opt_level
: O1half_precision_backend
: autobf16_full_eval
: Falsefp16_full_eval
: Falsetf32
: Nonelocal_rank
: 0ddp_backend
: Nonetpu_num_cores
: Nonetpu_metrics_debug
: Falsedebug
: []dataloader_drop_last
: Falsedataloader_num_workers
: 0dataloader_prefetch_factor
: Nonepast_index
: -1disable_tqdm
: Falseremove_unused_columns
: Truelabel_names
: Noneload_best_model_at_end
: Falseignore_data_skip
: Falsefsdp
: []fsdp_min_num_params
: 0fsdp_config
: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap
: Noneaccelerator_config
: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}deepspeed
: Nonelabel_smoothing_factor
: 0.0optim
: adamw_torchoptim_args
: Noneadafactor
: Falsegroup_by_length
: Falselength_column_name
: lengthddp_find_unused_parameters
: Noneddp_bucket_cap_mb
: Noneddp_broadcast_buffers
: Falsedataloader_pin_memory
: Truedataloader_persistent_workers
: Falseskip_memory_metrics
: Trueuse_legacy_prediction_loop
: Falsepush_to_hub
: Falseresume_from_checkpoint
: Nonehub_model_id
: Nonehub_strategy
: every_savehub_private_repo
: Falsehub_always_push
: Falsegradient_checkpointing
: Falsegradient_checkpointing_kwargs
: Noneinclude_inputs_for_metrics
: Falseeval_do_concat_batches
: Truefp16_backend
: autopush_to_hub_model_id
: Nonepush_to_hub_organization
: Nonemp_parameters
:auto_find_batch_size
: Falsefull_determinism
: Falsetorchdynamo
: Noneray_scope
: lastddp_timeout
: 1800torch_compile
: Falsetorch_compile_backend
: Nonetorch_compile_mode
: Nonedispatch_batches
: Nonesplit_batches
: Noneinclude_tokens_per_second
: Falseinclude_num_input_tokens_seen
: Falseneftune_noise_alpha
: Noneoptim_target_modules
: Nonebatch_eval_metrics
: Falsebatch_sampler
: batch_samplermulti_dataset_batch_sampler
: round_robin
Training Logs
Epoch | Step | Training Loss | sts-test_spearman_cosine |
---|---|---|---|
0 | 0 | - | 0.7211 |
0.0233 | 500 | 6.3144 | - |
0.0467 | 1000 | 5.3949 | - |
0.0500 | 1072 | - | 0.6820 |
0.0700 | 1500 | 5.0531 | - |
0.0933 | 2000 | 4.8547 | - |
0.1001 | 2144 | - | 0.7126 |
0.1167 | 2500 | 4.7058 | - |
0.1400 | 3000 | 4.5771 | - |
0.1501 | 3216 | - | 0.7290 |
0.1633 | 3500 | 4.4591 | - |
0.1867 | 4000 | 4.3502 | - |
0.2001 | 4288 | - | 0.7351 |
0.2100 | 4500 | 4.3071 | - |
0.2333 | 5000 | 4.2042 | - |
0.2501 | 5360 | - | 0.7464 |
0.2567 | 5500 | 4.1657 | - |
0.2800 | 6000 | 4.1111 | - |
0.3002 | 6432 | - | 0.7492 |
0.3033 | 6500 | 4.045 | - |
0.3267 | 7000 | 4.017 | - |
0.3500 | 7500 | 3.9651 | - |
0.3502 | 7504 | - | 0.7554 |
0.3733 | 8000 | 3.9199 | - |
0.3967 | 8500 | 3.8691 | - |
0.4002 | 8576 | - | 0.7517 |
0.4200 | 9000 | 3.8563 | - |
0.4433 | 9500 | 3.815 | - |
0.4502 | 9648 | - | 0.7540 |
0.4667 | 10000 | 3.7892 | - |
0.4900 | 10500 | 3.7543 | - |
0.5003 | 10720 | - | 0.7585 |
0.5133 | 11000 | 3.7391 | - |
0.5367 | 11500 | 3.7442 | - |
0.5503 | 11792 | - | 0.7587 |
0.5600 | 12000 | 3.7187 | - |
0.5833 | 12500 | 3.6855 | - |
0.6003 | 12864 | - | 0.7572 |
0.6067 | 13000 | 3.6751 | - |
0.6300 | 13500 | 3.6373 | - |
0.6503 | 13936 | - | 0.7574 |
0.6533 | 14000 | 3.6292 | - |
0.6767 | 14500 | 3.6277 | - |
0.7000 | 15000 | 3.6084 | - |
0.7004 | 15008 | - | 0.7575 |
0.7233 | 15500 | 3.6103 | - |
0.7467 | 16000 | 3.5953 | - |
0.7504 | 16080 | - | 0.7576 |
0.7700 | 16500 | 3.6232 | - |
0.7933 | 17000 | 3.5741 | - |
0.8004 | 17152 | - | 0.7583 |
0.8167 | 17500 | 3.5639 | - |
0.8400 | 18000 | 3.5667 | - |
0.8504 | 18224 | - | 0.7589 |
0.8633 | 18500 | 3.5598 | - |
0.8866 | 19000 | 3.5636 | - |
0.9005 | 19296 | - | 0.7584 |
0.9100 | 19500 | 3.5536 | - |
0.9333 | 20000 | 3.5529 | - |
0.9505 | 20368 | - | 0.7584 |
0.9566 | 20500 | 3.5485 | - |
0.9800 | 21000 | 3.5503 | - |
1.0 | 21429 | - | 0.7584 |
Framework Versions
- Python: 3.10.13
- Sentence Transformers: 3.0.1
- Transformers: 4.41.2
- PyTorch: 2.1.2
- Accelerate: 0.31.0
- Datasets: 2.19.2
- Tokenizers: 0.19.1
Citation
BibTeX
Sentence Transformers
@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",
}
DenoisingAutoEncoderLoss
@inproceedings{wang-2021-TSDAE,
title = "TSDAE: Using Transformer-based Sequential Denoising Auto-Encoderfor Unsupervised Sentence Embedding Learning",
author = "Wang, Kexin and Reimers, Nils and Gurevych, Iryna",
booktitle = "Findings of the Association for Computational Linguistics: EMNLP 2021",
month = nov,
year = "2021",
address = "Punta Cana, Dominican Republic",
publisher = "Association for Computational Linguistics",
pages = "671--688",
url = "https://arxiv.org/abs/2104.06979",
}