/ Модель

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

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

tiny_bert_ft_sim_score

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

Компактная англоязычная Sentence Transformers модель кодирует тексты в 128-мерные векторы для оценки семантического сходства и поиска.

77скачиваний за 30 дней0лайковвеса обновлены26 дек 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Tien09/tiny_bert_ft_sim_score — дообученная модель Sentence Transformers на базе prajjwal1/bert-tiny, созданная для сравнения сходства английских предложений и текстовых фрагментов. Она кодирует каждый текст в плотный вектор размерности 128; сходство векторов оценивается косинусной мерой. Модель обучена на наборе pair_similarity из 8 959 примеров и принимает последовательности длиной до 512 токенов.

Модель подходит для семантического поиска, поиска перефразировок, кластеризации текстов, сравнения пар предложений и классификации на основе эмбеддингов. Архитектура объединяет BertModel и mean pooling. Репозиторий использует формат safetensors, библиотеку sentence-transformers и лицензию Apache-2.0. README содержит несоответствие в заголовке, где упомянут MPNet и AllNLI, тогда как основное описание и метаданные указывают на дообучение bert-tiny на pair_similarity.

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

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

Ограничения

Модель предназначена для английского языка и ограничивает входные последовательности 512 токенами. Заголовок README противоречит остальной карточке: он упоминает MPNet и AllNLI, хотя описание и метаданные указывают bert-tiny и pair_similarity.

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

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

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

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

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

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

Открыть на Hugging Face

MPNet base trained on AllNLI triplets

This is a sentence-transformers model finetuned from prajjwal1/bert-tiny on the pair_similarity dataset. It maps sentences & paragraphs to a 128-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: prajjwal1/bert-tiny
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 128 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': 128, '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("Tien09/tiny_bert_ft_sim_score")
# Run inference
sentences = [
    'If you control 3 or more face-up "Six Samurai" monsters, you can activate 1 of these effects: Destroy all face-up monsters your opponent controls. Destroy all face-up Spell/Trap Cards your opponent controls. Destroy all Set Spell/Trap Cards your opponent controls.',
    'Target 1 Link Monster you control and 1 monster your opponent controls; destroy them, then draw 1 card. You can only activate 1 "Link Burst" per turn.',
    'While you have 2 or less cards in your hand, all face-up "Fabled" monsters you control gain 400 ATK.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 128]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

Training Details

Training Dataset

pair_similarity

  • Dataset: pair_similarity at a933de4
  • Size: 8,959 training samples
  • Columns: effect_text, score, and effect_text2
  • Approximate statistics based on the first 1000 samples:
    effect_textscoreeffect_text2
    typestringfloatstring
    detailsmin: 6 tokensmean: 72.39 tokensmax: 191 tokensmin: 0.0mean: 0.09max: 1.0min: 8 tokensmean: 72.1 tokensmax: 198 tokens
  • Samples:
    effect_textscoreeffect_text2
    Once per turn, if you Special Summon a DARK Synchro Monster(s) from the Extra Deck: You can target 1 of your "Blackwing" monsters, or "Black-Winged Dragon", with lower ATK that is banished or in your GY; Special Summon it. Once per turn, if a DARK monster(s) you control would be destroyed by battle or card effect, you can remove 1 Black Feather Counter from your field instead.0.0A Millennium item, it's rumored to block any strong attack.
    Target 1 face-up monster your opponent controls; the ATK of all other monsters currently on the field become equal to that monster's ATK, until the end of this turn.0.0While you control a "Blue-Eyes" monster, you choose the attack targets for your opponent's attacks. You can only use each of the following effects of "Dictator of D." once per turn. You can send 1 "Blue-Eyes White Dragon" from your hand or Deck to the GY; Special Summon this card from your hand. You can discard 1 "Blue-Eyes White Dragon", or 1 card that mentions it, then target 1 "Blue-Eyes" monster in your GY; Special Summon it.
    1 Tuner + 1+ non-Tuner monsters
    If this card is Synchro Summoned using a Tuner Synchro Monster: You can target 1 Spell/Trap in your GY; add it to your hand. When your opponent activates a card or effect (Quick Effect): You can send 1 Spell/Trap from your hand or field to the GY; Special Summon 1 Level 7 or lower Tuner Synchro Monster from your Extra Deck, GY, or banishment. You can only use each effect of "Diabell, Queen of the White Forest" once per turn.0.21 Aqua monster + 1 Level 10 WATER monsterMust first be either Fusion Summoned, or Special Summoned (from your Extra Deck) by Tributing 1 Level 10 Aqua monster with 0 ATK. This card can be treated as 3 Tributes for the Tribute Summon of a monster. Cannot be destroyed by battle. Your opponent cannot target monsters you control with card effects, except "Egyptian God Slime", also their monsters cannot target monsters for attacks, except "Egyptian God Slime".
  • Loss: CoSENTLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "pairwise_cos_sim"
    }
    

Evaluation Dataset

pair_similarity

  • Dataset: pair_similarity at a933de4
  • Size: 1,920 evaluation samples
  • Columns: effect_text, score, and effect_text2
  • Approximate statistics based on the first 1000 samples:
    effect_textscoreeffect_text2
    typestringfloatstring
    detailsmin: 10 tokensmean: 72.56 tokensmax: 202 tokensmin: 0.0mean: 0.09max: 1.0min: 5 tokensmean: 71.33 tokensmax: 186 tokens
  • Samples:
    effect_textscoreeffect_text2
    A proud ruler of the jungle that some fear and others respect.0.0Cannot attack the turn it is Normal Summoned. Once per turn: You can target 1 face-up monster on the field; change this card to Defense Position, and if you do, that target loses 800 ATK until the end of this turn.
    During your opponent's Main Phase or Battle Phase: You can Special Summon 1 non-Tuner monster from your hand, but it has its effects negated (if any), and if you do, immediately after this effect resolves, Synchro Summon 1 Machine-Type Synchro Monster using only that monster and this card (this is a Quick Effect). You can only use this effect of "Crystron Quan" once per turn.0.0You can Tribute this card while "Neo Space" is on the field to Special Summon 1 "Neo-Spacian Dark Panther" from your hand or Deck.
    When your opponent Special Summons a monster(s): Destroy it, then you can banish 5 Zombie monsters from your GY, and if you do, Special Summon 1 Level 7 or higher Zombie monster from your hand or Deck.0.25You can target 1 Dragon monster you control; it gains ATK/DEF equal to the total Link Rating of the Link Monsters currently on the field x 100, until the end of the opponent's turn. You can only use this effect of "Guardragon Shield" once per turn. Once per turn, if exactly 1 Dragon monster you control would be destroyed by battle or card effect, you can send 1 Normal Monster from your hand or Deck to the GY instead.
  • Loss: CoSENTLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "pairwise_cos_sim"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • num_train_epochs: 5
  • warmup_ratio: 0.1
  • fp16: 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: 16
  • per_device_eval_batch_size: 16
  • 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.0
  • num_train_epochs: 5
  • 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: 42
  • data_seed: None
  • jit_mode_eval: False
  • use_ipex: False
  • bf16: False
  • fp16: True
  • 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 Loss
0.17861003.89173.7898
0.35712003.72893.7576
0.53573003.67193.7211
0.71434003.62943.6751
0.89295003.51883.6291
1.07146003.67943.5768
1.257003.49623.5798
1.42868003.43253.6149
1.60719003.39563.6151
1.785710003.29073.7533
1.964311003.36853.5106
2.142912003.5023.4844
2.321413003.37963.6363
2.514003.23833.5744
2.678615003.13463.6568
2.857116003.18083.6278
3.035717003.32413.4786
3.214318003.28643.4705
3.392919003.20563.5290
3.571420003.15193.6228
3.7521003.08893.5919
3.928622002.93853.6148
4.107123003.20513.5180
4.285724003.25813.5216
4.464325003.07653.5968
4.642926002.94973.6496
4.821427002.85023.6804
5.028003.19193.6668

Framework Versions

  • Python: 3.10.12
  • Sentence Transformers: 3.3.1
  • Transformers: 4.47.1
  • PyTorch: 2.5.1+cu121
  • Accelerate: 1.2.1
  • 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",
}

CoSENTLoss

@online{kexuefm-8847,
    title={CoSENT: A more efficient sentence vector scheme than Sentence-BERT},
    author={Su Jianlin},
    year={2022},
    month={Jan},
    url={https://kexue.fm/archives/8847},
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей