/ Модель

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

Контекст
512 токенов
Параметры
137 млн
Лицензия
Своя лицензия
Архитектура
bert · dense
Опубликована
24 окт 2023

MedCPT-Article-Encoder

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

BERT-кодировщик NCBI/NLM, создающий векторы биомедицинских статей для семантического поиска и кластеризации.

59 584скачиваний за 30 дней32лайкавеса обновлены3 дек 2023

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

MedCPT Article Encoder — модель-кодировщик текстов из серии MedCPT, разработанной Computational Biology Branch при NCBI/NLM. Она преобразует биомедицинские статьи, включая заголовки и аннотации PubMed, в векторы размерности 768 для семантического поиска, кластеризации и сравнения статей. Архитектура — BERT; модель содержит 136,7 млн параметров и поддерживает контекст до 512 токенов.

Кодировщик обучен на 255 млн пар поисковых запросов и статей PubMed. Его векторы находятся в общем пространстве с векторами MedCPT Query Encoder, поэтому их можно использовать для поиска статей по запросам при совместном применении двух кодировщиков. Также доступны сценарии кластеризации и поиска статей по другим статьям. Для клинических решений результаты требуют проверки специалистом. Лицензия указана как other; README не уточняет её условия.

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

  • создание векторного индекса заголовков и аннотаций PubMed
  • поиск биомедицинских статей по запросам с MedCPT Query Encoder
  • поиск похожих статей PubMed
  • кластеризация биомедицинских публикаций
  • сравнение статей по семантической близости

Ограничения

Контекст ограничен 512 токенами; для поиска запросов и статей требуется совместимое представление запросов, например MedCPT Query Encoder. Модель не предназначена для самостоятельной диагностики или медицинских решений, а условия лицензии в карточке не раскрыты.

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

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

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

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

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

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

Открыть на Hugging Face

MedCPT Introduction

MedCPT generates embeddings of biomedical texts that can be used for semantic search (dense retrieval). The model contains two encoders:

This repo contains the MedCPT Article Encoder.

MedCPT has been pre-trained by an unprecedented scale of 255M query-article pairs from PubMed search logs, and has been shown to achieve state-of-the-art performance on several zero-shot biomedical IR datasets. In general, there are three use cases:

  1. Query-to-article search with both encoders.
  2. Query representation for clustering or query-to-query search with the query encoder.
  3. Article representation for clustering or article-to-article search with the article encoder.

For more details, please check out our paper (Bioinformatics, 2023). Please note that the released version is slightly different from the version reported in the paper.

Case 1. Using the MedCPT Article Encoder

import torch
from transformers import AutoTokenizer, AutoModel

model = AutoModel.from_pretrained("ncbi/MedCPT-Article-Encoder")
tokenizer = AutoTokenizer.from_pretrained("ncbi/MedCPT-Article-Encoder")

# each article contains a list of two texts (usually a title and an abstract)
articles = [
	[
		"Diagnosis and Management of Central Diabetes Insipidus in Adults",
		"Central diabetes insipidus (CDI) is a clinical syndrome which results from loss or impaired function of vasopressinergic neurons in the hypothalamus/posterior pituitary, resulting in impaired synthesis and/or secretion of arginine vasopressin (AVP). [...]",
	],
	[
		"Adipsic diabetes insipidus",
		"Adipsic diabetes insipidus (ADI) is a rare but devastating disorder of water balance with significant associated morbidity and mortality. Most patients develop the disease as a result of hypothalamic destruction from a variety of underlying etiologies. [...]",
	],
	[
		"Nephrogenic diabetes insipidus: a comprehensive overview",
		"Nephrogenic diabetes insipidus (NDI) is characterized by the inability to concentrate urine that results in polyuria and polydipsia, despite having normal or elevated plasma concentrations of arginine vasopressin (AVP). [...]",
	],
]

with torch.no_grad():
	# tokenize the articles
	encoded = tokenizer(
		articles, 
		truncation=True, 
		padding=True, 
		return_tensors='pt', 
		max_length=512,
	)
	
	# encode the queries (use the [CLS] last hidden states as the representations)
	embeds = model(**encoded).last_hidden_state[:, 0, :]

	print(embeds)
	print(embeds.size())

The output will be:

tensor([[-0.0189,  0.0115,  0.0988,  ..., -0.0655,  0.3155, -0.0357],
        [-0.3402, -0.3064, -0.0749,  ..., -0.0799,  0.3332,  0.1263],
        [-0.2764, -0.0506, -0.0608,  ...,  0.0389,  0.2532,  0.1580]])
torch.Size([3, 768])

These embeddings are also in the same space as those generated by the MedCPT query encoder.

Case 2. Use the Pre-computed Embeddings

We have provided the embeddings of all PubMed articles generated by the MedCPT article encoder at https://ftp.ncbi.nlm.nih.gov/pub/lu/MedCPT/pubmed_embeddings/.

Acknowledgments

This work was supported by the Intramural Research Programs of the National Institutes of Health, National Library of Medicine.

Disclaimer

This tool shows the results of research conducted in the Computational Biology Branch, NCBI/NLM. The information produced on this website is not intended for direct diagnostic use or medical decision-making without review and oversight by a clinical professional. Individuals should not change their health behavior solely on the basis of information produced on this website. NIH does not independently verify the validity or utility of the information produced by this tool. If you have questions about the information produced on this website, please see a health care professional. More information about NCBI's disclaimer policy is available.

Citation

If you find this repo helpful, please cite MedCPT by:

@article{jin2023medcpt,
  title={MedCPT: Contrastive Pre-trained Transformers with large-scale PubMed search logs for zero-shot biomedical information retrieval},
  author={Jin, Qiao and Kim, Won and Chen, Qingyu and Comeau, Donald C and Yeganova, Lana and Wilbur, W John and Lu, Zhiyong},
  journal={Bioinformatics},
  volume={39},
  number={11},
  pages={btad651},
  year={2023},
  publisher={Oxford University Press}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей