/ Модель

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

Контекст
514 токенов
Параметры
137 млн
Лицензия
Своя лицензия
Архитектура
mpnet · dense
Опубликована
20 окт 2022

BioLORD-STAMB2-v1

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

BioLORD-STAMB2-v1 преобразует клинические предложения и биомедицинские понятия в эмбеддинги для семантического поиска, сравнения и кластеризации.

126скачиваний за 30 дней14лайковвеса обновлены27 ноя 2023

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

FremyCompany BioLORD-STAMB2-v1 — модель эмбеддингов для клинических предложений и биомедицинских понятий, разработанная на основе стратегии предобучения BioLORD. Это дообученная версия sentence-transformers/all-mpnet-base-v2, обученная на BioLORD-Dataset; архитектура MPNet, около 136,7 млн параметров. Модель преобразует предложения и фразы в плотные векторы размерности 768 и сопоставляет их в общем семантическом пространстве.

Модель предназначена для семантического поиска, оценки сходства и кластеризации биомедицинского текста, включая клинические записи и медицинские документы. Опора на определения понятий и краткие описания из биомедицинских онтологий помогает сохранять семантические и иерархические связи. В README сообщается о высоких результатах на MedSTS и MayoSRS. Контекст составляет 514 токенов; заявленный язык — английский.

Модель выпущена в 2022 году, и авторы рекомендуют для большинства сценариев более новую версию BioLORD-2023. Лицензия указана как other, поэтому условия использования следует сверить с карточкой репозитория. Поддерживается PyTorch и доступно использование через Sentence-Transformers или Transformers.

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

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

Ограничения

Модель выпущена в 2022 году; авторы рекомендуют BioLORD-2023 для большинства сценариев. Заявленная языковая поддержка — английский, а контекст ограничен 514 токенами.

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

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

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

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

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

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

Открыть на Hugging Face

FremyCompany/BioLORD-STAMB2-v1

This model was trained using BioLORD, a new pre-training strategy for producing meaningful representations for clinical sentences and biomedical concepts.

IMPORTANT NOTE:

This model was introduced in 2022. Since then, a new version has been published. For most use cases, you will be better served by BioLORD-2023, our latest generation of BioLORD models.

State-of-the-art methodologies operate by maximizing the similarity in representation of names referring to the same concept, and preventing collapse through contrastive learning. However, because biomedical names are not always self-explanatory, it sometimes results in non-semantic representations.

BioLORD overcomes this issue by grounding its concept representations using definitions, as well as short descriptions derived from a multi-relational knowledge graph consisting of biomedical ontologies. Thanks to this grounding, our model produces more semantic concept representations that match more closely the hierarchical structure of ontologies. BioLORD establishes a new state of the art for text similarity on both clinical sentences (MedSTS) and biomedical concepts (MayoSRS).

This model is based on sentence-transformers/all-mpnet-base-v2 and was further finetuned on the BioLORD-Dataset.

General purpose

This is a sentence-transformers model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search. This model has been finentuned for the biomedical domain. While it preserves a good ability to produce embeddings for general-purpose text, it will be more useful to you if you are trying to process medical documents such as EHR records or clinical notes. Both sentences and phrases can be embedded in the same latent space.

Citation

This model accompanies the BioLORD: Learning Ontological Representations from Definitions paper, accepted in the EMNLP 2022 Findings. When you use this model, please cite the original paper as follows:

@inproceedings{remy-etal-2022-biolord,
    title = "{B}io{LORD}: Learning Ontological Representations from Definitions for Biomedical Concepts and their Textual Descriptions",
    author = "Remy, François  and
      Demuynck, Kris  and
      Demeester, Thomas",
    booktitle = "Findings of the Association for Computational Linguistics: EMNLP 2022",
    month = dec,
    year = "2022",
    address = "Abu Dhabi, United Arab Emirates",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2022.findings-emnlp.104",
    pages = "1454--1465",
    abstract = "This work introduces BioLORD, a new pre-training strategy for producing meaningful representations for clinical sentences and biomedical concepts. State-of-the-art methodologies operate by maximizing the similarity in representation of names referring to the same concept, and preventing collapse through contrastive learning. However, because biomedical names are not always self-explanatory, it sometimes results in non-semantic representations. BioLORD overcomes this issue by grounding its concept representations using definitions, as well as short descriptions derived from a multi-relational knowledge graph consisting of biomedical ontologies. Thanks to this grounding, our model produces more semantic concept representations that match more closely the hierarchical structure of ontologies. BioLORD establishes a new state of the art for text similarity on both clinical sentences (MedSTS) and biomedical concepts (MayoSRS).",
}

You might also want to take a look at our MWE 2023 Paper:

Usage (Sentence-Transformers)

Using this model becomes easy when you have sentence-transformers installed:

pip install -U sentence-transformers

Then you can use the model like this:

from sentence_transformers import SentenceTransformer
sentences = ["Cat scratch injury", "Cat scratch disease", "Bartonellosis"]

model = SentenceTransformer('FremyCompany/BioLORD-STAMB2-v1')
embeddings = model.encode(sentences)
print(embeddings)

Usage (HuggingFace Transformers)

Without sentence-transformers, you can use the model like this: First, you pass your input through the transformer model, then you have to apply the right pooling-operation on-top of the contextualized word embeddings.

from transformers import AutoTokenizer, AutoModel
import torch
import torch.nn.functional as F

#Mean Pooling - Take attention mask into account for correct averaging
def mean_pooling(model_output, attention_mask):
    token_embeddings = model_output[0] #First element of model_output contains all token embeddings
    input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
    return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)

# Sentences we want sentence embeddings for
sentences = ["Cat scratch injury", "Cat scratch disease", "Bartonellosis"]

# Load model from HuggingFace Hub
tokenizer = AutoTokenizer.from_pretrained('FremyCompany/BioLORD-STAMB2-v1')
model = AutoModel.from_pretrained('FremyCompany/BioLORD-STAMB2-v1')

# Tokenize sentences
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')

# Compute token embeddings
with torch.no_grad():
    model_output = model(**encoded_input)
# Perform pooling
sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
# Normalize embeddings
sentence_embeddings = F.normalize(sentence_embeddings, p=2, dim=1)
print("Sentence embeddings:")
print(sentence_embeddings)

License

My own contributions for this model are covered by the MIT license. However, given the data used to train this model originates from UMLS, you will need to ensure you have proper licensing of UMLS before using this model. UMLS is free of charge in most countries, but you might have to create an account and report on your usage of the data yearly to keep a valid license.

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

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

GPU в ailist

Универсальный рантайм

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

Подбираем GPU…

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

0 моделей