metadata
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:1927
- loss:TripletLoss
base_model: sentence-transformers/paraphrase-MiniLM-L6-v2
widget:
- source_sentence: >-
“To be a Christian means to forgive the inexcusable because God has
forgiven the inexcusable in you.”
sentences:
- “Eating and reading are two pleasures that combine admirably.”
- >-
“I am an excitable person who only understands life lyrically,
musically, in whom feelings are much stronger as reason. I am so thirsty
for the marvelous that only the marvelous has power over me. Anything I
can not transform into something marvelous, I let go. Reality doesn't
impress me. I only believe in intoxication, in ecstasy, and when
ordinary life shackles me, I escape, one way or another. No more walls.”
- >-
“Can you surf really well, then?"I looked at Grover, who was trying hard
not to laugh."Jeez, Nico," I said. "I've never really tried."He went on
asking questions. Did I fight a lot with Thalia, since she was a
daughter of Zeus? (I didn't answer that one.) If Annabeth's mother was
Athena, the goddess of wisdom, then why didn't Annabeth know better than
to fall off a cliff? (I tried not to strangle Nico for asking that one.)
Was Annabeth my girlfriend? (At this point, I was ready to stick the kid
in a meat-flavored sack and throw him to the wolves.)”
- source_sentence: >-
“Peeta, how come I never know when you're having a nightmare?â€� I
say.“I don't know. I don't think I cry out or thrash around or anything.
I just come to, paralyzed with terror,� he says.“You should wake
me,� I say, thinking about how I can interrupt his sleep two or three
times on a bad night. About how long it can take to calm me down.“It's
not necessary. My nightmares are usually about losing you,� he says.
“I'm okay once I realize you're here.”
sentences:
- >-
“Every time you smile at someone, it is an action of love, a gift to
that person, a beautiful thing.”
- “There are no facts, only interpretations.”
- >-
“Really, the combination of the scabs and the ointment looks hideous. I
can't help enjoying his distress."Poor Finnick. Is this the first time
in your life you haven't looked pretty?" I say."It must be. The
sensation's completely new. How have you managed it all these years?" he
asks."Just avoid mirrors. You'll forget about it," I say."Not if I keep
looking at you," he says.”
- source_sentence: >-
“There are two basic motivating forces: fear and love. When we are afraid,
we pull back from life. When we are in love, we open to all that life has
to offer with passion, excitement, and acceptance. We need to learn to
love ourselves first, in all our glory and our imperfections. If we cannot
love ourselves, we cannot fully open to our ability to love others or our
potential to create. Evolution and all hopes for a better world rest in
the fearlessness and open-hearted vision of people who embrace life.”
sentences:
- >-
“Love conquers all," Aphrodite promised. "Look at Helen and Paris. Did
they let anything come between them?""Didn't they start the Trojan War
and get thousands of people killed?""Pfft. That's not the point. Follow
your heart.”
- >-
“Gus: "It tastes like..."Me: "Food."Gus: "Yes, precisely. It tastes like
food, excellently prepared. But it does not taste, how do I put this
delicately...?"Me: "It does not taste like God Himself cooked heaven
into a series of five dishes which were then served to you accompanied
by several luminous balls of fermented, bubbly plasma while actual and
literal flower petals floated down around your canal-side dinner
table."Gus: "Nicely phrased."Gus's father: "Our children are weird."My
dad: "Nicely phrased.”
- >-
“You may say I'm a dreamer, but I'm not the only one. I hope someday
you'll join us. And the world will live as one.”
- source_sentence: >-
“A human being is a part of the whole called by us universe, a part
limited in time and space. He experiences himself, his thoughts and
feeling as something separated from the rest, a kind of optical delusion
of his consciousness. This delusion is a kind of prison for us,
restricting us to our personal desires and to affection for a few persons
nearest to us. Our task must be to free ourselves from this prison by
widening our circle of compassion to embrace all living creatures and the
whole of nature in its beauty.”
sentences:
- “A clever person solves a problem. A wise person avoids it.”
- “A smile is a curve that sets everything straight.”
- “Music is ... A higher revelation than all Wisdom & Philosophy”
- source_sentence: >-
“The reason I talk to myself is because I’m the only one whose answers I
accept.”
sentences:
- >-
“The person, be it gentleman or lady, who has not pleasure in a good
novel, must be intolerably stupid.”
- >-
“Follow your heart, listen to your inner voice, stop caring about what
others think.”
- “If you try to fail, and succeed, which have you done?”
pipeline_tag: sentence-similarity
library_name: sentence-transformers
SentenceTransformer based on sentence-transformers/paraphrase-MiniLM-L6-v2
This is a sentence-transformers model finetuned from sentence-transformers/paraphrase-MiniLM-L6-v2. It maps sentences & paragraphs to a 384-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/paraphrase-MiniLM-L6-v2
- Maximum Sequence Length: 512 tokens
- Output Dimensionality: 384 dimensions
- 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': 384, '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("rituraj18/quote-embedder-finetuned_ver_8")
# Run inference
sentences = [
'“The reason I talk to myself is because I’m the only one whose answers I accept.”',
'“If you try to fail, and succeed, which have you done?”',
'“Follow your heart, listen to your inner voice, stop caring about what others think.”',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
Training Details
Training Dataset
Unnamed Dataset
- Size: 1,927 training samples
- Columns:
sentence_0
,sentence_1
, andsentence_2
- Approximate statistics based on the first 1000 samples:
sentence_0 sentence_1 sentence_2 type string string string details - min: 9 tokens
- mean: 43.08 tokens
- max: 512 tokens
- min: 9 tokens
- mean: 45.83 tokens
- max: 512 tokens
- min: 9 tokens
- mean: 41.51 tokens
- max: 512 tokens
- Samples:
sentence_0 sentence_1 sentence_2 “We delight in the beauty of the butterfly, but rarely admit the changes it has gone through to achieve that beauty.”
“I don't trust people who don't love themselves and tell me, 'I love you.' ... There is an African saying which is: Be careful when a naked person offers you a shirt.”
“Whenever you find yourself on the side of the majority, it is time to reform (or pause and reflect).”
“Fear doesn't shut you down; it wakes you up”
“We believe in ordinary acts of bravery, in the courage that drives one person to stand up for another.”
“You may say I'm a dreamer, but I'm not the only one. I hope someday you'll join us. And the world will live as one.”
“The real story of the Fleece: there were these two children of Zeus, Cadmus and Europa, okay? They were about to get offered up as human sacrifices, when they prayed to Zeus to save them. So Zeus sent this magical flying ram with golden wool, which picked them up in Greece and carried them all the way to Colchis in Asia Minor. Well, actually it carried Cadmus. Europa fell off and died along the way, but that's not important.""It was probably important to her.”
“God alert!" Blackjack yelled. "It's the wine dude!Mr. D sighed in exasperation. "The next person, or horse, who calls me the 'wine dude' will end up in a bottle of Merlot!”
“Life is to be enjoyed, not endured”
- Loss:
TripletLoss
with these parameters:{ "distance_metric": "TripletDistanceMetric.EUCLIDEAN", "triplet_margin": 0.5 }
Training Hyperparameters
Non-Default Hyperparameters
fp16
: Truemulti_dataset_batch_sampler
: round_robin
All Hyperparameters
Click to expand
overwrite_output_dir
: Falsedo_predict
: Falseeval_strategy
: noprediction_loss_only
: Trueper_device_train_batch_size
: 8per_device_eval_batch_size
: 8per_gpu_train_batch_size
: Noneper_gpu_eval_batch_size
: Nonegradient_accumulation_steps
: 1eval_accumulation_steps
: Nonetorch_empty_cache_steps
: Nonelearning_rate
: 5e-05weight_decay
: 0.0adam_beta1
: 0.9adam_beta2
: 0.999adam_epsilon
: 1e-08max_grad_norm
: 1num_train_epochs
: 3max_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
: Truefp16_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
: Nonehub_always_push
: Falsegradient_checkpointing
: Falsegradient_checkpointing_kwargs
: Noneinclude_inputs_for_metrics
: Falseinclude_for_metrics
: []eval_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
: Falseeval_on_start
: Falseuse_liger_kernel
: Falseeval_use_gather_object
: Falseaverage_tokens_across_devices
: Falseprompts
: Nonebatch_sampler
: batch_samplermulti_dataset_batch_sampler
: round_robin
Training Logs
Epoch | Step | Training Loss |
---|---|---|
2.0747 | 500 | 0.3687 |
Framework Versions
- Python: 3.11.13
- Sentence Transformers: 4.1.0
- Transformers: 4.48.3
- PyTorch: 2.5.1+cu124
- Accelerate: 1.3.0
- Datasets: 3.6.0
- Tokenizers: 0.21.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",
}
TripletLoss
@misc{hermans2017defense,
title={In Defense of the Triplet Loss for Person Re-Identification},
author={Alexander Hermans and Lucas Beyer and Bastian Leibe},
year={2017},
eprint={1703.07737},
archivePrefix={arXiv},
primaryClass={cs.CV}
}