/ Модель

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

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

sentencetransformer_ftmodel_on_chemical_dataset

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

Дообученная на химическом наборе данных англоязычная MPNet-модель создаёт векторы предложений и абзацев для семантического поиска и сравнения текстов.

146скачиваний за 30 дней0лайковвеса обновлены11 окт 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Это модель Sentence Transformer на архитектуре MPNet, разработанная на основе microsoft/mpnet-base и дообученная автором репозитория на наборе sxc_med_llm_chemical_gen. Она преобразует предложения и абзацы на английском языке в плотные векторы размерностью 768 для сравнения семантической близости, поиска похожих текстов и других задач представления текста. Модель поддерживает семантический поиск, поиск перефразирований, кластеризацию и классификацию текста; сходство можно оценивать косинусной мерой. Максимальная длина последовательности — 512 токенов, число параметров — 136,7 млн.

Модель подходит для поиска и группировки текстов в химической тематике, отражённой обучающим набором, а также для других задач сходства английских текстов. Ограничение лицензии Apache 2.0 позволяет использовать модель на её условиях. В README приведён результат cosine_accuracy 0,9838 на TripletEvaluator, но он относится к указанной оценке и сам по себе не гарантирует такое же качество на других данных.

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

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

Ограничения

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

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

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

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

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

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

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

Открыть на Hugging Face

MPNet base trained on sxc_med_llm_chemical_gen

This is a sentence-transformers model finetuned from microsoft/mpnet-base on the sxc_med_llm_chemical_gen 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: microsoft/mpnet-base
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 768 tokens
  • 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: MPNetModel 
  (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("Saideepthi55/sentencetransformer_ftmodel_on_chemical_dataset")
# Run inference
sentences = [
    'With a molecule represented by the SMILES string CNNNCC(=O)N[C@H](C)C[C@@H](C)NCc1ccc2c(c1)CCC2, propose adjustments that can increase its logP value while keeping the output molecule structurally related to the input molecule.',
    'Given a molecule expressed in SMILES string, help me optimize it according to my requirements.',
    'In line with your criteria, I\'ve optimized the molecule and present it as "C[C@H](C[C@@H](C)NC(=O)COC(C)(C)C)NCc1ccc2c(c1)CCC2".',
]
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

Triplet

MetricValue
cosine_accuracy0.9838
dot_accuracy0.0162
manhattan_accuracy0.9827
euclidean_accuracy0.9836
max_accuracy0.9838

Training Details

Training Dataset

sxc_med_llm_chemical_gen

  • Dataset: sxc_med_llm_chemical_gen at ae28874
  • Size: 117,502 training samples
  • Columns: input, instruction, and output
  • Approximate statistics based on the first 1000 samples:
    inputinstructionoutput
    typestringstringstring
    detailsmin: 2 tokensmean: 50.03 tokensmax: 156 tokensmin: 6 tokensmean: 16.19 tokensmax: 69 tokensmin: 3 tokensmean: 67.94 tokensmax: 321 tokens
  • Samples:
    inputinstructionoutput
    List the countries of the Middle EastEgypt, Israel, Iran, Iraq, Jordan, Kuwait, Lebanon, Qatar, Saudi Arabia, Syria, Turkey, The United Arab Emirates, Oman, and Yemen.
    Support me in refining the molecule CCC(C)=C(CC)c1ccc(Nc2nc3nonc3nc2N2CCC(Oc3ccc(Cl)cc3)CC2)cc1 to have a more drug-like nature, ensuring it remains close to the input molecule. Please inform me of the QED value of the optimized molecule.Help me adapt a molecular structure denoted in SMILES string based on my preferences.I've optimized the molecule according to your requirements, yielding the structure "COC(=O)c1ccc(Nc2nc3nonc3nc2N2CCC(Oc3ccc(Cl)cc3)CC2)cc1" and an estimated QED value of 0.4.
    Create a social media strategy to attract followers on Twitter.The social media strategy for Twitter should involve Tweeting on a regular basis, with content that is engaging and relevant to the target audience. This can include retweetable quotes, links to videos and articles, sharing photos/images, polls, and so on. It is also beneficial for the information to include hashtags relevant to the content and any relevant topics of the industry. It is also important to leverage Twitter influencers and accounts, as well as engaging with potential followers regularly and DM them when necessary. Additionally, running campaigns, contests and giveaways to gain more followers should also be part of the strategy. Finally, hashtag research should be conducted to increase the reach of the tweets.
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Evaluation Dataset

sxc_med_llm_chemical_gen

  • Dataset: sxc_med_llm_chemical_gen at ae28874
  • Size: 4,500 evaluation samples
  • Columns: input, instruction, and output
  • Approximate statistics based on the first 1000 samples:
    inputinstructionoutput
    typestringstringstring
    detailsmin: 2 tokensmean: 68.49 tokensmax: 165 tokensmin: 6 tokensmean: 16.89 tokensmax: 36 tokensmin: 3 tokensmean: 69.16 tokensmax: 205 tokens
  • Samples:
    inputinstructionoutput
    With a molecule represented by the SMILES string COc1ccc(CN(C(=O)Nc2ccc(C@Hc3ccccc3)c(Cl)c2)C2CC2)cc1, propose adjustments that can decrease its blood-brain barrier permeability (BBBP) value by at least 0.1 compared to the pre-optimized value while keeping the output molecule structurally related to the input molecule. Please inform me of the BBBP value of the optimized molecule.Help me adapt a molecular structure denoted in SMILES string based on my preferences.I've optimized the molecule according to your requirements, yielding the structure "CC(C)c1cccc(Oc2ccc(CN(C(=O)Nc3ccc(C@Hc4ccccc4)c(Cl)c3)C3CC3)cc2)c1" and an estimated BBBP value of 0.34.
    Which modifications can be applied to the molecule Cc1nn(-c2cc3cc(F)ccc3s2)c2ncc(C(=O)N3CCCC3c3nnc4n3CCCCC4)cc12 to increase its water solubility value while ensuring it remains similar to the original molecule?Aid me in refining a molecular structure written in SMILES notation based on my criteria.I've optimized the molecule according to your requirements, resulting in the following structure: "Cc1nn(C)c2ncc(C(=O)N3CCCC3c3nnc4n3CCCCC4)cc12".
    Describe the benefits of having a mentor.Having a mentor can provide tremendous benefits, including guidance, advice, support and connection to a network of contacts. Mentors can offer valuable feedback, help to create goals and strategies, and provide the accountability necessary to carry out the desired goals. They can also provide a fresh perspective which can help to create new ideas and solutions.
  • 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: 16
  • per_device_eval_batch_size: 16
  • learning_rate: 2e-05
  • num_train_epochs: 1
  • warmup_ratio: 0.1
  • fp16: True

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: 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: 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: 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
  • eval_on_start: False
  • eval_use_gather_object: False
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: proportional

Training Logs

EpochStepTraining LossValidation Losssxc_med_llm_chemical_gen_max_accuracy
00--0.7076
0.01361004.17053.63140.7469
0.02722003.00882.47710.8191
0.04083002.38032.37650.8716
0.05454002.22812.31220.9316
0.06815002.16472.29970.9436
0.08176002.12892.26630.9511
0.09537002.06632.26010.9629
0.10898002.0652.25000.9687
0.12259002.03992.25950.9693
0.136210001.99392.23750.9707
0.149811001.98582.22200.9684
0.163412002.00692.22650.9758
0.177013001.95912.20730.9702
0.190614001.92882.20780.976
0.204215001.94662.20360.9758
0.217916001.91752.20860.9764
0.231517001.88352.23290.9796
0.245118001.91342.20030.9796
0.258719001.88092.20030.9811
0.272320001.92632.20390.9824
0.285921001.91012.20840.9804
0.299622001.88462.20520.9831
0.313223001.88422.19030.9818
0.326824001.89452.19840.9807
0.340425001.92172.18590.9829
0.354026001.87042.19950.982
0.367627001.8892.20380.9822
0.381328001.8752.20790.9829
0.394929001.87922.19750.9833
0.408530001.8822.18950.9796
0.422131001.88862.21150.9831
0.435732001.86292.20400.9838
0.449333001.86472.19730.9836
0.463034001.88882.19610.9838
0.476635001.86922.20270.9829
0.490236001.88462.19540.9838
0.503837001.84822.18880.9822
0.517438001.85272.18730.9824
0.531039001.83782.19400.9811
0.544740001.86792.20080.9833
0.558341001.84212.18450.9842
0.571942001.83252.19480.9847
0.585543001.86752.17500.9836
0.599144001.84832.18280.9831
0.612745001.8542.18860.9831
0.626446001.8272.18760.9824
0.640047001.88632.18490.9836
0.653648001.89192.18160.984
0.667249001.82112.18300.9847
0.680850001.83452.18470.9842
0.694451001.86852.18550.9853
0.708152001.852.18640.9844
0.721753001.82222.18750.9842
0.735354001.81792.19230.9844
0.748955001.79922.19090.9851
0.762556001.84952.18110.9847
0.776157001.8082.17630.9842
0.789858001.82932.18610.9849
0.803459001.81842.18450.9851
0.817060001.82562.19560.9849
0.830661001.79042.19160.9842
0.844262001.80282.19180.9847
0.857863001.83162.19170.9856
0.871564001.79512.19290.9851
0.885165001.81752.18660.9847
0.898766001.80712.18990.9853
0.912367001.86322.19050.9844
0.925968001.84412.18850.984
0.939569001.82432.18650.9836
0.953270001.80552.18520.9842
0.966871001.82272.18430.984
0.980472001.82872.18310.984
0.994073001.83792.18380.9838

Framework Versions

  • Python: 3.10.12
  • Sentence Transformers: 3.2.0
  • Transformers: 4.44.2
  • PyTorch: 2.4.1+cu121
  • Accelerate: 0.34.2
  • Datasets: 3.0.1
  • 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…

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

0 моделей