/ Модель

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

Контекст
512 токенов
Параметры
137 млн
Архитектура
bert · dense
Опубликована
8 мар 2022

aspire-sentence-embedder

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

Англоязычный SciBERT-энкодер AllenAI преобразует научные предложения в векторы для оценки сходства и поиска документов.

169скачиваний за 30 дней3лайкавеса обновлены3 окт 2022

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

allenai/aspire-sentence-embedder — модель Allen Institute for AI для оценки сходства предложений и поиска научных документов. Она основана на SciBERT и кодирует предложение одним вектором, извлечённым из токена CLS. Модель содержит 137,1 млн параметров, использует архитектуру BERT и принимает последовательности длиной до 512 токенов.

Модель обучена на 4,3 млн пар контекстных предложений, ссылающихся на одни и те же научные работы, с контрастивным обучением. Она предназначена прежде всего для поиска семантически близких предложений и информационного поиска по научным аннотациям; для ранжирования документов можно сравнивать предложения запросов и кандидатов. Около половины обучающих данных относятся к биомедицине, поэтому модель может лучше работать в этой области. Обучающие данные — на английском языке.

Модель распространяется в формате PyTorch и доступна по лицензии Apache-2.0. Дообучение может потребоваться для классификации или переноса на задачи и области за пределами научного текста.

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

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

Ограничения

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

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

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

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

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

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

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

Открыть на Hugging Face

language: en

license: apache-2.0


Overview

Model included in a paper for modeling fine grained similarity between documents:

Title: "Multi-Vector Models with Textual Guidance for Fine-Grained Scientific Document Similarity"

Authors: Sheshera Mysore, Arman Cohan, Tom Hope

Paper: https://arxiv.org/abs/2111.08366

Github: https://github.com/allenai/aspire

Note: In the context of the paper, this model is referred to as cosentbert and represents a baseline sentence encoder for scientific text. The paper trains two versions of cosentbert, one for biomedical scientific text and another one for computer science text. This released model is trained on a union of all available data across scientific domains in the Semantic Scholar Open Research Corpus (S2ORC) dataset. This difference in training data leads to different, though close, evaluation performance than in the paper.

Model Card

Model description: This model represents a SciBERT based sentence encoder pre-trained for scientific text similarity. The model represents a sentence with a single vector obtained by reading the CLS token for the sentence.

Training data: The model is trained on sets of co-citation context sentences referencing the same set of papers in a contrastive learning setup. These sentences can often be considered as paraphrases since co-citation sentences citing the same papers often describe similar aspects of the co-cited papers. The model is trained on 4.3 million sentence pairs of this type. In training the model negative examples for the contrastive loss are obtained as random in-batch negatives. An example pair of sentences used for training is as follows:

"The idea of distant supervision has been proposed and used widely in Relation Extraction (Mintz et al., 2009; Riedel et al., 2010; Hoffmann et al., 2011; Surdeanu et al., 2012) , where the source of labels is an external knowledge base."

"Distant supervision [31, 43, 21, 49] generates training data automatically by aligning texts and a knowledge base (KB) (see Fig. 1 )."

Training procedure: The model was trained with the Adam Optimizer and a learning rate of 2e-5 with 1000 warm-up steps followed by linear decay of the learning rate. The model training convergence is checked with the loss on a held out dev set consisting of co-citation context pairs. All the training data used was in English.

Intended uses & limitations: This model is trained for sentence similarity tasks in scientific text and is best used as a sentence encoder. However with appropriate fine-tuning the model can also be used for other tasks such as classification. Note that about 50% of the training data consists of text from biomedical text and performance may be superior on text from bio-medicine and similar domains.

How to use: This model can be used as a BERT model via the transformers library:


from transformers import AutoModel, AutoTokenizer

aspire_sent = AutoModel.from_pretrained('allenai/aspire-sentence-embedder')

aspire_tok = AutoTokenizer.from_pretrained('allenai/aspire-sentence-embedder')

s='We present a new scientific document similarity model based on matching fine-grained aspects of texts.'

inputs = aspire_tok(s, padding=True, truncation=True, return_tensors="pt", max_length=512)

result = aspire_sent(\*\*inputs)

clsrep = result.last_hidden_state[:,0,:]

OR via the sentence_transformers library:


from sentence_transformers import SentenceTransformer, models

word_embedding_model = models.Transformer('allenai/aspire-sentence-embedder', max_seq_length=512)

pooling_model = models.Pooling(word_embedding_model.get_word_embedding_dimension(), pooling_mode='cls')

aspire_sb = SentenceTransformer(modules=[word_embedding_model, pooling_model])

clsrep_sb = sentbert_model.encode([s])

Variable and metrics:

Since the paper this model was trained for proposes methods for similarity of scientific abstracts, this model is evaluated on information retrieval datasets with document level queries. The datasets used for the paper include RELISH (biomedical/English), TRECCOVID (biomedical/English), and CSFCube (computer science/English). These are all detailed on github and in our paper. RELISH and TRECCOVID represent a abstract level retrieval task, where given a query scientific abstract the task requires the retrieval of relevant candidate abstracts. CSFCube presents a slightly different task and presents a set of finer-grained sentences in the abstract based on which a finer-grained retrieval must be made. This task represents the closest task to a sentence similarity task.

In using this sentence level model for abstract level retrieval we rank documents by the minimal L2 distance between the sentences in the query and candidate abstract.

Evaluation results:

The released model aspire-sentence-embedder is compared against 1) all-mpnet-base-v2 a sentence-bert model trained on ~1 billion training examples, 2) paraphrase-TinyBERT-L6-v2 a sentence-bert model trained on paraphrase pairs, and 3) the cosentbert models used in our paper.

| | CSFCube aggregated | CSFCube aggregated | TRECCOVID | TRECCOVID | RELISH | RELISH |

|-------------------------------------------:|:------------------:|:-------:|:---------:|:-------:|:------:|:-------:|

| | MAP | NDCG%20 | MAP | NDCG%20 | MAP | NDCG%20 |

| all-mpnet-base-v2 | 34.64 | 54.94 | 17.35 | 43.87 | 52.92 | 69.69 |

| paraphrase-TinyBERT-L6-v2 | 26.77 | 48.57 | 11.12 | 34.85 | 50.80 | 67.35 |

| cosentbert | 28.95 | 50.68 | 12.80 | 38.07 | 50.04 | 66.35 |

| aspire-sentence-embedder | 30.58 | 53.86 | 11.64 | 36.50 | 50.36 | 66.63 |

The released model sees similar performance across datasets to the per-domain cosentbert models used in our paper (and reported above).

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей