metadata
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:849
- loss:MultipleNegativesRankingLoss
base_model: sentence-transformers/all-MiniLM-L12-v2
widget:
- source_sentence: >-
Graphic designer who specializes in creating visual content for brands,
including logos, marketing materials, and user interfaces. Focuses on
aesthetics, user experience, and brand identity.
sentences:
- >-
user_1: I'm looking to refresh my company's brand image but don't know
where to start.
user_2: You should consult a brand manager.
- |-
user_1: I need help designing a logo for my new business.
user_2: Have you thought about hiring a graphic designer?
user_1: Yes, I want something that really represents my brand.
- |-
user_1: My car's making a weird noise, and I don't know what to do.
user_2: You should take it to a mechanic.
- source_sentence: >-
Nutritionist who specializes in dietary planning and nutritional
counseling. Helps clients achieve their health goals through personalized
meal plans and education.
sentences:
- |-
user_1: I'm trying to lose weight but I don't know what to eat.
user_2: Have you considered talking to a nutritionist?
- |-
user_1: Our database is running slow, and I don't know why.
user_2: Have you checked the indexing?
- |-
user_1: I need help fixing my car's engine; it's making a weird noise.
user_2: Have you checked the oil level?
- source_sentence: 'user_2: Sure, what problem are you working on?'
sentences:
- >-
Gardening expert specializing in vegetable gardening techniques and
plant care.
- Event planner focusing on corporate events and wedding coordination.
- >-
Math tutor specializing in teaching and clarifying mathematical concepts
and problem-solving.
- source_sentence: 'user_2: Have you thought about getting some storage bins?'
sentences:
- Web developer focused on software engineering and application design.
- >-
Professional organizer specializing in home organization and
decluttering strategies.
- >-
Pet behavior specialist who provides advice on dog breeds and training
for small living spaces.
- source_sentence: 'user_1: Maybe the national parks, I want to see some nature.'
sentences:
- >-
Mental health counselor specializing in stress management and coping
strategies.
- Data analyst focusing on market trends and business intelligence.
- >-
Travel consultant specializing in road trip planning and national park
itineraries.
pipeline_tag: sentence-similarity
library_name: sentence-transformers
SentenceTransformer based on sentence-transformers/all-MiniLM-L12-v2
This is a sentence-transformers model finetuned from sentence-transformers/all-MiniLM-L12-v2 on the semantic_triplets_round1 and inverse_semantic_triplets datasets. 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/all-MiniLM-L12-v2
- Maximum Sequence Length: 128 tokens
- Output Dimensionality: 384 dimensions
- Similarity Function: Cosine Similarity
- Training Datasets:
- semantic_triplets_round1
- inverse_semantic_triplets
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': 128, '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})
(2): Normalize()
)
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("sentence_transformers_model_id")
# Run inference
sentences = [
'user_1: Maybe the national parks, I want to see some nature.',
'Travel consultant specializing in road trip planning and national park itineraries.',
'Data analyst focusing on market trends and business intelligence.',
]
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 Datasets
semantic_triplets_round1
- Dataset: semantic_triplets_round1
- Size: 422 training samples
- Columns:
anchor,positive, andnegative - Approximate statistics based on the first 422 samples:
anchor positive negative type string string string details - min: 10 tokens
- mean: 17.44 tokens
- max: 33 tokens
- min: 11 tokens
- mean: 14.17 tokens
- max: 26 tokens
- min: 9 tokens
- mean: 12.49 tokens
- max: 20 tokens
- Samples:
anchor positive negative user_1: Can anyone recommend a good app for tracking my expenses?Personal finance advisor specializing in budgeting tools and expense tracking applications.Fitness instructor focusing on workout plans and nutrition.user_1: Can anyone recommend a good workout routine for beginners?Fitness trainer who specializes in creating beginner workout plans and exercise coaching.Financial advisor focused on investment strategies and retirement planning.user_2: What kind of vegetables are you thinking of planting?Gardening expert who provides guidance on vegetable gardening techniques and plant care.Investment advisor specializing in stock market strategies and financial planning. - Loss:
MultipleNegativesRankingLosswith these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim" }
inverse_semantic_triplets
- Dataset: inverse_semantic_triplets
- Size: 427 training samples
- Columns:
anchor,positive, andnegative - Approximate statistics based on the first 427 samples:
anchor positive negative type string string string details - min: 18 tokens
- mean: 28.42 tokens
- max: 46 tokens
- min: 19 tokens
- mean: 40.04 tokens
- max: 72 tokens
- min: 13 tokens
- mean: 27.66 tokens
- max: 62 tokens
- Samples:
anchor positive negative UX researcher specializing in user experience design and user testing. Conducts research to understand user needs and improve product usability.user_1: I'm looking for ways to improve the usability of our app.
user_2: Have you considered conducting user interviews?user_1: I need to plan a trip to Europe next summer.
user_2: What countries are you thinking about visiting?Software developer specializing in web applications, proficient in various programming languages and frameworks. I design, develop, and maintain software solutions, focusing on user experience and functionality.user_1: I'm trying to build a web application, but I'm stuck on how to integrate the backend with the frontend.
user_2: What technologies are you using for both?
user_1: I’m using Node.js for the backend and React for the frontend.user_1: I'm looking for a good recipe for chocolate chip cookies.
user_2: I can share my favorite one!Marketing strategist who focuses on developing comprehensive marketing plans to drive brand engagement and sales growth. Specializes in digital marketing and content strategy.user_1: I'm launching a new product and need a marketing strategy.
user_2: Have you set any goals for your campaign?user_1: I'm looking for a new pair of running shoes.
user_2: What brand do you prefer? - Loss:
MultipleNegativesRankingLosswith these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim" }
Evaluation Datasets
semantic_triplets_round1
- Dataset: semantic_triplets_round1
- Size: 47 evaluation samples
- Columns:
anchor,positive, andnegative - Approximate statistics based on the first 47 samples:
anchor positive negative type string string string details - min: 12 tokens
- mean: 17.87 tokens
- max: 30 tokens
- min: 8 tokens
- mean: 14.32 tokens
- max: 27 tokens
- min: 10 tokens
- mean: 12.49 tokens
- max: 16 tokens
- Samples:
anchor positive negative user_1: What's the best way to train my puppy to stop barking?Dog training specialist focused on behavioral issues and obedience training.Financial advisor who specializes in investment strategies and wealth management.user_2: What vegetables do you want to grow?Gardening expert specializing in vegetable gardening and sustainable practices.Real estate agent focusing on home buying and selling.user_1: Anyone have tips on how to improve my running time for a 5k?Running coach specializing in training plans and performance improvement.Financial advisor focusing on investment strategies and retirement planning. - Loss:
MultipleNegativesRankingLosswith these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim" }
inverse_semantic_triplets
- Dataset: inverse_semantic_triplets
- Size: 48 evaluation samples
- Columns:
anchor,positive, andnegative - Approximate statistics based on the first 48 samples:
anchor positive negative type string string string details - min: 20 tokens
- mean: 28.42 tokens
- max: 38 tokens
- min: 23 tokens
- mean: 39.71 tokens
- max: 65 tokens
- min: 14 tokens
- mean: 28.4 tokens
- max: 52 tokens
- Samples:
anchor positive negative Graphic designer who specializes in creating visual content for brands, including logos, marketing materials, and user interfaces. Focuses on aesthetics, user experience, and brand identity.user_1: I need help designing a logo for my new business.
user_2: Have you thought about hiring a graphic designer?
user_1: Yes, I want something that really represents my brand.user_1: My car's making a weird noise, and I don't know what to do.
user_2: You should take it to a mechanic.Physical therapist specializing in rehabilitation for sports injuries, pain management, and improving mobility through tailored exercise programs.user_1: I twisted my ankle playing basketball, and it's really swollen.
user_2: Have you seen a doctor about it?user_1: I'm thinking of redecorating my living room.
user_2: What style are you going for?An accountant who specializes in financial record-keeping, tax preparation, and business consulting. Provides services to help clients manage their finances effectively and ensure compliance with tax regulations.user_1: I need help with my taxes this year.
user_2: Are you looking for someone to prepare them for you?user_1: I'm thinking about getting a puppy. - Loss:
MultipleNegativesRankingLosswith these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim" }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy: stepsper_device_train_batch_size: 16per_device_eval_batch_size: 16learning_rate: 2e-05num_train_epochs: 1warmup_ratio: 0.1batch_sampler: no_duplicates
All Hyperparameters
Click to expand
overwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 16per_device_eval_batch_size: 16per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 2e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 1max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.1warmup_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: 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: 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: no_duplicatesmulti_dataset_batch_sampler: proportional
Framework Versions
- Python: 3.12.9
- Sentence Transformers: 4.1.0
- Transformers: 4.52.4
- PyTorch: 2.7.1
- Accelerate: 1.8.1
- 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",
}
MultipleNegativesRankingLoss
@misc{henderson2017efficient,
title={Efficient Natural Language Response Suggestion for Smart Reply},
author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
year={2017},
eprint={1705.00652},
archivePrefix={arXiv},
primaryClass={cs.CL}
}