SPECTER2 is the successor to
SPECTER
and is capable of generating task specific embeddings for scientific tasks when paired with
adapters
.
This is the base model to be used along with the 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.
We have a parallel version (termed
aug2023refresh
) where the base transformer encoder version is pre-trained on a collection of newer papers (published after 2018).
However, for benchmarking purposes, please continue using the current version.
This adapter was created for usage with the
adapters
library.
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.
Encode 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_base')
#load base model
model = AutoAdapterModel.from_pretrained('allenai/specter2_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", source="hf", load_as="proximity", set_active=True)
#other possibilities: allenai/specter2_<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, :]
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
.
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.
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.
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.
Please cite the following works if you end up using SPECTER2:
[SciRepEval paper](https://api.semanticscholar.org/CorpusID:254018137)
```bibtex
@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}
}
Runs of allenai specter2_base on huggingface.co
61.6K
Total runs
0
24-hour runs
-7.3K
3-day runs
-16.7K
7-day runs
-50.5K
30-day runs
More Information About specter2_base huggingface.co Model
specter2_base huggingface.co is an AI model on huggingface.co that provides specter2_base's model effect (), which can be used instantly with this allenai specter2_base model. huggingface.co supports a free trial of the specter2_base model, and also provides paid use of the specter2_base. Support call specter2_base model through api, including Node.js, Python, http.
specter2_base huggingface.co is an online trial and call api platform, which integrates specter2_base's modeling effects, including api services, and provides a free online trial of specter2_base, you can try specter2_base online for free by clicking the link below.
allenai specter2_base online free url in huggingface.co:
specter2_base is an open source model from GitHub that offers a free installation service, and any user can find specter2_base on GitHub to install. At the same time, huggingface.co provides the effect of specter2_base install, users can directly use specter2_base installed effect in huggingface.co for debugging and trial. It also supports api for free installation.