Downloads · 30 days
107
35% of all-time downloads
rztk-bohdanbilonoh/multilingual-e5-base-test
multilingual-e5-base-test is a sentence similarity model from rztk-bohdanbilonoh. Use it when you need a score for how close two texts are. It is set up for sentence-transformers.
This is a sentence-transformers model finetuned from intfloat/multilingual-e5-base on the rztk/rozetkapositivepairs dataset. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for s…
Downloads · 30 days
107
35% of all-time downloads
All-time downloads
309
Public
Parameters
278M
2.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors556 MB · 96%
From the Hugging Face model README
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.
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()
)
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]
<!--
### Direct Usage (Transformers)
<details><summary>Click to see the direct usage in Transformers</summary>
</details>
-->
<!--
### Downstream Usage (Sentence Transformers)
You can finetune this model on your own dataset.
<details><summary>Click to expand</summary>
</details>
-->
<!--
### Out-of-Scope Use
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
-->
rusisms-uk-title| 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 |
rusisms-uk-title--matryoshka_dim-768--| 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 |
rusisms-uk-title--matryoshka_dim-512--| 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 |
rusisms-uk-title--matryoshka_dim-256--| 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 |
rusisms-uk-title--matryoshka_dim-128--| 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 |
| query | text | |
|---|---|---|
| type | string | string |
| details | <ul><li>min: 3 tokens</li><li>mean: 7.18 tokens</li><li>max: 16 tokens</li></ul> | <ul><li>min: 9 tokens</li><li>mean: 158.88 tokens</li><li>max: 512 tokens</li></ul> |
| query | text |
|---|---|
| <code>p smart z</code> | <code>TPU чехол Ultrathin Series 0,33 mm для Huawei P Smart Z Безбарвний (прозорий)</code> |
| <code>p smart z</code> | <code><category>Чохли для мобільних телефонів</category><options><option_title>Матеріал</option_title><option_value>Силікон</option_value><option_title>Колір</option_title><option_value>Transparent</option_value><option_title>Сумісна модель</option_title><option_value>P Smart Z</option_value></options></code> |
| <code>p smart z</code> | <code>TPU чехол Ultrathin Series 0,33mm для Huawei P Smart Z Бесцветный (прозрачный)</code> |
{
"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
}
| query | text | |
|---|---|---|
| type | string | string |
| details | <ul><li>min: 3 tokens</li><li>mean: 6.29 tokens</li><li>max: 11 tokens</li></ul> | <ul><li>min: 12 tokens</li><li>mean: 161.36 tokens</li><li>max: 512 tokens</li></ul> |
| query | text |
|---|---|
| <code>кошелек женский</code> | <code>Портмоне BAELLERRY Forever N2345 Черный (020354)</code> |
| <code>кошелек женский</code> | <code><category>Гаманці</category><brand>Baellerry</brand><options><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></options></code> |
| <code>кошелек женский</code> | <code>Портмоне BAELLERRY Forever N2345 Черный (020354)</code> |
{
"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
}
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: Trueoverwrite_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| 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 |
@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",
}
<!--
## Glossary
*Clearly define terms in order to be accessible across audiences.*
-->
<!--
## Model Card Authors
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
-->
<!--
## Model Card Contact
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
-->