/ Модель

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

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

sentence-transformers_all-MiniLM-L6-v2_retrieval_finetuned_2025-03-29_23-44-08

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

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

125скачиваний за 30 дней0лайковвеса обновлены29 мар 2025

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Модель подходит для семантического поиска и сравнения текстов, поиска перефразировок, кластеризации и классификации текстов на основе эмбеддингов. Она обучена с TripletLoss на наборе из 309 примеров; в README приведена точность cosine_accuracy 0,8 на тестовой оценке. Англоязычная базовая модель предполагает основное применение для английского текста. Для использования нужны Sentence Transformers или совместимая система извлечения эмбеддингов. Лицензия в предоставленных данных не указана.

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

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

Ограничения

Модель ориентирована на английский язык, а README указывает максимальную длину последовательности 256 токенов. Обучение описано на небольшом наборе из 309 примеров; приведённая тестовая cosine_accuracy составляет 0,8.

Для каких профессий подходит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("CatkinChen/sentence-transformers_all-MiniLM-L6-v2_retrieval_finetuned_2025-03-29_23-44-08")
# Run inference
sentences = [
    'What is the name of the magical candy that explodes?',
    'Book: 3, Chapter: 10\nPassage: Harry reached the door at the top of the stairs, slipped through it, and found himself behind the counter of Honeydukes - he ducked, crept sideways, and then straightened up. Honeydukes was so crowded with Hogwarts students that no one looked twice at Harry. He edged among them, looking around, and suppressed a laugh as he imagined the look that would spread over Dudley\'s piggy face if he could see where Harry was now. There were shelves upon shelves of the most succulent-looking sweets imaginable. Creamy chunks of nougat, shimmering pink squares of coconut ice, fat, honey-colored toffees; hundreds of different kinds of chocolate in neat rows; there was a large barrel of Every Flavor Beans, and another of Fizzing Whizbees, the levitating sherbert balls that Ron had mentioned; along yet another wall were "Special Effects" sweets: Drooble\'s Best Blowing Gum (which filled a room with bluebell-colored bubbles that refused to pop for days), the strange, splintery Toothflossing Stringmints, tiny black Pepper Imps ("breathe fire for your friends! "), Ice Mice ("hear your teeth chatter and squeak! "), peppermint creams shaped like toads ("hop realistically in the stomach! "), fragile sugar-spun quills, and exploding bonbons. Harry squeezed himself through a crowd of sixth years and saw a sign hanging in the farthest corner of the shop (UNUSUAL TASTES).',
    'Book: 2, Chapter: 8\nPassage: But I mean to say - look at the fellow -"\n"I think," said Harry hurriedly, at a meaningful look from Nick, "Nick\'s very - frightening and - er -"\n"Ha!" yelled Sir Patrick\'s head. "Bet he asked you to say that!" "If I could have everyone\'s attention, it\'s time for my speech!" said Nearly Headless Nick loudly, striding toward the podium and climbing into an icy blue spotlight. "My late lamented lords, ladies, and gentlemen, it is my great sorrow ..."\nBut nobody heard much more. Sir Patrick and the rest of the Headless Hunt had just started a game of Head Hockey and the crowd were turning to watch. Nearly Headless Nick tried vainly to recapture his audience, but gave up as Sir Patrick\'s head went sailing past him to loud cheers. Harry was very cold by now, not to mention hungry.',
]
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.8

Training Details

Training Dataset

Unnamed Dataset

  • Size: 309 training samples
  • Columns: sentence_0, sentence_1, and sentence_2
  • Approximate statistics based on the first 309 samples:
    sentence_0sentence_1sentence_2
    typestringstringstring
    detailsmin: 9 tokensmean: 17.74 tokensmax: 53 tokensmin: 46 tokensmean: 187.05 tokensmax: 256 tokensmin: 40 tokensmean: 163.65 tokensmax: 256 tokens
  • Samples:
    sentence_0sentence_1sentence_2
    Who is the founder of Gryffindor house?Book: 2, Chapter: 9Passage: He peered at Hermione as though he had never seen a student properly before. "However, the legend of which you speak is such a very sensational, even ludicrous tale -"But the whole class was now hanging on Professor Binns's every word. He looked dimly at them all, every face turned to his. Harry could tell he was completely thrown by such an unusual show of interest. "Oh, very well," he said slowly. "Let me see ... the Chamber of Secrets ..."You all know, of course, that Hogwarts was founded over a thousand years ago - the precise date is uncertain - by the four greatest witches and wizards of the age. The four school Houses are named after them: Godric Gryffindor, Helga Hufflepuff, Rowena Ravenclaw, and Salazar Slytherin. They built this castle together, far from prying Muggle eyes, for it was an age when magic was feared by common people, and witches and wizards suffered much persecution."Book: 3, Chapter: 15Passage: "Down here -"Harry looked quickly back out of the window. Crookshanks and the dog had vanished. Harry climbed onto the windowsill to look right down into the shadows of the castle, but they weren't there. Where had they gone? A loud snore told him Ron had fallen asleep again. Harry and the rest of the Gryffindor team entered the Great Hall the next day to enormous applause. Harry couldn't help grinning broadly as he saw that both the Ravenclaw and Hufflepuff tables were applauding them too.
    What magical creature does Hagrid keep in his hut in Harry's third year?Book: 3, Chapter: 11Passage: choked Hagrid, wiping his eyes on his sleeve. "They've got it in fer interestin' creatures!" A sudden sound from the corner of Hagrid's cabin made Harry, Ron, and Hermione whip around. Buckbeak the hippogriff was lying in the corner, chomping on something that was oozing blood all over the floor. "I couldn' leave him tied up out there in the snow!" choked Hagrid. "All on his own! At Christmas." Harry, Ron, and Hermione looked at one another. They had never seen eye to eye with Hagrid about what he called "interesting creatures" and other people called "terrifying monsters." On the other hand, there didn't seem to be any particular harm in Buckbeak.Book: 7, Chapter: 15Passage: "So we still haven't got any food." "Shut up, Ron," snapped Hermione. "Harry, what happened? Why do you think you couldn't make your Patronus? You managed perfectly yesterday!" "I don't know." He sat low in one of Perkins's old armchairs, feeling more humiliated by the moment. He was afraid that something had gone wrong inside him. Yesterday seemed a long time ago: Today he might have been thirteen years old again, the only one who collapsed on the Hogwarts Express.
    What magical plant traps Harry, Ron, and Hermione in their first year?Book: 1, Chapter: 16Passage: Hermione had managed to free herself before the plant got a firm grip on her. Now she watched in horror as the two boys fought to pull the plant off them, but the more they strained against it, the tighter and faster the plant wound around them. "Stop moving!" Hermione ordered them. "I know what this is - it's Devil's Snare!" "Oh, I'm so glad we know what it's called, that's a great help," snarled Ron, leaning back, trying to stop the plant from curling around his neck.Book: 7, Chapter: 35Passage: He lay facedown, listening to the silence. He was perfectly alone. Nobody was watching. Nobody else was there. He was not perfectly sure that he was there himself. A long time later, or maybe no time at all, it came to him that he must exist, must be more than disembodied thought, because he was lying, definitely lying, on some surface. Therefore he had a sense of touch, and the thing against which he lay existed too. Almost as soon as he had reached this conclusion, Harry became conscious that he was naked. Convinced as he was of his total solitude, this did not concern him, but it did intrigue him slightly. He wondered whether, as he could feel, he would be able to see.
  • Loss: TripletLoss with these parameters:
    {
        "distance_metric": "TripletDistanceMetric.COSINE",
        "triplet_margin": 0.5
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 4
  • per_device_eval_batch_size: 4
  • num_train_epochs: 1
  • multi_dataset_batch_sampler: round_robin

All Hyperparameters

  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: steps
  • prediction_loss_only: True
  • per_device_train_batch_size: 4
  • per_device_eval_batch_size: 4
  • 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
  • num_train_epochs: 1
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.0
  • 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: False
  • 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: batch_sampler
  • multi_dataset_batch_sampler: round_robin

Training Logs

EpochSteptest-eval_cosine_accuracy
0.1282100.75
0.2564200.7643
0.3846300.8000
0.5128400.8071
0.6410500.8000
0.7692600.8000
0.8974700.8000
1.0780.8000
-1-10.8000

Framework Versions

  • Python: 3.12.2
  • Sentence Transformers: 3.4.1
  • Transformers: 4.50.0
  • PyTorch: 2.4.1
  • Accelerate: 1.4.0
  • Datasets: 2.19.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",
}

TripletLoss

@misc{hermans2017defense,
    title={In Defense of the Triplet Loss for Person Re-Identification},
    author={Alexander Hermans and Lucas Beyer and Bastian Leibe},
    year={2017},
    eprint={1703.07737},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей