/ Модель

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

Контекст
512 токенов
Параметры
149 млн
Архитектура
modernbert · dense
Базовая модель
ModernBERT-base
Библиотека
sentence-transformers
Опубликована
19 дек 2024

ModernBERT-base-gooaq

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

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

107скачиваний за 30 дней14лайковвеса обновлены19 дек 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

tomaarsen/ModernBERT-base-gooaq — англоязычная модель Sentence Transformers, дообученная разработчиком tomaarsen на базе answerdotai/ModernBERT-base на датасете GooAQ. Она преобразует предложения и абзацы в плотные векторы размерности 768, пригодные для сравнения по косинусному сходству. Архитектура состоит из encoder-модели ModernBERT с усреднением токенных представлений; размер — 149 млн параметров, максимальная длина входа — 512 токенов.

Модель предназначена для семантического поиска и сравнения текстов, поиска ответов на вопросы, выявления перефразировок, кластеризации и классификации текста на основе эмбеддингов. В README приведены результаты оценивания на NanoNQ, NanoMSMARCO и NanoBEIR, однако они не гарантируют качество на других данных. Модель обучалась на англоязычных парах вопросов и ответов GooAQ и рассчитана прежде всего на английский язык. Лицензия в предоставленных данных не указана.

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

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

Ограничения

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

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

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

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

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

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

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

Открыть на Hugging Face

SentenceTransformer based on answerdotai/ModernBERT-base

This is a sentence-transformers model finetuned from answerdotai/ModernBERT-base on the gooaq 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.

This model has been finetuned using train_st_gooaq.py using an RTX 3090, although only 10GB of VRAM was used.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: answerdotai/ModernBERT-base
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 768 dimensions
  • Similarity Function: Cosine Similarity
  • Training Dataset:
  • Language: en

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: ModernBertModel 
  (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})
)

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("tomaarsen/ModernBERT-base-gooaq")
# Run inference
sentences = [
    'are you human korean novela?',
    "Are You Human? (Korean: 너도 인간이니; RR: Neodo Inganini; lit. Are You Human Too?) is a 2018 South Korean television series starring Seo Kang-jun and Gong Seung-yeon. It aired on KBS2's Mondays and Tuesdays at 22:00 (KST) time slot, from June 4 to August 7, 2018.",
    'A relative of European pear varieties like Bartlett and Anjou, the Asian pear is great used in recipes or simply eaten out of hand. It retains a crispness that works well in slaws and salads, and it holds its shape better than European pears when baked and cooked.',
]
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

Information Retrieval

MetricNanoNQNanoMSMARCO
cosine_accuracy@10.380.32
cosine_accuracy@30.640.56
cosine_accuracy@50.70.66
cosine_accuracy@100.80.82
cosine_precision@10.380.32
cosine_precision@30.220.1867
cosine_precision@50.1440.132
cosine_precision@100.0820.082
cosine_recall@10.360.32
cosine_recall@30.620.56
cosine_recall@50.670.66
cosine_recall@100.740.82
cosine_ndcg@100.56740.5554
cosine_mrr@100.52370.4725
cosine_map@1000.51170.4798

Nano BEIR

MetricValue
cosine_accuracy@10.35
cosine_accuracy@30.6
cosine_accuracy@50.68
cosine_accuracy@100.81
cosine_precision@10.35
cosine_precision@30.2033
cosine_precision@50.138
cosine_precision@100.082
cosine_recall@10.34
cosine_recall@30.59
cosine_recall@50.665
cosine_recall@100.78
cosine_ndcg@100.5614
cosine_mrr@100.4981
cosine_map@1000.4957

Training Details

Training Dataset

gooaq

  • Dataset: gooaq at b089f72
  • Size: 3,012,496 training samples
  • Columns: question and answer
  • Approximate statistics based on the first 1000 samples:
    questionanswer
    typestringstring
    detailsmin: 8 tokensmean: 12.0 tokensmax: 21 tokensmin: 15 tokensmean: 58.17 tokensmax: 190 tokens
  • Samples:
    questionanswer
    what is the difference between clay and mud mask?The main difference between the two is that mud is a skin-healing agent, while clay is a cosmetic, drying agent. Clay masks are most useful for someone who has oily skin and is prone to breakouts of acne and blemishes.
    myki how much on card?A full fare myki card costs $6 and a concession, seniors or child myki costs $3. For more information about how to use your myki, visit ptv.vic.gov.au or call 1800 800 007.
    how to find out if someone blocked your phone number on iphone?If you get a notification like "Message Not Delivered" or you get no notification at all, that's a sign of a potential block. Next, you could try calling the person. If the call goes right to voicemail or rings once (or a half ring) then goes to voicemail, that's further evidence you may have been blocked.
  • Loss: CachedMultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Evaluation Dataset

gooaq

  • Dataset: gooaq at b089f72
  • Size: 3,012,496 evaluation samples
  • Columns: question and answer
  • Approximate statistics based on the first 1000 samples:
    questionanswer
    typestringstring
    detailsmin: 8 tokensmean: 12.05 tokensmax: 21 tokensmin: 13 tokensmean: 59.08 tokensmax: 116 tokens
  • Samples:
    questionanswer
    how do i program my directv remote with my tv?['Press MENU on your remote.', 'Select Settings & Help > Settings > Remote Control > Program Remote.', 'Choose the device (TV, audio, DVD) you wish to program. ... ', 'Follow the on-screen prompts to complete programming.']
    are rodrigues fruit bats nocturnal?Before its numbers were threatened by habitat destruction, storms, and hunting, some of those groups could number 500 or more members. Sunrise, sunset. Rodrigues fruit bats are most active at dawn, at dusk, and at night.
    why does your heart rate increase during exercise bbc bitesize?During exercise there is an increase in physical activity and muscle cells respire more than they do when the body is at rest. The heart rate increases during exercise. The rate and depth of breathing increases - this makes sure that more oxygen is absorbed into the blood, and more carbon dioxide is removed from it.
  • Loss: CachedMultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 2048
  • per_device_eval_batch_size: 2048
  • learning_rate: 8e-05
  • num_train_epochs: 1
  • warmup_ratio: 0.05
  • bf16: 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: 2048
  • per_device_eval_batch_size: 2048
  • 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: 8e-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: 1
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.05
  • 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: 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}
  • 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 LossNanoNQ_cosine_ndcg@10NanoMSMARCO_cosine_ndcg@10NanoBEIR_mean_cosine_ndcg@10
00--0.03880.07850.0587
0.0068106.9066----
0.0136204.853----
0.0204302.5305----
0.0272401.3877----
0.0340500.8710.33580.43850.48970.4641
0.0408600.6463----
0.0476700.5336----
0.0544800.4601----
0.0612900.4057----
0.06801000.3660.15230.51000.44770.4789
0.07481100.3498----
0.08161200.3297----
0.08841300.3038----
0.09521400.3062----
0.10201500.29760.11760.55500.47420.5146
0.10881600.2843----
0.11561700.2732----
0.12241800.2549----
0.12921900.2584----
0.13602000.24510.10180.53130.48460.5079
0.14282100.2521----
0.14962200.2451----
0.15642300.2367----
0.16322400.2359----
0.17002500.23430.09470.54890.48230.5156
0.17682600.2263----
0.18352700.2225----
0.19032800.2219----
0.19712900.2136----
0.20393000.22020.09320.51650.46740.4920
0.21073100.2198----
0.21753200.21----
0.22433300.207----
0.23113400.1972----
0.23793500.20370.08770.52310.50390.5135
0.24473600.2054----
0.25153700.197----
0.25833800.1922----
0.26513900.1965----
0.27194000.19620.08430.54090.47460.5078
0.27874100.186----
0.28554200.1911----
0.29234300.1969----
0.29914400.193----
0.30594500.19120.07630.53980.50830.5241
0.31274600.1819----
0.31954700.1873----
0.32634800.1899----
0.33314900.1764----
0.33995000.18280.07280.54390.51760.5308
0.34675100.1753----
0.35355200.1725----
0.36035300.1758----
0.36715400.183----
0.37395500.17890.07330.54370.51850.5311
0.38075600.1773----
0.38755700.1764----
0.39435800.1638----
0.40115900.1809----
0.40796000.17270.07000.55500.50210.5286
0.41476100.1664----
0.42156200.1683----
0.42836300.1622----
0.43516400.1592----
0.44196500.1680.06620.55760.48430.5210
0.44876600.1696----
0.45556700.1609----
0.46236800.1644----
0.46916900.1643----
0.47597000.16040.06600.56050.50420.5323
0.48277100.1634----
0.48957200.1515----
0.49637300.1592----
0.50317400.1597----
0.50997500.16170.06430.55760.48300.5203
0.51677600.1512----
0.52357700.1563----
0.53037800.1529----
0.53707900.1547----
0.54388000.15480.06200.55380.52710.5405
0.55068100.1533----
0.55748200.1504----
0.56428300.1489----
0.57108400.1534----
0.57788500.15070.06110.56970.50950.5396
0.58468600.1475----
0.59148700.1474----
0.59828800.1499----
0.60508900.1454----
0.61189000.14190.06200.55860.52290.5407
0.61869100.1465----
0.62549200.1436----
0.63229300.1464----
0.63909400.1418----
0.64589500.14430.05650.56270.54580.5543
0.65269600.1458----
0.65949700.1431----
0.66629800.1417----
0.67309900.1402----
0.679810000.14310.05630.54990.53660.5432
0.686610100.1386----
0.693410200.1413----
0.700210300.1381----
0.707010400.1364----
0.713810500.13460.05450.55740.54160.5495
0.720610600.1338----
0.727410700.1378----
0.734210800.135----
0.741010900.1336----
0.747811000.13930.05410.57760.53620.5569
0.754611100.1427----
0.761411200.1378----
0.768211300.1346----
0.775011400.1423----
0.781811500.13680.05250.56810.52370.5459
0.788611600.1392----
0.795411700.1321----
0.802211800.1387----
0.809011900.134----
0.815812000.13690.05150.56130.54160.5514
0.822612100.1358----
0.829412200.1401----
0.836212300.1334----
0.843012400.1331----
0.849812500.13240.05100.54630.55460.5505
0.856612600.135----
0.863412700.1367----
0.870212800.1356----
0.877012900.1291----
0.883813000.13130.04980.57870.55520.5670
0.890613100.1334----
0.897313200.1389----
0.904113300.1302----
0.910913400.1319----
0.917713500.12760.05040.57570.55750.5666
0.924513600.1355----
0.931313700.1289----
0.938113800.1335----
0.944913900.1298----
0.951714000.12790.04970.57430.55670.5655
0.958514100.1324----
0.965314200.1306----
0.972114300.1313----
0.978914400.135----
0.985714500.12930.04930.56710.55540.5612
0.992514600.133----
0.999314700.1213----
1.01471--0.56740.55540.5614

Framework Versions

  • Python: 3.11.10
  • Sentence Transformers: 3.3.1
  • Transformers: 4.48.0.dev0
  • PyTorch: 2.6.0.dev20241112+cu121
  • Accelerate: 1.2.0
  • Datasets: 3.2.0
  • 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",
}

CachedMultipleNegativesRankingLoss

@misc{gao2021scaling,
    title={Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup},
    author={Luyu Gao and Yunyi Zhang and Jiawei Han and Jamie Callan},
    year={2021},
    eprint={2101.06983},
    archivePrefix={arXiv},
    primaryClass={cs.LG}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей