/ Модель

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

Контекст
512 токенов
Параметры
137 млн
Лицензия
Apache 2.0
Архитектура
bert · dense
Базовая модель
bert-base-uncased
Библиотека
sentence-transformers
Опубликована
20 ноя 2024

bert-base-uncased-gooaq

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

Англоязычная BERT-модель, преобразующая предложения и абзацы в эмбеддинги для семантического поиска и сравнения текстов.

123скачиваний за 30 дней0лайковвеса обновлены20 ноя 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

tomaarsen/bert-base-uncased-gooaq — англоязычная модель Sentence Transformers, дообученная на парах вопросов и ответов набора GooAQ на базе google-bert/bert-base-uncased. Она кодирует предложения и абзацы в плотные векторы размерности 768 для сравнения по косинусному сходству; архитектура состоит из BERT и mean pooling. Максимальная длина входа — 512 токенов. Модель подходит для семантического поиска, поиска похожих вопросов и ответов, выявления перефразировок, кластеризации и извлечения признаков для классификации текста. В карточке приведены результаты оценки на наборах Nano BEIR и задачах поиска информации.

Модель принимает текст и выдаёт эмбеддинги; она не предназначена для генерации ответов. Обучение на GooAQ и англоязычная специализация могут ограничивать качество на других языках и предметных областях. Лицензия — Apache-2.0.

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

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

Ограничения

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

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

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

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

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

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

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

Открыть на Hugging Face

bert-base-uncased adapter finetuned on GooAQ pairs

This is a sentence-transformers model finetuned from google-bert/bert-base-uncased 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.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: google-bert/bert-base-uncased
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 768 dimensions
  • Similarity Function: Cosine Similarity
  • Training Dataset:
  • Language: en
  • License: apache-2.0

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel 
  (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/bert-base-uncased-gooaq")
# Run inference
sentences = [
    'how can i download youtube videos with internet download manager?',
    "['Go to settings and then click on extensions (top left side in chrome).', 'Minimise your browser and open the location (folder) where IDM is installed. ... ', 'Find the file “IDMGCExt. ... ', 'Drag this file to your chrome browser and drop to install the IDM extension.']",
    "Coca-Cola might rot your teeth and load your body with sugar and calories, but it's actually an effective and safe first line of treatment for some stomach blockages, researchers say.",
]
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

  • Datasets: NanoClimateFEVER, NanoDBPedia, NanoFEVER, NanoFiQA2018, NanoHotpotQA, NanoMSMARCO, NanoNFCorpus, NanoNQ, NanoQuoraRetrieval, NanoSCIDOCS, NanoArguAna, NanoSciFact and NanoTouche2020
  • Evaluated with InformationRetrievalEvaluator
MetricNanoClimateFEVERNanoDBPediaNanoFEVERNanoFiQA2018NanoHotpotQANanoMSMARCONanoNFCorpusNanoNQNanoQuoraRetrievalNanoSCIDOCSNanoArguAnaNanoSciFactNanoTouche2020
cosine_accuracy@10.240.540.540.240.60.280.320.380.840.260.160.420.449
cosine_accuracy@30.420.80.820.40.680.480.480.540.940.460.580.580.898
cosine_accuracy@50.460.840.90.50.740.540.50.620.980.60.740.620.9184
cosine_accuracy@100.560.920.920.60.880.660.560.741.00.680.840.640.9796
cosine_precision@10.240.540.540.240.60.280.320.380.840.260.160.420.449
cosine_precision@30.160.48670.27330.160.28670.160.30670.180.38670.20670.19330.20670.4966
cosine_precision@50.1080.4440.1840.140.1920.1080.2440.1280.2480.1840.1480.140.4571
cosine_precision@100.070.390.0960.0880.1180.0660.1840.0760.130.1260.0840.0760.3898
cosine_recall@10.13170.04680.530.11470.30.280.02090.380.75730.0540.160.40.0348
cosine_recall@30.20830.11120.77670.22870.430.480.05340.510.9120.12870.580.560.1111
cosine_recall@50.24170.15830.85670.31660.480.540.06390.60.9460.18970.740.6050.1656
cosine_recall@100.29670.25550.88670.39860.590.660.08050.710.97930.25870.840.640.2685
cosine_ndcg@100.25520.46440.73490.29260.52920.4680.23070.53870.91580.24180.50450.5380.4323
cosine_mrr@100.33790.67970.69620.33850.66390.40790.39790.49050.9010.38040.39630.50570.6533
cosine_map@1000.20760.32530.67880.23720.45230.42760.09660.48960.88940.18650.40070.5080.3349

Nano BEIR

MetricValue
cosine_accuracy@10.4053
cosine_accuracy@30.6214
cosine_accuracy@50.6891
cosine_accuracy@100.7677
cosine_precision@10.4053
cosine_precision@30.2695
cosine_precision@50.2096
cosine_precision@100.1457
cosine_recall@10.2469
cosine_recall@30.3915
cosine_recall@50.4541
cosine_recall@100.528
cosine_ndcg@100.4728
cosine_mrr@100.5269
cosine_map@1000.4027

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: 11.86 tokensmax: 21 tokensmin: 14 tokensmean: 60.48 tokensmax: 138 tokens
  • Samples:
    questionanswer
    what is the difference between broilers and layers?An egg laying poultry is called egger or layer whereas broilers are reared for obtaining meat. So a layer should be able to produce more number of large sized eggs, without growing too much. On the other hand, a broiler should yield more meat and hence should be able to grow well.
    what is the difference between chronological order and spatial order?As a writer, you should always remember that unlike chronological order and the other organizational methods for data, spatial order does not take into account the time. Spatial order is primarily focused on the location. All it does is take into account the location of objects and not the time.
    is kamagra same as viagra?Kamagra is thought to contain the same active ingredient as Viagra, sildenafil citrate. In theory, it should work in much the same way as Viagra, taking about 45 minutes to take effect, and lasting for around 4-6 hours. However, this will vary from person to person.
  • Loss: MatryoshkaLoss with these parameters:
    {
        "loss": "CachedMultipleNegativesRankingLoss",
        "matryoshka_dims": [
            768,
            512,
            256,
            128,
            64,
            32
        ],
        "matryoshka_weights": [
            1,
            1,
            1,
            1,
            1,
            1
        ],
        "n_dims_per_step": -1
    }
    

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: 11.88 tokensmax: 22 tokensmin: 14 tokensmean: 61.03 tokensmax: 127 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: MatryoshkaLoss with these parameters:
    {
        "loss": "CachedMultipleNegativesRankingLoss",
        "matryoshka_dims": [
            768,
            512,
            256,
            128,
            64,
            32
        ],
        "matryoshka_weights": [
            1,
            1,
            1,
            1,
            1,
            1
        ],
        "n_dims_per_step": -1
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 1024
  • per_device_eval_batch_size: 1024
  • learning_rate: 2e-05
  • num_train_epochs: 1
  • warmup_ratio: 0.1
  • seed: 12
  • 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: 1024
  • per_device_eval_batch_size: 1024
  • 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: 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: 1
  • 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: 12
  • 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: False
  • 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 LossNanoClimateFEVER_cosine_ndcg@10NanoDBPedia_cosine_ndcg@10NanoFEVER_cosine_ndcg@10NanoFiQA2018_cosine_ndcg@10NanoHotpotQA_cosine_ndcg@10NanoMSMARCO_cosine_ndcg@10NanoNFCorpus_cosine_ndcg@10NanoNQ_cosine_ndcg@10NanoQuoraRetrieval_cosine_ndcg@10NanoSCIDOCS_cosine_ndcg@10NanoArguAna_cosine_ndcg@10NanoSciFact_cosine_ndcg@10NanoTouche2020_cosine_ndcg@10NanoBEIR_mean_cosine_ndcg@10
00--0.10460.21820.15730.05750.25970.16020.05210.04930.73100.13200.23090.12400.09700.1826
0.0010128.4268---------------
0.02562524.7252---------------
0.05125013.3628---------------
0.0768757.843---------------
0.10241005.7393---------------
0.12791254.65762.33680.28900.46100.74080.28820.54460.40910.21790.46640.90790.23940.54330.50030.43180.4646
0.15351504.0846---------------
0.17911753.7129---------------
0.20472003.4899---------------
0.23032253.3263---------------
0.25592503.20131.65450.26220.47440.74560.29340.53710.43260.22900.51570.91300.25770.51890.51550.43020.4712
0.28152752.9109---------------
0.30713002.9064---------------
0.33273252.8215---------------
0.35823502.7893---------------
0.38383752.66631.41460.26290.46570.73300.28530.52990.43460.23110.52160.91720.25130.51330.54290.42870.4706
0.40944002.6672---------------
0.43504252.5587---------------
0.46064502.5001---------------
0.48624752.4476---------------
0.51185002.41271.28430.25650.46680.72890.28380.53920.45990.22840.52380.90210.24160.49710.53490.43200.4688
0.53745252.414---------------
0.56295502.3723---------------
0.58855752.3418---------------
0.61416002.2862---------------
0.63976252.2071.20780.26130.45420.73820.28170.52300.46640.22820.52660.90950.24530.51270.54140.42390.4702
0.66536502.2305---------------
0.69096752.2409---------------
0.71657002.2001---------------
0.74217252.1923---------------
0.76777502.1951.15380.25490.46710.73330.28040.52650.46590.23210.53310.90860.24290.50700.54300.43690.4717
0.79327752.1826---------------
0.81888002.1754---------------
0.84448252.1141---------------
0.87008502.1572---------------
0.89568752.11261.12560.25050.46220.72930.28570.52860.48230.23080.53970.91580.24120.50500.53650.43870.4728
0.92129002.0755---------------
0.94689252.1032---------------
0.97249502.1211---------------
0.99809752.0826---------------
1.0977--0.25520.46440.73490.29260.52920.46800.23070.53870.91580.24180.50450.53800.43230.4728

Environmental Impact

Carbon emissions were measured using CodeCarbon.

  • Energy Consumed: 0.624 kWh
  • Carbon Emitted: 0.243 kg of CO2
  • Hours Used: 1.619 hours

Training Hardware

  • On Cloud: No
  • GPU Model: 1 x NVIDIA GeForce RTX 3090
  • CPU Model: 13th Gen Intel(R) Core(TM) i7-13700K
  • RAM Size: 31.78 GB

Framework Versions

  • Python: 3.11.6
  • Sentence Transformers: 3.4.0.dev0
  • Transformers: 4.46.2
  • PyTorch: 2.5.0+cu121
  • Accelerate: 0.35.0.dev0
  • Datasets: 2.20.0
  • Tokenizers: 0.20.3

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

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…

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

0 моделей