/ Модель

Характеристики

Контекст
512 токенов
Параметры
25,9 млн
Лицензия
Apache 2.0
Архитектура
bert · dense
Базовая модель
all-MiniLM-L6-v2
Библиотека
sentence-transformers
Опубликована
13 июл 2025

all-MiniLM-L6-v2-legal-matryoshka

ЭмбеддингиТекст → embedding10 профессий

Англоязычная модель эмбеддингов на базе all-MiniLM-L6-v2 для семантического поиска, сравнения и кластеризации предложений и абзацев.

157скачиваний за 30 дней0лайковвеса обновлены13 июл 2025

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Эмбеддинги» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

IoannisKat1 выпустил англоязычную модель Sentence Transformers для получения векторных представлений предложений и абзацев, дообученную на базе sentence-transformers/all-MiniLM-L6-v2 на 1 580 парах текстов. Это энкодер на архитектуре BERT с 25,9 млн параметров: он усредняет токенные представления, нормализует результат и формирует векторы размерностью 384, сравниваемые по косинусному сходству. Контекст в метаданных указан как 512 токенов, а README заявляет максимальную длину последовательности 256 токенов.

Модель предназначена для семантического поиска и сравнения текстов, поиска перефразирований, кластеризации и извлечения признаков для классификации. Matryoshka-обучение позволяет использовать усечённые векторы размерностью 256, 128 или 64; в README приведены результаты оценки поиска для этих размерностей. Модель принимает текст и выдаёт векторные представления. Лицензия — Apache-2.0.

Сценарии применения

  • семантический поиск по англоязычным документам
  • ранжирование текстов по смысловой близости
  • поиск перефразирований и похожих предложений
  • кластеризация англоязычных текстов
  • извлечение признаков текста для классификации

Ограничения

Модель рассчитана на английский язык и ограничена длиной последовательности: README указывает 256 токенов, тогда как метаданные сообщают контекст 512 токенов. Оценки поиска в карточке приведены для конкретного набора данных и не гарантируют качество на других корпусах.

Для каких профессий подходит10

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

ModernBERT Embed base Legal Matryoshka

This is a sentence-transformers model finetuned from sentence-transformers/all-MiniLM-L6-v2 on the json dataset. 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-L6-v2
  • Maximum Sequence Length: 256 tokens
  • Output Dimensionality: 384 dimensions
  • Similarity Function: Cosine Similarity
  • Training Dataset:
    • json
  • Language: en
  • License: apache-2.0

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 256, '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("IoannisKat1/all-MiniLM-L6-v2-legal-matryoshka")
# Run inference
sentences = [
    'When may the controller charge a reasonable fee to the data subject?',
    '1.The controller shall take appropriate measures to provide any information referred to in Articles 13 and 14 and any communication under Articles 15 to 22 and 34 relating to processing to the data subject in a concise, transparent, intelligible and easily accessible form, using clear and plain language, in particular for any information addressed specifically to a child. The information shall be provided in writing, or by other means, including, where appropriate, by electronic means. When requested by the data subject, the information may be provided orally, provided that the identity of the data subject is proven by other means. 4.5.2016 L 119/39  \n2.The controller shall facilitate the exercise of data subject rights under Articles 15 to 22. In the cases referred to in Article 11(2), the controller shall not refuse to act on the request of the data subject for exercising his or her rights under Articles 15 to 22, unless the controller demonstrates that it is not in a position to identify the data subject.\n3.The controller shall provide information on action taken on a request under Articles 15 to 22 to the data subject without undue delay and in any event within one month of receipt of the request. That period may be extended by two further months where necessary, taking into account the complexity and number of the requests. The controller shall inform the data subject of any such extension within one month of receipt of the request, together with the reasons for the delay. Where the data subject makes the request by electronic form means, the information shall be provided by electronic means where possible, unless otherwise requested by the data subject.\n4.If the controller does not take action on the request of the data subject, the controller shall inform the data subject without delay and at the latest within one month of receipt of the request of the reasons for not taking action and on the possibility of lodging a complaint with a supervisory authority and seeking a judicial remedy.\n5.Information provided under Articles 13 and 14 and any communication and any actions taken under Articles 15 to 22 and 34 shall be provided free of charge. Where requests from a data subject are manifestly unfounded or excessive, in particular because of their repetitive character, the controller may either: (a)  charge a reasonable fee taking into account the administrative costs of providing the information or communication or taking the action requested; or (b)  refuse to act on the request. The controller shall bear the burden of demonstrating the manifestly unfounded or excessive character of the request.\n6.Without prejudice to Article 11, where the controller has reasonable doubts concerning the identity of the natural person making the request referred to in Articles 15 to 21, the controller may request the provision of additional information necessary to confirm the identity of the data subject.\n7.The information to be provided to data subjects pursuant to Articles 13 and 14 may be provided in combination with standardised icons in order to give in an easily visible, intelligible and clearly legible manner a meaningful overview of the intended processing. Where the icons are presented electronically they shall be machine-readable.\n8.The Commission shall be empowered to adopt delegated acts in accordance with Article 92 for the purpose of determining the information to be presented by the icons and the procedures for providing standardised icons. Section 2 Information and access to personal data',
    'In order to ensure a consistent and high level of protection of natural persons and to remove the obstacles to flows of personal data within the Union, the level of protection of the rights and freedoms of natural persons with regard to the processing of such data should be equivalent in all Member States. Consistent and homogenous application of the rules for the protection of the fundamental rights and freedoms of natural persons with regard to the processing of personal data should be ensured throughout the Union. Regarding the processing of personal data for compliance with a legal obligation, for the performance of a task carried out in the public interest or in the exercise of official authority vested in the controller, Member States should be allowed to maintain or introduce national provisions to further specify the application of the rules of this Regulation. In conjunction with the general and horizontal law on data protection implementing Directive 95/46/EC, Member States have several sector-specific laws in areas that need more specific provisions. This Regulation also provides a margin of manoeuvre for Member States to specify its rules, including for the processing of special categories of personal data (‘sensitive data’). To that extent, this Regulation does not exclude Member State law that sets out the circumstances for specific processing situations, including determining more precisely the conditions under which the processing of personal data is lawful. 4.5.2016 L 119/2 Official Journal of the European Union EN',
]
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]

Evaluation

Metrics

Information Retrieval

MetricValue
cosine_accuracy@10.4141
cosine_accuracy@30.452
cosine_accuracy@50.4874
cosine_accuracy@100.5354
cosine_precision@10.4141
cosine_precision@30.4015
cosine_precision@50.3732
cosine_precision@100.3361
cosine_recall@10.0822
cosine_recall@30.2122
cosine_recall@50.279
cosine_recall@100.3908
cosine_ndcg@100.4708
cosine_mrr@100.4411
cosine_map@1000.5192

Information Retrieval

MetricValue
cosine_accuracy@10.4167
cosine_accuracy@30.4495
cosine_accuracy@50.4722
cosine_accuracy@100.5227
cosine_precision@10.4167
cosine_precision@30.4007
cosine_precision@50.3692
cosine_precision@100.3278
cosine_recall@10.0832
cosine_recall@30.2108
cosine_recall@50.2719
cosine_recall@100.3754
cosine_ndcg@100.4636
cosine_mrr@100.4395
cosine_map@1000.5182

Information Retrieval

MetricValue
cosine_accuracy@10.4167
cosine_accuracy@30.452
cosine_accuracy@50.4722
cosine_accuracy@100.5
cosine_precision@10.4167
cosine_precision@30.4057
cosine_precision@50.3753
cosine_precision@100.3258
cosine_recall@10.0793
cosine_recall@30.2059
cosine_recall@50.2724
cosine_recall@100.3712
cosine_ndcg@100.4585
cosine_mrr@100.4376
cosine_map@1000.5028

Information Retrieval

MetricValue
cosine_accuracy@10.3712
cosine_accuracy@30.3965
cosine_accuracy@50.4167
cosine_accuracy@100.4596
cosine_precision@10.3712
cosine_precision@30.3561
cosine_precision@50.3273
cosine_precision@100.2891
cosine_recall@10.0748
cosine_recall@30.1863
cosine_recall@50.2404
cosine_recall@100.3351
cosine_ndcg@100.409
cosine_mrr@100.3897
cosine_map@1000.4594

Training Details

Training Dataset

json

  • Dataset: json
  • Size: 1,580 training samples
  • Columns: anchor and positive
  • Approximate statistics based on the first 1000 samples:
    anchorpositive
    typestringstring
    detailsmin: 7 tokensmean: 15.59 tokensmax: 37 tokensmin: 25 tokensmean: 217.01 tokensmax: 256 tokens
  • Samples:
    anchorpositive
    What should the right to receive personal data not prejudice according to the text?To further strengthen the control over his or her own data, where the processing of personal data is carried out by automated means, the data subject should also be allowed to receive personal data concerning him or her which he or she has provided to a controller in a structured, commonly used, machine-readable and interoperable format, and to transmit it to another controller. Data controllers should be encouraged to develop interoperable formats that enable data portability. That right should apply where the data subject provided the personal data on the basis of his or her consent or the processing is necessary for the performance of a contract. It should not apply where processing is based on a legal ground other than consent or contract. By its very nature, that right should not be exercised against controllers processing personal data in the exercise of their public duties. It should therefore not apply where the processing of the personal data is necessary for compliance with a...
    What devices can the plaintiff use to conduct transactions without physical presence at the branches of the defendant bank?**Court (Civil/Criminal): Civil Provisions: Time of commission of the act: Outcome (not guilty, guilty): Rejects the lawsuit. Reasoning: Facts: The plaintiff holds account number ....................... at the defendant bank. Following the application/contract dated January 9, 2019, the plaintiff became a subscriber to the alternative service networks provided by the defendant bank through online banking (.........................). In the aforementioned application, the plaintiff stated that her mobile phone (number .................) would be used by the defendant to send additional security codes for the approval of her transactions via .......................... It is noted that the plaintiff received subscriber code .................., thus enabling her to conduct transactions without her physical presence at the branches of the defendant bank, from fixed or mobile devices (computers, smartphones, tablets), by entering her username and password to access her personal acc...
    What may a complainant do if a complaint has been rejected by a supervisory authority?Any natural or legal person has the right to bring an action for annulment of decisions of the Board before the Court of Justice under the conditions provided for in Article 263 TFEU. As addressees of such decisions, the supervisory authorities concerned which wish to challenge them have to bring action within two months of being notified of them, in accordance with Article 263 TFEU. Where decisions of the Board are of direct and individual concern to a controller, processor or complainant, the latter may bring an action for annulment against those decisions within two months of their publication on the website of the Board, in accordance with Article 263 TFEU. Without prejudice to this right under Article 263 TFEU, each natural or legal person should have an effective judicial remedy before the competent national court against a decision of a supervisory authority which produces legal effects concerning that person. Such a decision concerns in particular the exercise of investigative,...
  • Loss: MatryoshkaLoss with these parameters:
    {
        "loss": "MultipleNegativesRankingLoss",
        "matryoshka_dims": [
            384,
            256,
            128,
            64
        ],
        "matryoshka_weights": [
            1,
            1,
            1,
            1
        ],
        "n_dims_per_step": -1
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: epoch
  • gradient_accumulation_steps: 2
  • learning_rate: 2e-05
  • num_train_epochs: 15
  • lr_scheduler_type: cosine
  • warmup_ratio: 0.1
  • bf16: True
  • tf32: True
  • load_best_model_at_end: True
  • optim: adamw_torch_fused
  • batch_sampler: no_duplicates

All Hyperparameters

  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: epoch
  • prediction_loss_only: True
  • per_device_train_batch_size: 8
  • per_device_eval_batch_size: 8
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 2
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 2e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1.0
  • num_train_epochs: 15
  • max_steps: -1
  • lr_scheduler_type: cosine
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.1
  • warmup_steps: 0
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • save_safetensors: True
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • no_cuda: False
  • use_cpu: False
  • use_mps_device: False
  • seed: 42
  • data_seed: None
  • jit_mode_eval: False
  • use_ipex: False
  • bf16: True
  • fp16: False
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: True
  • local_rank: 0
  • ddp_backend: None
  • tpu_num_cores: None
  • tpu_metrics_debug: False
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • past_index: -1
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: True
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_min_num_params: 0
  • fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • tp_size: 0
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch_fused
  • optim_args: None
  • adafactor: False
  • group_by_length: False
  • length_column_name: length
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • skip_memory_metrics: True
  • use_legacy_prediction_loop: False
  • push_to_hub: False
  • resume_from_checkpoint: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_private_repo: None
  • hub_always_push: False
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • include_for_metrics: []
  • eval_do_concat_batches: True
  • fp16_backend: auto
  • push_to_hub_model_id: None
  • push_to_hub_organization: None
  • mp_parameters:
  • auto_find_batch_size: False
  • full_determinism: False
  • torchdynamo: None
  • ray_scope: last
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: False
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • eval_on_start: False
  • use_liger_kernel: False
  • eval_use_gather_object: False
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: no_duplicates
  • multi_dataset_batch_sampler: proportional

Training Logs

EpochStepTraining Lossdim_384_cosine_ndcg@10dim_256_cosine_ndcg@10dim_128_cosine_ndcg@10dim_64_cosine_ndcg@10
0.1010109.0952----
0.2020208.9081----
0.3030307.8026----
0.4040408.3378----
0.5051508.0661----
0.6061609.8242----
0.7071706.3302----
0.8081806.734----
0.9091907.2678----
1.099-0.38330.35660.34140.2912
1.01011007.1781----
1.11111104.8977----
1.21211206.2696----
1.31311305.5412----
1.41411405.219----
1.51521505.479----
1.61621604.863----
1.71721705.7901----
1.81821804.9455----
1.91921905.4065----
2.0198-0.41300.39560.38150.3221
2.02022003.71----
2.12122104.6268----
2.22222203.2052----
2.32322304.692----
2.42422404.1091----
2.52532503.7498----
2.62632603.9706----
2.72732703.9981----
2.82832803.5405----
2.92932904.0765----
3.0297-0.43330.43080.40650.3411
3.03033002.83----
3.13133102.667----
3.23233203.3436----
3.33333302.9749----
3.43433402.4349----
3.53543502.7929----
3.63643603.1146----
3.73743702.8317----
3.83843803.2532----
3.93943903.5831----
4.0396-0.45920.44130.42740.3743
4.04044003.166----
4.14144102.9408----
4.24244201.9234----
4.34344302.7478----
4.44444402.1347----
4.54554502.5566----
4.64654602.2541----
4.74754702.5956----
4.84854802.4867----
4.94954902.1738----
5.0495-0.44650.44810.41700.3747
5.05055002.3014----
5.15155101.4828----
5.25255202.046----
5.35355301.6265----
5.45455401.9582----
5.55565502.5307----
5.65665602.308----
5.75765701.3316----
5.85865801.7351----
5.95965901.8462----
6.0594-0.48590.47060.44560.3907
6.06066001.5274----
6.16166102.2816----
6.26266201.4639----
6.36366301.3246----
6.46466401.9837----
6.56576501.8552----
6.66676601.5951----
6.76776701.3286----
6.86876801.3191----
6.96976901.7146----
7.0693-0.48250.46860.42850.3948
7.07077001.3537----
7.17177101.2444----
7.27277201.3479----
7.37377301.9802----
7.47477401.5059----
7.57587501.3042----
7.67687601.3857----
7.77787701.5275----
7.87887801.3907----
7.97987901.5492----
8.0792-0.47080.46360.45850.409
8.08088001.0543----
8.18188100.9813----
8.28288201.1873----
8.38388301.3405----
8.48488401.6782----
8.58598501.2311----
8.68698601.9342----
8.78798700.8973----
8.88898802.1017----
8.98998901.2202----
9.0891-0.47640.48250.45780.4128
9.09099001.0014----
9.19199100.8363----
9.29299200.9542----
9.39399301.1752----
9.49499401.3158----
9.59609501.7042----
9.69709600.8945----
9.79809701.0183----
9.89909801.099----
10.09901.51320.48160.48480.45320.4187
-1-1-0.47080.46360.45850.4090
  • The bold row denotes the saved checkpoint.

Framework Versions

  • Python: 3.11.13
  • Sentence Transformers: 4.1.0
  • Transformers: 4.51.3
  • PyTorch: 2.6.0+cu124
  • Accelerate: 1.8.1
  • Datasets: 4.0.0
  • Tokenizers: 0.21.2

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",
}

MatryoshkaLoss

@misc{kusupati2024matryoshka,
    title={Matryoshka Representation Learning},
    author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
    year={2024},
    eprint={2205.13147},
    archivePrefix={arXiv},
    primaryClass={cs.LG}
}

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}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · sentence-transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
BertModel
Ревизия весов
e6d7dd8

0 моделей