This repo contains the code to train, evaluate and reproduce the representation learning models and results on the benchmark introduced in SciRepEval.
Clone the repo and setup the environment as follows:
git clone git@github.com:allenai/scirepeval.git
cd scirepeval
conda create -n scirepeval python=3.8
conda activate scirepeval
pip install -r requirements.txt
Please refer to the following for further usage:
Training - Train multi-task/multi-format transformer models or adapter modules
Inference - Using the trained SciRepEval models to generate embeddings.
Evaluation - Evaluate trained models on custom tasks OR customize existing evaluation config for SciRepEval benchmark tasks
Benchmarking - Simply evaluate models(pretrained from HuggingFace/local checkpoints) on SciRepEval and generate a report
SciRepEval consists of 24 scientific document tasks to train and evaluate scientific document representation models. The tasks are divided across 4 task formats- classification CLF, regression RGN, proximity (nearest neighbors) retrieval PRX and ad-hoc search SRCH. The table below gives a brief overview of the tasks with their HuggingFace datasets config names, if applicable. The benchmark dataset can be downloaded from AWS S3 or HuggingFace as follows:
mkdir scirepeval_data && mkdir scirepeval_data/train && mkdir scirepeval_data/test && cd scirepeval_data
aws s3 --no-sign-request sync s3://ai2-s2-research-public/scirepeval/train train
aws s3 --no-sign-request sync s3://ai2-s2-research-public/scirepeval/test test
The AWS CLI commands can be run with the --dryrun
flag to list the files being copied. The entire dataset is ~24 GB in size.
The training, validation and raw evaluation data is available at allenai/scirepeval, while the labelled test examples are available at allenai/scirepeval_test.
import datasets
#training/validation/eval metadata
dataset = datasets.load_dataset(allenai/scirepeval, <hf config name>)
#labelled test examples
dataset = datasets.load_dataset(allenai/scirepeval_test, <hf config name>)
Since we want to evaluate document representations, every dataset consists of two parts: test metadata (text for representation generation available under allenai/scirepeval) and labelled examples (available under allenai/scirepeval_test)
*S2AND requires the evaluation dataset in a specific format so to evaluate your model on the task please follow these instructions.
**Combinations of multiple datasets - 1, 2, 3, also dataset of papers authored by potential reviewers is required for evaluation; hence the multiple dataset configs.
The aggregate benchmark is released under ODC-BY license. By downloading this data you acknowledge that you have read and agreed to all the terms in this license. For constituent datasets, also go through the individual licensing requirements, as applicable.
Please cite the SciRepEval work as:
@article{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},
journal={ArXiv},
year={2022},
volume={abs/2211.13308}
}