/ Модель

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

Контекст
512 токенов
Параметры
40 млн
Архитектура
bert · dense
Базовая модель
snowflake-arctic-embed-s
Библиотека
sentence-transformers
Опубликована
11 июл 2024

timely-arctic-small

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

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

105скачиваний за 30 дней4лайкавеса обновлены8 авг 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Модель khoj-ai/timely-arctic-small — дообученная версия Snowflake/snowflake-arctic-embed-s на базе Sentence Transformers и архитектуры BERT. Она преобразует предложения и абзацы в нормализованные плотные векторы размерностью 384, рассчитанные на сравнение косинусного сходства; максимальная длина входа — 512 токенов. Модель подходит для семантического поиска, оценки сходства текстов, поиска перефразировок, кластеризации и классификации текстов.

Обучение описано на примерах пар запросов и релевантных фрагментов с функцией потерь MultipleNegativesRankingLoss. Базовая модель охарактеризована как англоязычная, поэтому пригодность для других языков карточка не подтверждает. Лицензия в предоставленных данных не указана.

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

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

Ограничения

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

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

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

Открыть на Hugging Face

Technical Report and Model Pipeline

To access our technical report and model pipeline scripts visit our github

SentenceTransformer based on Snowflake/snowflake-arctic-embed-s

This is a sentence-transformers model finetuned from Snowflake/snowflake-arctic-embed-s. 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: Snowflake/snowflake-arctic-embed-s
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 384 tokens
  • Similarity Function: Cosine Similarity

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': 384, '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("sentence_transformers_model_id")
# Run inference
sentences = [
    'Represent this sentence for searching relevant passages: Philadelphia Business Journal 01/30/83',
    'The Philadelphia Business Journal is a diversified business media company in Philadelphia, Pennsylvania, publishing daily stories on its website and social networks, and a weekly edition available in print and online. It is published by the American City Business Journals. See also List of newspapers in Pennsylvania References External links Business newspapers published in the United States Newspapers published in Philadelphia Jan 30 1983\n',
    "Have you just bought your brand new Nintendo Wii console? Are you gutted that you can't get Wii Connect 24 in your country of residence? This article will resolve this problem, so you can surf the Internet on your Wii!\n",
]
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]

Training Details

Training Dataset

Unnamed Dataset

  • Size: 55,736 training samples
  • Columns: anchors and positive
  • Approximate statistics based on the first 1000 samples:
    anchorspositive
    typestringstring
    detailsmin: 14 tokensmean: 20.25 tokensmax: 33 tokensmin: 15 tokensmean: 47.2 tokensmax: 75 tokens
  • Samples:
    anchorspositive
    Represent this sentence for searching relevant passages: are bugs attracted to citronella November 10?Citronella is naturally occurring oil that repels insects. ... “Citronella oil is repellent to mosquitoes to a degree, but the amount being put out by a candle isn't going to be very effective,” Eric Hoffer, president of Hoffer Pest, told TODAY Home. 11/10
    Represent this sentence for searching relevant passages: are bugs attracted to citronella 11/10/09?Citronella is naturally occurring oil that repels insects. ... “Citronella oil is repellent to mosquitoes to a degree, but the amount being put out by a candle isn't going to be very effective,” Eric Hoffer, president of Hoffer Pest, told TODAY Home. 11/10/09
    Represent this sentence for searching relevant passages: are bugs attracted to citronella Jan 15?Citronella is naturally occurring oil that repels insects. ... “Citronella oil is repellent to mosquitoes to a degree, but the amount being put out by a candle isn't going to be very effective,” Eric Hoffer, president of Hoffer Pest, told TODAY Home. 01/15
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Evaluation Dataset

Unnamed Dataset

  • Size: 1,000 evaluation samples
  • Columns: anchors and positive
  • Approximate statistics based on the first 1000 samples:
    anchorspositive
    typestringstring
    detailsmin: 11 tokensmean: 21.67 tokensmax: 39 tokensmin: 15 tokensmean: 67.0 tokensmax: 512 tokens
  • Samples:
    anchorspositive
    Represent this sentence for searching relevant passages: 4/23 Socialize With Someone Who Is Losing Interest in You04/23 It can hurt to realize that someone you care about is losing interest in you. If a friend has stopped calling you and no longer makes plans to hang out, your first instinct might be to contact them more frequently or to ignore them in return.
    Represent this sentence for searching relevant passages: Alathur taluk, Perambalur 04/19/29Alathur taluk is a taluk in Perambalur district in the Indian state of Tamil Nadu. It was created by former chief minister J.Jayalalithaa for issues of population increase. Kunnam taluk was bifurcated to form this new taluk. Villages There are 39 villages in Alathur taluk excluding the headquarters Alathur. References Perambalur district Taluks of Perambalur district 2029 Apr 19
    Represent this sentence for searching relevant passages: 01/04 how much weight does a baby gain in the first month?01/04 During their first month, most newborns gain weight at a rate of about 1 ounce (30 grams) per day. They generally grow in height about 1 to 1½ inches (2.54 to 3.81 centimeters) during the first month. Many newborns go through a period of rapid growth when they are 7 to 10 days old and again at 3 and 6 weeks.
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 128
  • per_device_eval_batch_size: 128
  • learning_rate: 2e-05
  • weight_decay: 0.01
  • num_train_epochs: 1
  • warmup_ratio: 0.1
  • warmup_steps: 400
  • bf16: True
  • torch_compile: True
  • torch_compile_backend: inductor
  • 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: 128
  • per_device_eval_batch_size: 128
  • 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.01
  • 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: 400
  • 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: 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: True
  • torch_compile_backend: inductor
  • 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
  • eval_use_gather_object: False
  • batch_sampler: no_duplicates
  • multi_dataset_batch_sampler: proportional

Training Logs

EpochStepTraining Lossloss
0.002312.3154-
0.0229102.3237-
0.0459202.4036-
0.0688302.3314-
0.0917402.3171-
0.1147502.2891-
0.002312.2343-
0.0229102.2256-
0.0459202.2924-
0.0688302.2354-
0.0917402.2281-
0.1147502.2018-
0.1376602.2377-
0.1606702.2001-
0.1835802.158-
0.2064902.1405-
0.22941002.0916-
0.25231102.0374-
0.27521202.0492-
0.29821301.9824-
0.32111401.9571-
0.34401501.8317-
0.36701601.7183-
0.38991701.5928-
0.41281801.5695-
0.43581901.4592-
0.45872001.26670.2031
0.48172101.3865-
0.50462201.2924-
0.52752301.3042-
0.55052401.4393-
0.57342501.3402-
0.59632601.1939-
0.61932701.1795-
0.64222801.1012-
0.66512901.0379-
0.68813000.9865-
0.71103100.9088-
0.73393200.9132-
0.75693300.8819-
0.77983400.8631-
0.80283501.4084-
0.82573601.325-
0.84863701.2373-
0.87163801.1881-
0.89453901.1656-
0.91744000.77670.0607
0.94044100.1511-
0.96334200.1439-
0.98624300.1216-

Framework Versions

  • Python: 3.10.12
  • Sentence Transformers: 3.0.1
  • Transformers: 4.43.3
  • PyTorch: 2.4.0+cu121
  • Accelerate: 0.33.0
  • Datasets: 2.20.0
  • 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",
}

MultipleNegativesRankingLoss

@misc{henderson2017efficient,
    title={Efficient Natural Language Response Suggestion for Smart Reply}, 
    author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
    year={2017},
    eprint={1705.00652},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей