/ Модель

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

Контекст
514 токенов
Параметры
152 млн
Архитектура
roberta · dense
Базовая модель
roberta-base
Библиотека
sentence-transformers
Опубликована
21 июн 2024

RoBERTa-base-unsupervised-TSDAE

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

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

100скачиваний за 30 дней0лайковвеса обновлены22 июн 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

bobox/RoBERTa-base-unsupervised-TSDAE — модель Sentence Transformer, дообученная разработчиком bobox на FacebookAI/roberta-base с помощью DenoisingAutoEncoderLoss. Она преобразует предложения и абзацы в плотные векторы размерности 768; в README приведена косинусная мера сходства. Модель рассчитана на семантический поиск и сравнение текстов, поиск перефразировок, кластеризацию и классификацию текста на основе эмбеддингов.

Архитектура включает RoBERTa и mean pooling. Максимальная длина последовательности — 512 токенов (метаданные указывают контекст 514 токенов). В README приведена оценка на sts-test: Spearman cosine 0,6912. Обучающие примеры и базовая модель указывают на английский язык. Для работы нужны Sentence Transformers или совместимая среда; репозиторий содержит веса PyTorch. Лицензия в предоставленных сведениях не указана.

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

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

Ограничения

README сообщает оценку Spearman cosine 0,6912 на sts-test; качество может различаться на других данных. Максимальная длина последовательности составляет 512 токенов, а поддержка русского языка не заявлена.

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

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

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

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

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

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

Открыть на Hugging Face

SentenceTransformer based on FacebookAI/roberta-base

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

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: RobertaModel 
  (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("bobox/RoBERTa-base-unsupervised-TSDAE")
# Run inference
sentences = [
    'beer wine both sugar alcohol excessive be a infections You also sweets, along with foods moldy cheese, if you prone.',
    "Since beer and wine both contain yeast and sugar (alcohol is sugar fermented by yeast), excessive drinking can definitely be a recipe for yeast infections. You should also go easy on sweets, along with foods like moldy cheese, mushrooms, and anything fermented if you're prone to yeast infections. 3.",
    'They began selling the plush animals to retailers rather than operating a store themselves. Today, Boyds is a publicly traded company that manufactures 18 million-20 million bears a year, all at a government-owned facility in China.',
]
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

Semantic Similarity

MetricValue
pearson_cosine0.6886
spearman_cosine0.6912
pearson_manhattan0.6728
spearman_manhattan0.6725
pearson_euclidean0.6694
spearman_euclidean0.6691
pearson_dot0.1898
spearman_dot0.1786
pearson_max0.6886
spearman_max0.6912

Training Details

Training Dataset

Unnamed Dataset

  • Size: 300,000 training samples
  • Columns: sentence_0 and sentence_1
  • Approximate statistics based on the first 1000 samples:
    sentence_0sentence_1
    typestringstring
    detailsmin: 3 tokensmean: 19.88 tokensmax: 54 tokensmin: 8 tokensmean: 46.45 tokensmax: 157 tokens
  • Samples:
    sentence_0sentence_1
    us have across domestic shorthair, a cat pedigreed one between two breeds Unlike domestic shorthairs which come in of looks, Shorthair kittens the distinctMost of us have either lived with or come across a domestic shorthair, a cat that closely resembles the pedigreed American Shorthair. The one difference between the two breeds: Unlike domestic shorthairs, which come in a variety of looks, the American Shorthair produces kittens with the same distinct appearance.
    much cost to get plugs normal with plugs, cost start $120 or if precious plugs are $150 to 200+ . 6 8 will price more requiredhow much does it cost to get your spark plugs changed? On a normal 4-cylinder engine with standard spark plugs, replacement cost can start around $120 up to $150+, or if precious metal spark plugs are required, $150 up to $200+. 6 cylinder and 8 Cylinder engines will increase in price, as more spark plugs are required.
    much my paycheck state income%, your income level not tax rate you is of just that a flat tax rate, those, it has thehow much taxes are taken out of my paycheck pa? Pennsylvania levies a flat state income tax rate of 3.07%. Therefore, your income level and filing status will not affect the income tax rate you pay at the state level. Pennsylvania is one of just eight states that has a flat income tax rate, and of those states, it has the lowest rate.
  • Loss: DenoisingAutoEncoderLoss

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 12
  • per_device_eval_batch_size: 12
  • 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: 12
  • per_device_eval_batch_size: 12
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_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}
  • 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
  • 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
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: round_robin

Training Logs

EpochStepTraining Losssts-test_spearman_cosine
0.025007.1409-
0.0410006.207-
0.051250-0.6399
0.0615005.8038-
0.0820005.4963-
0.125005.26090.6799
0.1230005.0997-
0.1435005.0004-
0.153750-0.7012
0.1640004.8694-
0.1845004.7805-
0.250004.67760.7074
0.2255004.5757-
0.2460004.4598-
0.256250-0.7185
0.2665004.3865-
0.2870004.2692-
0.375004.22240.7205
0.3280004.1347-
0.3485004.0536-
0.358750-0.7239
0.3690004.0242-
0.3895004.0193-
0.4100003.91660.7153
0.42105003.9004-
0.44110003.8372-
0.4511250-0.7141
0.46115003.8037-
0.48120003.7788-
0.5125003.71910.7078
0.52130003.7036-
0.54135003.6697-
0.5513750-0.7095
0.56140003.6629-
0.58145003.639-
0.6150003.60480.7060
0.62155003.6072-
0.64160003.574-
0.6516250-0.7056
0.66165003.5423-
0.68170003.5379-
0.7175003.52220.6969
0.72180003.5076-
0.74185003.5025-
0.7518750-0.6959
0.76190003.4943-
0.78195003.475-
0.8200003.48740.6946
0.82205003.4539-
0.84210003.4704-
0.8521250-0.6942
0.86215003.4689-
0.88220003.4617-
0.9225003.44710.6917
0.92230003.4541-
0.94235003.4394-
0.9523750-0.6915
0.96240003.4505-
0.98245003.4533-
1.0250003.45740.6912

Framework Versions

  • Python: 3.10.13
  • Sentence Transformers: 3.0.1
  • Transformers: 4.41.2
  • PyTorch: 2.1.2
  • Accelerate: 0.31.0
  • Datasets: 2.19.2
  • Tokenizers: 0.19.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",
}

DenoisingAutoEncoderLoss

@inproceedings{wang-2021-TSDAE,
    title = "TSDAE: Using Transformer-based Sequential Denoising Auto-Encoderfor Unsupervised Sentence Embedding Learning",
    author = "Wang, Kexin and Reimers, Nils and Gurevych, Iryna", 
    booktitle = "Findings of the Association for Computational Linguistics: EMNLP 2021",
    month = nov,
    year = "2021",
    address = "Punta Cana, Dominican Republic",
    publisher = "Association for Computational Linguistics",
    pages = "671--688",
    url = "https://arxiv.org/abs/2104.06979",
}

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
RobertaModel
Ревизия весов
177db6c

0 моделей