/ Модель

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

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

emb-all-MiniLM-L6-v2-squad-8-epochs

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

Дообученный англоязычный энкодер предложений, создающий эмбеддинги для семантического поиска и сопоставления вопросов с релевантными текстами.

22скачиваний за 30 дней0лайковвеса обновлены9 апр 2025

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

ayushexel/emb-all-MiniLM-L6-v2-squad-8-epochs — дообученная модель Sentence Transformers на базе sentence-transformers/all-MiniLM-L6-v2. Это плотный BERT-энкодер на 25,9 млн параметров, который преобразует предложения и абзацы в нормализованные векторы размерности 384; сходство текстов оценивается косинусной близостью. Модель обучалась на примерах с вопросами, подходящими контекстами и отрицательными примерами.

Модель предназначена для семантического поиска и сопоставления вопроса с релевантным фрагментом, а также для оценки сходства предложений, поиска перефразировок, кластеризации и классификации текста на основе эмбеддингов. В README указана максимальная длина последовательности 256 токенов, тогда как метаданные указывают контекст 512 токенов. Поддержка языков явно не перечислена; базовая модель описана как англоязычная, поэтому прежде всего модель рассчитана на английский. Данных о лицензии в предоставленной карточке нет.

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

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

Ограничения

Ограничение длины последовательности в README составляет 256 токенов; метаданные указывают контекст 512 токенов. Англоязычная базовая модель не подтверждает надёжную работу на других языках.

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

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

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

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

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

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

Открыть на Hugging Face

SentenceTransformer based on sentence-transformers/all-MiniLM-L6-v2

This is a sentence-transformers model finetuned from sentence-transformers/all-MiniLM-L6-v2. 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

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("ayushexel/emb-all-MiniLM-L6-v2-squad-8-epochs")
# Run inference
sentences = [
    'Who raised Victoria?',
    "Victoria was the daughter of Prince Edward, Duke of Kent and Strathearn, the fourth son of King George III. Both the Duke of Kent and King George III died in 1820, and Victoria was raised under close supervision by her German-born mother Princess Victoria of Saxe-Coburg-Saalfeld. She inherited the throne aged 18, after her father's three elder brothers had all died, leaving no surviving legitimate children. The United Kingdom was already an established constitutional monarchy, in which the sovereign held relatively little direct political power. Privately, Victoria attempted to influence government policy and ministerial appointments; publicly, she became a national icon who was identified with strict standards of personal morality.",
    'Though queen, as an unmarried young woman Victoria was required by social convention to live with her mother, despite their differences over the Kensington System and her mother\'s continued reliance on Conroy. Her mother was consigned to a remote apartment in Buckingham Palace, and Victoria often refused to see her. When Victoria complained to Melbourne that her mother\'s close proximity promised "torment for many years", Melbourne sympathised but said it could be avoided by marriage, which Victoria called a "schocking  [sic] alternative". She showed interest in Albert\'s education for the future role he would have to play as her husband, but she resisted attempts to rush her into wedlock.',
]
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

Triplet

MetricValue
cosine_accuracy0.4038

Training Details

Training Dataset

Unnamed Dataset

  • Size: 44,286 training samples
  • Columns: question, context, and negative
  • Approximate statistics based on the first 1000 samples:
    questioncontextnegative
    typestringstringstring
    detailsmin: 6 tokensmean: 14.54 tokensmax: 41 tokensmin: 28 tokensmean: 143.87 tokensmax: 256 tokensmin: 29 tokensmean: 150.25 tokensmax: 256 tokens
  • Samples:
    questioncontextnegative
    In what years did Ado Grenzstein do journalism work in Estonia?Estonian language planners such as Ado Grenzstein (a journalist active in Estonia in the 1870s–90s) tried to use formation ex nihilo, Urschöpfung; i.e. they created new words out of nothing.During the Perestroika era, The Law on the Status of the Estonian Language was adopted in January 1989. The collapse of the Soviet Union led to the restoration of Republic of Estonia's independence. Estonian went back to being the only state language in Estonia which in practice meant that use of Estonian was promoted while the use of Russian was discouraged.
    These civic ideas allowed what to come into being?The architecture and urbanism of the Classical civilizations such as the Greek and the Roman evolved from civic ideals rather than religious or empirical ones and new building types emerged. Architectural "style" developed in the form of the Classical orders.These theorists were driven by two basic questions: one, by what right or need do people form states; and two, what the best form for a state could be. These fundamental questions involved a conceptual distinction between the concepts of "state" and "government." It was decided that "state" would refer to a set of enduring institutions through which power would be distributed and its use justified. The term "government" would refer to a specific group of people who occupied the institutions of the state, and create the laws and ordinances by which the people, themselves included, would be bound. This conceptual distinction continues to operate in political science, although some political scientists, philosophers, historians and cultural anthropologists have argued that most political action in any given society occurs outside of its state, and that there are societies that are not organized into states that nevertheless must be considered in political terms. As long as the concept of ...
    What is the the Information Management Group responsible for?Among other things, the Information Management Group is responsible for the conduct of electronic warfare and the protection of the Armed Forces' communications and computer networks. Within the group, this operational role is fulfilled by the Canadian Forces Information Operations Group, headquartered at CFS Leitrim in Ottawa, which operates the following units: the Canadian Forces Information Operations Group Headquarters (CFIOGHQ), the Canadian Forces Electronic Warfare Centre (CFEWC), the Canadian Forces Network Operation Centre (CFNOC), the Canadian Forces Signals Intelligence Operations Centre (CFSOC), the Canadian Forces Station (CFS) Leitrim, and the 764 Communications Squadron. In June 2011 the Canadian Armed Forces Chief of Force Development announced the establishment of a new organization, the Directorate of Cybernetics, headed by a Brigadier General, the Director General Cyber (DG Cyber). Within that directorate the newly established CAF Cyber Task Force, has been tasked t...The Criminal Justice Information Services (CJIS) Division, is located in Clarksburg, West Virginia. Organized beginning in 1991, the office opened in 1995 as the youngest agency division. The complex is the length of three football fields. It provides a main repository for information in various data systems. Under the roof of the CJIS are the programs for the National Crime Information Center (NCIC), Uniform Crime Reporting (UCR), Fingerprint Identification, Integrated Automated Fingerprint Identification System (IAFIS), NCIC 2000, and the National Incident-Based Reporting System (NIBRS). Many state and local agencies use these data systems as a source for their own investigations and contribute to the database using secure communications. FBI provides these tools of sophisticated identification and information services to local, state, federal, and international law enforcement agencies.
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Evaluation Dataset

Unnamed Dataset

  • Size: 5,000 evaluation samples
  • Columns: question, context, and negative_1
  • Approximate statistics based on the first 1000 samples:
    questioncontextnegative_1
    typestringstringstring
    detailsmin: 3 tokensmean: 14.52 tokensmax: 32 tokensmin: 31 tokensmean: 148.16 tokensmax: 256 tokensmin: 31 tokensmean: 146.84 tokensmax: 256 tokens
  • Samples:
    questioncontextnegative_1
    Where were the soldiers under commander Yang Wenyao trying to go?Many rescue teams, including that of the Taipei Fire Department from Taiwan, were reported ready to join the rescue effort in Sichuan as early as Wednesday. However, the Red Cross Society of China said that (on May 13) "it was inconvenient currently due to the traffic problem to the hardest hit areas closest to the epicenter." The Red Cross Society of China also stated that the disaster areas need tents, medical supplies, drinking water and food; however it recommended donating cash instead of other items, as it had not been possible to reach roads that were completely damaged or places that were blocked off by landslides. Landslides continuously threatened the progress of a search and rescue group of 80 men, each carrying about 40 kg of relief supplies, from a motorized infantry brigade under commander Yang Wenyao, as they tried to reach the ethnically Tibetan village of Sier at a height of 4000 m above sea level in Pingwu county. The extreme terrain conditions precluded the use of he...Armed conflict between ethnic Chinese rebels and the Myanmar Armed Forces have resulted in the Kokang offensive in February 2015. The conflict had forced 40,000 to 50,000 civilians to flee their homes and seek shelter on the Chinese side of the border. During the incident the government of China was accused of giving military assistance to the ethnic Chinese rebels. Burmese officials have been historically 'manipulated' and pressured by the communist Chinese government throughout Burmese modern history to create closer and binding ties with China, creating a Chinese satellite state in Southeast Asia.
    If the brewery tap is not located in the brewery, where is it usually located?A brewery tap is the nearest outlet for a brewery's beers. This is usually a room or bar in the brewery itself, though the name may be applied to the nearest pub. The term is not applied to a brewpub which brews and sells its beer on the same premises.A brewery tap is the nearest outlet for a brewery's beers. This is usually a room or bar in the brewery itself, though the name may be applied to the nearest pub. The term is not applied to a brewpub which brews and sells its beer on the same premises.
    Who teaches Yale's residential college's undergraduate classes?Yale's residential college system was established in 1933 by Edward S. Harkness, who admired the social intimacy of Oxford and Cambridge and donated significant funds to found similar colleges at Yale and Harvard. Though Yale's colleges resemble their English precursors organizationally and architecturally, they are dependent entities of Yale College and have limited autonomy. The colleges are led by a master and an academic dean, who reside in the college, and university faculty and affiliates comprise each college's fellowship. Colleges offer their own seminars, social events, and speaking engagements known as "Master's Teas," but do not contain programs of study or academic departments. Instead, all undergraduate courses are taught by the Faculty of Arts and Sciences and are open to members of any college.Yale's residential college system was established in 1933 by Edward S. Harkness, who admired the social intimacy of Oxford and Cambridge and donated significant funds to found similar colleges at Yale and Harvard. Though Yale's colleges resemble their English precursors organizationally and architecturally, they are dependent entities of Yale College and have limited autonomy. The colleges are led by a master and an academic dean, who reside in the college, and university faculty and affiliates comprise each college's fellowship. Colleges offer their own seminars, social events, and speaking engagements known as "Master's Teas," but do not contain programs of study or academic departments. Instead, all undergraduate courses are taught by the Faculty of Arts and Sciences and are open to members of any college.
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 256
  • per_device_eval_batch_size: 256
  • num_train_epochs: 8
  • warmup_ratio: 0.1
  • fp16: True
  • batch_sampler: no_duplicates

All Hyperparameters

  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: steps
  • prediction_loss_only: True
  • per_device_train_batch_size: 256
  • per_device_eval_batch_size: 256
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 5e-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: 8
  • max_steps: -1
  • lr_scheduler_type: linear
  • 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: False
  • fp16: True
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • 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: False
  • 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
  • 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
  • dispatch_batches: None
  • split_batches: 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 LossValidation Lossgooqa-dev_cosine_accuracy
-1-1--0.3256
0.57801000.56270.88110.3898
1.15612000.4780.84820.4000
1.73413000.41280.84520.4014
2.31214000.36620.84500.4010
2.89025000.32890.83000.4032
3.46826000.27970.82280.4058
4.04627000.26940.82530.4030
4.62438000.23290.83010.4006
5.20239000.22420.82810.4062
5.780310000.20890.82900.4012
6.358411000.19820.83100.4022
6.936412000.19280.82920.4058
7.514513000.17840.82930.4058
-1-1--0.4038

Framework Versions

  • Python: 3.11.0
  • Sentence Transformers: 4.0.1
  • Transformers: 4.50.3
  • PyTorch: 2.6.0+cu124
  • Accelerate: 1.5.2
  • Datasets: 3.5.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}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей