/ Модель

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

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

specter2_aug2023refresh_base

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

Базовый энкодер SPECTER2 создаёт эмбеддинги научных статей и коротких запросов для поиска и других задач анализа научной литературы.

1 780скачиваний за 30 дней3лайкавеса обновлены14 мая 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

SPECTER2 aug2023refresh base — базовый текстовый энкодер семейства SPECTER2 от Allen AI, разработанный Amanpreet Singh, Mike D'Arcy, Arman Cohan, Doug Downey и Sergey Feldman. Он предназначен для получения эмбеддингов научных статей по заголовку и аннотации, а также коротких текстовых запросов. Модель основана на BERT и обучена на связях цитирования между научными публикациями; для задач классификации, поиска и сравнения статей её используют с подходящим адаптером SPECTER2.

Модель содержит 137,1 млн параметров, принимает последовательности длиной до 512 токенов и распространяется в формате PyTorch. Она ориентирована на научные текстовые представления и оценивалась на бенчмарках SciRepEval и MDCR. Для универсальных эмбеддингов карточка рекомендует allenai/specter2; для наилучшего результата на конкретной задаче следует подключить соответствующий адаптер. Лицензия — Apache 2.0.

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

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

Ограничения

Это базовый энкодер: для специализированных задач SPECTER2 требуется соответствующий адаптер. Карточка рекомендует allenai/specter2 для универсального получения эмбеддингов.

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

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

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

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

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

Открыть на Hugging Face

SPECTER2

SPECTER2 is a family of models that succeeds SPECTER and is capable of generating task specific embeddings for scientific tasks when paired with adapters. This is the base encoder to be used with relevant task specific adapters. Given the combination of title and abstract of a scientific paper or a short texual query, the model can be used to generate effective embeddings to be used in downstream applications.

Note:For general embedding purposes, please use allenai/specter2.

To get the best performance on a downstream task type please load the associated adapter () with the base model as in the example below.

Dec 2023 Update:

Model usage updated to be compatible with latest versions of transformers and adapters (newly released update to adapter-transformers) libraries.

******Update******

This update introduces a new set of SPECTER2 models with the base transformer encoder pre-trained on an extended citation dataset containing more recent papers. For benchmarking purposes please use the existing SPECTER2 models w/o the aug2023refresh suffix.

Note:For general embedding purposes, please use allenai/specter2.

To get the best performance on a downstream task type please load the associated adapter with the base model as in the example below.

Model Details

Model Description

SPECTER2 has been trained on over 6M triplets of scientific paper citations, which are available here. Post that it is trained with additionally attached task format specific adapter modules on all the SciRepEval training tasks.

Task Formats trained on:

  • Classification
  • Regression
  • Proximity
  • Adhoc Search

It builds on the work done in SciRepEval: A Multi-Format Benchmark for Scientific Document Representations and we evaluate the trained model on this benchmark as well.

  • Developed by: Amanpreet Singh, Mike D'Arcy, Arman Cohan, Doug Downey, Sergey Feldman
  • Shared by : Allen AI
  • Model type: bert-base-uncased + adapters
  • License: Apache 2.0
  • Finetuned from model: allenai/scibert.

Model Sources

Uses

Direct Use

ModelName and HF linkDescription
Proximity*allenai/specter2_aug2023refreshEncode papers as queries and candidates eg. Link Prediction, Nearest Neighbor Search
Adhoc Queryallenai/specter2_aug2023refresh_adhoc_queryEncode short raw text queries for search tasks. (Candidate papers can be encoded with the proximity adapter)
Classificationallenai/specter2_aug2023refresh_classificationEncode papers to feed into linear classifiers as features
Regressionallenai/specter2_aug2023refresh_regressionEncode papers to feed into linear regressors as features

*Proximity model should suffice for downstream task types not mentioned above

from transformers import AutoTokenizer
from adapters import AutoAdapterModel

# load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained('allenai/specter2_aug2023refresh_base')

#load base model
model = AutoAdapterModel.from_pretrained('allenai/specter2_aug2023refresh_base')

#load the adapter(s) as per the required task, provide an identifier for the adapter in load_as argument and activate it
model.load_adapter("allenai/specter2_aug2023refresh", source="hf", load_as="proximity", set_active=True)
#other possibilities: allenai/specter2_aug2023refresh_<classification|regression|adhoc_query>

papers = [{'title': 'BERT', 'abstract': 'We introduce a new language representation model called BERT'},
          {'title': 'Attention is all you need', 'abstract': ' The dominant sequence transduction models are based on complex recurrent or convolutional neural networks'}]

# concatenate title and abstract
text_batch = [d['title'] + tokenizer.sep_token + (d.get('abstract') or '') for d in papers]
# preprocess the input
inputs = self.tokenizer(text_batch, padding=True, truncation=True,
                                   return_tensors="pt", return_token_type_ids=False, max_length=512)
output = model(**inputs)
# take the first token in the batch as the embedding
embeddings = output.last_hidden_state[:, 0, :]

Downstream Use

For evaluation and downstream usage, please refer to https://github.com/allenai/scirepeval/blob/main/evaluation/INFERENCE.md.

Training Details

Training Data

The base model is trained on citation links between papers and the adapters are trained on 8 large scale tasks across the four formats. All the data is a part of SciRepEval benchmark and is available here.

The citation link are triplets in the form

{"query": {"title": ..., "abstract": ...}, "pos": {"title": ..., "abstract": ...}, "neg": {"title": ..., "abstract": ...}}

consisting of a query paper, a positive citation and a negative which can be from the same/different field of study as the query or citation of a citation.

Training Procedure

Please refer to the SPECTER paper.

Training Hyperparameters

The model is trained in two stages using SciRepEval:

  • Base Model: First a base model is trained on the above citation triplets. batch size = 1024, max input length = 512, learning rate = 2e-5, epochs = 2 warmup steps = 10% fp16
  • Adapters: Thereafter, task format specific adapters are trained on the SciRepEval training tasks, where 600K triplets are sampled from above and added to the training data as well. batch size = 256, max input length = 512, learning rate = 1e-4, epochs = 6 warmup = 1000 steps fp16

Evaluation

We evaluate the model on SciRepEval, a large scale eval benchmark for scientific embedding tasks which which has [SciDocs] as a subset. We also evaluate and establish a new SoTA on MDCR, a large scale citation recommendation benchmark.

ModelSciRepEval In-TrainSciRepEval Out-of-TrainSciRepEval AvgMDCR(MAP, Recall@5)
BM-25n/an/an/a(33.7, 28.5)
SPECTER54.757.468.0(30.6, 25.5)
SciNCL55.657.869.0(32.6, 27.3)
SciRepEval-Adapters61.959.070.9(35.3, 29.6)
SPECTER2-Adapters62.359.271.2(38.4, 33.0)

Please cite the following works if you end up using SPECTER2:

SPECTER paper:

@inproceedings{specter2020cohan,
  title={{SPECTER: Document-level Representation Learning using Citation-informed Transformers}},
  author={Arman Cohan and Sergey Feldman and Iz Beltagy and Doug Downey and Daniel S. Weld},
  booktitle={ACL},
  year={2020}
}

SciRepEval paper

@inproceedings{Singh2022SciRepEvalAM,
  title={SciRepEval: A Multi-Format Benchmark for Scientific Document Representations},
  author={Amanpreet Singh and Mike D'Arcy and Arman Cohan and Doug Downey and Sergey Feldman},
  booktitle={Conference on Empirical Methods in Natural Language Processing},
  year={2022},
  url={https://api.semanticscholar.org/CorpusID:254018137}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей