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.
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.
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.
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_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, :]
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.
@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}
}
@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_aug2023refresh_base on huggingface.co
173.9K
Total runs
0
24-hour runs
-1.1K
3-day runs
-19.2K
7-day runs
-113.8K
30-day runs
More Information About specter2_aug2023refresh_base huggingface.co Model
More specter2_aug2023refresh_base license Visit here:
specter2_aug2023refresh_base huggingface.co is an AI model on huggingface.co that provides specter2_aug2023refresh_base's model effect (), which can be used instantly with this allenai specter2_aug2023refresh_base model. huggingface.co supports a free trial of the specter2_aug2023refresh_base model, and also provides paid use of the specter2_aug2023refresh_base. Support call specter2_aug2023refresh_base model through api, including Node.js, Python, http.
specter2_aug2023refresh_base huggingface.co is an online trial and call api platform, which integrates specter2_aug2023refresh_base's modeling effects, including api services, and provides a free online trial of specter2_aug2023refresh_base, you can try specter2_aug2023refresh_base online for free by clicking the link below.
allenai specter2_aug2023refresh_base online free url in huggingface.co:
specter2_aug2023refresh_base is an open source model from GitHub that offers a free installation service, and any user can find specter2_aug2023refresh_base on GitHub to install. At the same time, huggingface.co provides the effect of specter2_aug2023refresh_base install, users can directly use specter2_aug2023refresh_base installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
specter2_aug2023refresh_base install url in huggingface.co: