SentenceTransformer based on Snowflake/snowflake-arctic-embed-s
This is a sentence-transformers model finetuned from Snowflake/snowflake-arctic-embed-s. 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: Snowflake/snowflake-arctic-embed-s
- 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': True, 'pooling_mode_mean_tokens': False, '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("LucaZilli/arctic-s-phrases-only-v0")
# Run inference
sentences = [
'CDMO',
'C.M.L. SNC DI ZANETTI GIOVANNI & C. ||~~|| C.M.L. SNC specializes in precision mechanical machining, offering a range of mechanical processing and various types of machines and systems. mechanical processing',
'Insight Consulting - Siti web e Digital Marketing ||~~|| Insight Consulting specializes in digital strategy, enhancing customer engagement, brand awareness, and lead acquisition through tailored omni-channel solutions and market analysis. lead acquisition',
]
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: 48,157 training samples
- Columns:
sentence1
,sentence2
, andscore
- Approximate statistics based on the first 1000 samples:
sentence1 sentence2 score type string string float details - min: 4 tokens
- mean: 14.6 tokens
- max: 46 tokens
- min: 4 tokens
- mean: 25.64 tokens
- max: 133 tokens
- min: 0.0
- mean: 0.5
- max: 1.0
- Samples:
sentence1 sentence2 score pavimentazione industriale antiscivolo certificata
MOLTA SRL
monitor arm for dual screens
braccio per monitor
0.6
investigatore privato dipendenti
Investigatore Privato
- Loss:
CosineSimilarityLoss
with these parameters:{ "loss_fct": "torch.nn.modules.loss.MSELoss" }
Evaluation Dataset
Unnamed Dataset
- Size: 2,352 evaluation samples
- Columns:
sentence1
,sentence2
, andscore
- Approximate statistics based on the first 1000 samples:
sentence1 sentence2 score type string string float details - min: 4 tokens
- mean: 17.31 tokens
- max: 48 tokens
- min: 13 tokens
- mean: 71.79 tokens
- max: 122 tokens
- min: 0.0
- mean: 0.62
- max: 1.0
- Samples:
sentence1 sentence2 score CDMO
C.M.L. SNC DI ZANETTI GIOVANNI & C.
programmatori salesforce
EFFEGIT SRL
software con intelligenza artificiale per i contratti
BORRONI VALERIA
- Loss:
CosineSimilarityLoss
with these parameters:{ "loss_fct": "torch.nn.modules.loss.MSELoss" }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy
: stepsper_device_train_batch_size
: 32per_device_eval_batch_size
: 32learning_rate
: 2.0000000000000003e-06num_train_epochs
: 1warmup_ratio
: 0.1fp16
: Trueload_best_model_at_end
: True
All Hyperparameters
Click to expand
overwrite_output_dir
: Falsedo_predict
: Falseeval_strategy
: stepsprediction_loss_only
: Trueper_device_train_batch_size
: 32per_device_eval_batch_size
: 32per_gpu_train_batch_size
: Noneper_gpu_eval_batch_size
: Nonegradient_accumulation_steps
: 1eval_accumulation_steps
: Nonetorch_empty_cache_steps
: Nonelearning_rate
: 2.0000000000000003e-06weight_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
: 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
: Trueignore_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
: proportional
Training Logs
Epoch | Step | Training Loss | Validation Loss |
---|---|---|---|
0.0066 | 10 | 0.1549 | - |
0.0133 | 20 | 0.1566 | - |
0.0199 | 30 | 0.1482 | - |
0.0266 | 40 | 0.135 | 0.0904 |
0.0332 | 50 | 0.1406 | - |
0.0399 | 60 | 0.1186 | - |
0.0465 | 70 | 0.1077 | - |
0.0532 | 80 | 0.1068 | 0.0746 |
0.0598 | 90 | 0.0818 | - |
0.0664 | 100 | 0.0841 | - |
0.0731 | 110 | 0.0768 | - |
0.0797 | 120 | 0.0737 | 0.0721 |
0.0864 | 130 | 0.0717 | - |
0.0930 | 140 | 0.0632 | - |
0.0997 | 150 | 0.0585 | - |
0.1063 | 160 | 0.0633 | 0.0757 |
0.1130 | 170 | 0.0567 | - |
0.1196 | 180 | 0.0633 | - |
0.1262 | 190 | 0.0584 | - |
0.1329 | 200 | 0.0686 | 0.0744 |
0.1395 | 210 | 0.0618 | - |
0.1462 | 220 | 0.0585 | - |
0.1528 | 230 | 0.0545 | - |
0.1595 | 240 | 0.0588 | 0.0721 |
0.1661 | 250 | 0.0532 | - |
0.1728 | 260 | 0.0608 | - |
0.1794 | 270 | 0.054 | - |
0.1860 | 280 | 0.059 | 0.0697 |
0.1927 | 290 | 0.0513 | - |
0.1993 | 300 | 0.0603 | - |
0.2060 | 310 | 0.0538 | - |
0.2126 | 320 | 0.0565 | 0.0686 |
0.2193 | 330 | 0.0515 | - |
0.2259 | 340 | 0.0565 | - |
0.2326 | 350 | 0.0579 | - |
0.2392 | 360 | 0.0504 | 0.0672 |
0.2458 | 370 | 0.0529 | - |
0.2525 | 380 | 0.0541 | - |
0.2591 | 390 | 0.0552 | - |
0.2658 | 400 | 0.0556 | 0.0669 |
0.2724 | 410 | 0.0561 | - |
0.2791 | 420 | 0.0629 | - |
0.2857 | 430 | 0.05 | - |
0.2924 | 440 | 0.0609 | 0.0659 |
0.2990 | 450 | 0.0539 | - |
0.3056 | 460 | 0.0556 | - |
0.3123 | 470 | 0.0516 | - |
0.3189 | 480 | 0.0456 | 0.0651 |
0.3256 | 490 | 0.0485 | - |
0.3322 | 500 | 0.0504 | - |
0.3389 | 510 | 0.0577 | - |
0.3455 | 520 | 0.0538 | 0.0647 |
0.3522 | 530 | 0.0458 | - |
0.3588 | 540 | 0.0496 | - |
0.3654 | 550 | 0.0486 | - |
0.3721 | 560 | 0.0536 | 0.0645 |
0.3787 | 570 | 0.0501 | - |
0.3854 | 580 | 0.0519 | - |
0.3920 | 590 | 0.0523 | - |
0.3987 | 600 | 0.0456 | 0.0639 |
0.4053 | 610 | 0.0561 | - |
0.4120 | 620 | 0.0534 | - |
0.4186 | 630 | 0.0546 | - |
0.4252 | 640 | 0.0531 | 0.0637 |
0.4319 | 650 | 0.0443 | - |
0.4385 | 660 | 0.0522 | - |
0.4452 | 670 | 0.0456 | - |
0.4518 | 680 | 0.049 | 0.0635 |
0.4585 | 690 | 0.0488 | - |
0.4651 | 700 | 0.0523 | - |
0.4718 | 710 | 0.0487 | - |
0.4784 | 720 | 0.0515 | 0.0632 |
0.4850 | 730 | 0.0453 | - |
0.4917 | 740 | 0.0511 | - |
0.4983 | 750 | 0.0429 | - |
0.5050 | 760 | 0.0409 | 0.0631 |
0.5116 | 770 | 0.0534 | - |
0.5183 | 780 | 0.0485 | - |
0.5249 | 790 | 0.0527 | - |
0.5316 | 800 | 0.0475 | 0.0630 |
0.5382 | 810 | 0.0512 | - |
0.5449 | 820 | 0.0439 | - |
0.5515 | 830 | 0.042 | - |
0.5581 | 840 | 0.0499 | 0.0628 |
0.5648 | 850 | 0.0431 | - |
0.5714 | 860 | 0.0541 | - |
0.5781 | 870 | 0.045 | - |
0.5847 | 880 | 0.0495 | 0.0627 |
0.5914 | 890 | 0.0531 | - |
0.5980 | 900 | 0.0478 | - |
0.6047 | 910 | 0.0547 | - |
0.6113 | 920 | 0.0474 | 0.0626 |
- The bold row denotes the saved checkpoint.
Framework Versions
- Python: 3.10.14
- Sentence Transformers: 3.4.1
- Transformers: 4.49.0
- PyTorch: 2.2.2
- Accelerate: 1.4.0
- Datasets: 3.3.2
- Tokenizers: 0.21.0
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",
}
- Downloads last month
- 21
Inference Providers
NEW
This model is not currently available via any of the supported Inference Providers.
Model tree for LucaZilli/arctic-s-phrases-only-v0
Base model
Snowflake/snowflake-arctic-embed-s