/ Модель

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

Контекст
512 токенов
Параметры
137 млн
Архитектура
bert · dense
Базовая модель
bge-base-en-v1.5
Библиотека
sentence-transformers
Опубликована
29 мар 2025

BAAI_bge-base-en-v1.5_retrieval_finetuned_2025-03-29_23-29-50

ЭмбеддингиТекст → embedding

Англоязычная дообученная модель BGE на базе BERT для преобразования текстов в эмбеддинги и семантического поиска.

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

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

CatkinChen дообучил BAAI/bge-base-en-v1.5 для получения эмбеддингов предложений и абзацев. Модель построена на BERT и Sentence Transformers, преобразует текст в плотные векторы размерностью 768 и использует косинусное сходство; максимальная длина входа — 512 токенов.

Модель подходит для семантического поиска, сравнения текстов, поиска перефразировок, классификации и кластеризации. В описанной оценке на тестовом наборе достигнута точность cosine_accuracy 0,8571; обучение указано на 309 примерах с TripletLoss. Она ориентирована на английский язык. Лицензия в предоставленных данных не приведена.

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

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

Ограничения

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

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

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

Открыть на Hugging Face

SentenceTransformer based on BAAI/bge-base-en-v1.5

This is a sentence-transformers model finetuned from BAAI/bge-base-en-v1.5. 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: BAAI/bge-base-en-v1.5
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 768 dimensions
  • Similarity Function: Cosine Similarity

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': True}) with Transformer model: BertModel 
  (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, '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/BAAI_bge-base-en-v1.5_retrieval_finetuned_2025-03-29_23-29-50")
# Run inference
sentences = [
    'Who is the leader of the Order of the Phoenix?',
    "Book: 7, Chapter: 2\nPassage: The only things left out of place were today's Daily Prophet, still lying on the bed, and on top of it, the piece of broken mirror. Harry moved across the room, slid the mirror fragment off today's Prophet, and unfolded the newspaper. He had merely glanced at the headline when he had taken the rolled-up paper from the delivery owl early that morning and thrown it aside, after noting that it said nothing about Voldemort. Harry was sure that the Ministry was leaning on the Prophet to suppress news about Voldemort. It was only now, therefore, that he saw what he had missed. Across the bottom half of the front page a smaller headline was set over a picture of Dumbledore striding along looking harried:\nDUMBLEDORE - THE TRUTH AT LAST? Coming next week, the shocking story of the flawed genius considered by many to be the greatest wizard of his generation. Stripping away the popular image of serene, silver-bearded wisdom, Rita Skeeter reveals the disturbed childhood, the lawless youth, the lifelong feuds, and the guilty secrets that Dumbledore carried to his grave. WHY was the man tipped to be Minister of Magic content to remain a mere headmaster? WHAT was the real purpose of the secret organization known as the Order of the Phoenix? HOW did Dumbledore really meet his end? The answers to these and many more questions are explored in the explosive new biography, The Life and Lies of Albus Dumbledore, by Rita Skeeter, exclusively interviewed by Betty Braithwaite, page 13, inside.",
    'Book: 6, Chapter: 8\nPassage: "Really?" said Harry, taking care not to catch Ron\'s eye; the last time he had met Hagrid\'s half-brother, a vicious giant with a talent for ripping up trees by the roots, his vocabulary had comprised five words, two of which he was unable to pronounce properly. "Oh yeah, he\'s really come on," said Hagrid proudly. "Yeh\'ll be amazed. I\'m thinkin\' o\' trainin\' him up as me assistant." Ron snorted loudly, but managed to pass it off as a violent sneeze.',
]
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

Triplet

MetricValue
cosine_accuracy0.8571

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: 212.92 tokensmax: 512 tokensmin: 35 tokensmean: 180.01 tokensmax: 473 tokens
  • Samples:
    sentence_0sentence_1sentence_2
    How does receiving the Hogwarts acceptance letter change Harry's life and reveal his true heritage?Book: 1, Chapter: 8Passage: "Another Weasley, eh?" said Hagrid, glancing at Ron's freckles. "I spent half me life chasin' yer twin brothers away from the forest." The rock cakes were shapeless lumps with raisins that almost broke their teeth, but Harry and Ron pretended to be enjoying them as they told Hagrid all about their first lessons. Fang rested his head on Harry's knee and drooled all over his robes. Harry and Ron were delighted to hear Hagrid call Filch "that old git''"An' as fer that cat, Mrs. Norris, I'd like ter introduce her to Fang sometime. D'yeh know, every time I go up ter the school, she follows me everywhere? Can't get rid of her - Filch puts her up to it."Book: 1, Chapter: 17Passage: "But Snape always seemed to hate me so much." "Oh, he does," said Quirrell casually, "heavens, yes. He was at Hogwarts with your father, didn't you know? They loathed each other. But he never wanted you dead." "But I heard you a few days ago, sobbing - I thought Snape was threatening you. For the first time, a spasm of fear flitted across Quirrell's face.
    Who is the supposed criminal believed to be after Harry?Book: 3, Chapter: 5Passage: "He looks like one good hex would finish him off, doesn't he? Anyway ..." He turned to Harry. "What were you going to tell us?" Harry explained all about Mr. and Mrs. Weasley's argument and the warning Mr. Weasley had just given him. When he'd finished, Ron looked thunderstruck, and Hermione had her hands over her mouth. She finally lowered them to say, "Sirius Black escaped to come after you? Oh, Harry ... you'll have to be really, really careful. Don't go looking for trouble, Harry -""I don't go looking for trouble," said Harry, nettled. "Trouble usually finds me." "How thick would Harry have to be, to go looking for a nutter who wants to kill him?"Book: 2, Chapter: 6Passage: He was about to follow Ron and Hermione inside when Lockhart's hand shot out. "Harry! I've been wanting a word - you don't mind if he's a couple of minutes late, do you, Professor Sprout?" Judging by Professor Sprout's scowl, she did mind, but Lockhart said, "That's the ticket," and closed the greenhouse door in her face. "Harry," said Lockhart, his large white teeth gleaming in the sunlight as he shook his head.
    What is the name of the potion that allows the drinker to assume the form of someone else?Book: 2, Chapter: 9Passage: "What we'd need to do is to get inside the Slytherin common room and ask Malfoy a few questions without him realizing it's us." "But that's impossible," Harry said as Ron laughed. "No, it's not," said Hermione. "All we'd need would be some Polyjuice Potion." "What's that?" said Ron and Harry together. "Snape mentioned it in class a few weeks ago -""D'you think we've got nothing better to do in Potions than listen to Snape?" muttered Ron.Book: 5, Chapter: 4Passage: And she hurried off downstairs again. Harry crossed the dingy landing, turned the bedroom doorknob, which was shaped like a serpent's head, and opened the door. He caught a brief glimpse of a gloomy high-ceilinged, twin-bedded room, then there was a loud twittering noise, followed by an even louder shriek, and his vision was completely obscured by a large quantity of very bushy hair - Hermione had thrown herself onto him in a hug that nearly knocked him flat, while Ron's tiny owl, Pigwidgeon, zoomed excitedly round and round their heads. "HARRY! Ron, he's here, Harry's here! We didn't hear you arrive! Oh, how are you? Are you all right? Have you been furious with us? I bet you have, I know our letters were useless - but we couldn't tell you anything, Dumbledore made us swear we wouldn't, oh, we've got so much to tell you, and you've got to tell us - the dementors! When we heard - and that Ministry hearing - it's just outrageous, I've looked it all up, they ...
  • 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.8143
0.2564200.8286
0.3846300.8357
0.5128400.8500
0.6410500.8429
0.7692600.8500
0.8974700.8571
1.0780.8571
-1-10.8571

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
Ревизия весов
6d0cd0b

0 моделей