SentenceTransformer based on intfloat/multilingual-e5-base
This is a sentence-transformers model finetuned from intfloat/multilingual-e5-base on the rztk/rozetka_positive_pairs dataset. 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/multilingual-e5-base
- Maximum Sequence Length: 512 tokens
- Output Dimensionality: 768 tokens
- Similarity Function: Cosine Similarity
- Training Dataset:
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: XLMRobertaModel
(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})
(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 = [
'поилка для детей',
"<category>Поїльники та непроливайки</category><brand>Nuk</brand><options><option_title>Стать дитини</option_title><option_value>Хлопчик</option_value><option_title>Стать дитини</option_title><option_value>Дівчинка</option_value><option_title>Кількість вантажних місць</option_title><option_value>1</option_value><option_title>Країна реєстрації бренда</option_title><option_value>Німеччина</option_value><option_title>Країна-виробник товару</option_title><option_value>Німеччина</option_value><option_title>Об'єм, мл</option_title><option_value>300</option_value><option_title>Матеріал</option_title><option_value>Пластик</option_value><option_title>Колір</option_title><option_value>Блакитний</option_value><option_title>Тип</option_title><option_value>Поїльник</option_value><option_title>Тип гарантійного талона</option_title><option_value>Гарантія по чеку</option_value><option_title>Доставка Premium</option_title></options>",
'Шафа розпашній Fenster Оксфорд Лагуна',
]
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
Information Retrieval
- Dataset:
rusisms-uk-title
- Evaluated with
InformationRetrievalEvaluator
Metric | Value |
---|---|
dot_accuracy@1 | 0.5429 |
dot_accuracy@3 | 0.6889 |
dot_accuracy@5 | 0.7492 |
dot_accuracy@10 | 0.8 |
dot_precision@1 | 0.5429 |
dot_precision@3 | 0.5217 |
dot_precision@5 | 0.5035 |
dot_precision@10 | 0.4768 |
dot_recall@1 | 0.0092 |
dot_recall@3 | 0.0238 |
dot_recall@5 | 0.0351 |
dot_recall@10 | 0.0599 |
dot_ndcg@10 | 0.4937 |
dot_mrr@10 | 0.6287 |
dot_map@100 | 0.1404 |
Information Retrieval
- Dataset:
rusisms-uk-title--matryoshka_dim-768--
- Evaluated with
InformationRetrievalEvaluator
Metric | Value |
---|---|
dot_accuracy@1 | 0.1619 |
dot_precision@1 | 0.1619 |
dot_recall@1 | 0.002 |
dot_ndcg@1 | 0.1619 |
dot_mrr@1 | 0.1619 |
dot_map@100 | 0.0213 |
Information Retrieval
- Dataset:
rusisms-uk-title--matryoshka_dim-512--
- Evaluated with
InformationRetrievalEvaluator
Metric | Value |
---|---|
dot_accuracy@1 | 0.146 |
dot_precision@1 | 0.146 |
dot_recall@1 | 0.0017 |
dot_ndcg@1 | 0.146 |
dot_mrr@1 | 0.146 |
dot_map@100 | 0.0152 |
Information Retrieval
- Dataset:
rusisms-uk-title--matryoshka_dim-256--
- Evaluated with
InformationRetrievalEvaluator
Metric | Value |
---|---|
dot_accuracy@1 | 0.1016 |
dot_precision@1 | 0.1016 |
dot_recall@1 | 0.0013 |
dot_ndcg@1 | 0.1016 |
dot_mrr@1 | 0.1016 |
dot_map@100 | 0.012 |
Information Retrieval
- Dataset:
rusisms-uk-title--matryoshka_dim-128--
- Evaluated with
InformationRetrievalEvaluator
Metric | Value |
---|---|
dot_accuracy@1 | 0.054 |
dot_precision@1 | 0.054 |
dot_recall@1 | 0.0007 |
dot_ndcg@1 | 0.054 |
dot_mrr@1 | 0.054 |
dot_map@100 | 0.0054 |
Training Details
Training Dataset
rztk/rozetka_positive_pairs
- Dataset: rztk/rozetka_positive_pairs
- Size: 44,800 training samples
- Columns:
query
andtext
- Approximate statistics based on the first 1000 samples:
query text type string string details - min: 3 tokens
- mean: 7.18 tokens
- max: 16 tokens
- min: 9 tokens
- mean: 158.88 tokens
- max: 512 tokens
- Samples:
query text p smart z
TPU чехол Ultrathin Series 0,33 mm для Huawei P Smart Z Безбарвний (прозорий)
p smart z
Чохли для мобільних телефонівМатеріалСиліконКолірTransparentСумісна модельP Smart Z
p smart z
TPU чехол Ultrathin Series 0,33mm для Huawei P Smart Z Бесцветный (прозрачный)
- Loss:
sentence_transformers_training.model.matryoshka2d_loss.RZTKMatryoshka2dLoss
with these parameters:{ "loss": "RZTKMultipleNegativesRankingLoss", "n_layers_per_step": 1, "last_layer_weight": 1.0, "prior_layers_weight": 1.0, "kl_div_weight": 1.0, "kl_temperature": 0.3, "matryoshka_dims": [ 768, 512, 256, 128 ], "matryoshka_weights": [ 1, 1, 1, 1 ], "n_dims_per_step": 1 }
Evaluation Dataset
rztk/rozetka_positive_pairs
- Dataset: rztk/rozetka_positive_pairs
- Size: 4,480 evaluation samples
- Columns:
query
andtext
- Approximate statistics based on the first 1000 samples:
query text type string string details - min: 3 tokens
- mean: 6.29 tokens
- max: 11 tokens
- min: 12 tokens
- mean: 161.36 tokens
- max: 512 tokens
- Samples:
query text кошелек женский
Портмоне BAELLERRY Forever N2345 Черный (020354)
кошелек женский
ГаманціBaellerryДля когоДля жінокВидПортмонеМатеріалШтучна шкіраКраїна-виробник товаруКитай
кошелек женский
Портмоне BAELLERRY Forever N2345 Черный (020354)
- Loss:
sentence_transformers_training.model.matryoshka2d_loss.RZTKMatryoshka2dLoss
with these parameters:{ "loss": "RZTKMultipleNegativesRankingLoss", "n_layers_per_step": 1, "last_layer_weight": 1.0, "prior_layers_weight": 1.0, "kl_div_weight": 1.0, "kl_temperature": 0.3, "matryoshka_dims": [ 768, 512, 256, 128 ], "matryoshka_weights": [ 1, 1, 1, 1 ], "n_dims_per_step": 1 }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy
: stepsper_device_train_batch_size
: 112per_device_eval_batch_size
: 112torch_empty_cache_steps
: 30learning_rate
: 2e-05num_train_epochs
: 1.0warmup_ratio
: 0.1bf16
: Truebf16_full_eval
: Truetf32
: Truedataloader_num_workers
: 2load_best_model_at_end
: Trueoptim
: adafactorpush_to_hub
: True
All Hyperparameters
Click to expand
overwrite_output_dir
: Falsedo_predict
: Falseeval_strategy
: stepsprediction_loss_only
: Trueper_device_train_batch_size
: 112per_device_eval_batch_size
: 112per_gpu_train_batch_size
: Noneper_gpu_eval_batch_size
: Nonegradient_accumulation_steps
: 1eval_accumulation_steps
: Nonetorch_empty_cache_steps
: 30learning_rate
: 2e-05weight_decay
: 0.0adam_beta1
: 0.9adam_beta2
: 0.999adam_epsilon
: 1e-08max_grad_norm
: 1.0num_train_epochs
: 1.0max_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
: Truefp16
: Falsefp16_opt_level
: O1half_precision_backend
: autobf16_full_eval
: Truefp16_full_eval
: Falsetf32
: Truelocal_rank
: 0ddp_backend
: Nonetpu_num_cores
: Nonetpu_metrics_debug
: Falsedebug
: []dataloader_drop_last
: Truedataloader_num_workers
: 2dataloader_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
: adafactoroptim_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
: Trueresume_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
: Falseeval_on_start
: Falseuse_liger_kernel
: Falseeval_use_gather_object
: Falsebatch_sampler
: batch_samplermulti_dataset_batch_sampler
: proportionalddp_static_graph
: Falseddp_comm_hook
: bf16gradient_as_bucket_view
: False
Training Logs
Epoch | Step | Training Loss | loss | rusisms-uk-title--matryoshka_dim-128--_dot_map@100 | rusisms-uk-title--matryoshka_dim-256--_dot_map@100 | rusisms-uk-title--matryoshka_dim-512--_dot_map@100 | rusisms-uk-title--matryoshka_dim-768--_dot_map@100 | rusisms-uk-title_dot_map@100 |
---|---|---|---|---|---|---|---|---|
0.1 | 10 | 6.6103 | - | - | - | - | - | - |
0.2 | 20 | 5.524 | - | - | - | - | - | - |
0.3 | 30 | 4.759 | 3.6444 | - | - | - | - | - |
0.4 | 40 | 4.5195 | - | - | - | - | - | - |
0.5 | 50 | 3.6598 | - | - | - | - | - | - |
0.6 | 60 | 3.7912 | 2.8962 | - | - | - | - | - |
0.7 | 70 | 3.9935 | - | - | - | - | - | - |
0.8 | 80 | 3.3929 | - | - | - | - | - | - |
0.9 | 90 | 3.6101 | 2.6889 | - | - | - | - | - |
1.0 | 100 | 3.8753 | - | 0.0054 | 0.0120 | 0.0152 | 0.0213 | 0.1404 |
- The bold row denotes the saved checkpoint.
Framework Versions
- Python: 3.12.6
- Sentence Transformers: 3.0.1
- Transformers: 4.45.1
- PyTorch: 2.4.1
- Accelerate: 0.34.2
- Datasets: 3.0.0
- Tokenizers: 0.20.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
- 47
Inference Providers
NEW
This model is not currently available via any of the supported third-party Inference Providers, and
the model is not deployed on the HF Inference API.
Model tree for rztk-bohdanbilonoh/multilingual-e5-base-test
Base model
intfloat/multilingual-e5-baseEvaluation results
- Dot Accuracy@1 on rusisms uk titleself-reported0.543
- Dot Accuracy@3 on rusisms uk titleself-reported0.689
- Dot Accuracy@5 on rusisms uk titleself-reported0.749
- Dot Accuracy@10 on rusisms uk titleself-reported0.800
- Dot Precision@1 on rusisms uk titleself-reported0.543
- Dot Precision@3 on rusisms uk titleself-reported0.522
- Dot Precision@5 on rusisms uk titleself-reported0.503
- Dot Precision@10 on rusisms uk titleself-reported0.477
- Dot Recall@1 on rusisms uk titleself-reported0.009
- Dot Recall@3 on rusisms uk titleself-reported0.024