scirepeval_test / scirepeval_test_configs.py
Amanpreet Singh
new commit
7474d71
raw
history blame
5.51 kB
from typing import Dict, Any, List
import datasets
class ScirepevalConfig(datasets.BuilderConfig):
"""BuilderConfig for SuperGLUE."""
def __init__(self, task_type: str, features: Dict[str, Any]=None, url="", **kwargs):
"""BuilderConfig for SuperGLUE.
Args:
features: *list[string]*, list of the features that will appear in the
feature dict. Should not include "label".
data_url: *string*, url to download the zip file from.
citation: *string*, citation for the data set.
url: *string*, url for information about the data set.
label_classes: *list[string]*, the list of classes for the label if the
label is present as a string. Non-string labels will be cast to either
'False' or 'True'.
**kwargs: keyword arguments forwarded to super.
"""
super().__init__(version=datasets.Version("1.1.0"), **kwargs)
self.features = features
self.task_type = task_type
self.url = url
SCIREPEVAL_CONFIGS = [
ScirepevalConfig(name="fos", features={"paper_id": datasets.Value("string"),
"label": datasets.Sequence(datasets.Value("int32"))}, task_type="classification"),
ScirepevalConfig(name="mesh_descriptors", features={"paper_id": datasets.Value("string"),
"label": datasets.Value("int32")}, task_type="classification"),
ScirepevalConfig(name="biomimicry", features={"paper_id": datasets.Value("string"),
"label": datasets.Value("int32")}, task_type="classification"),
ScirepevalConfig(name="cite_count", features={"paper_id": datasets.Value("string"),
"label": datasets.Value("float64")}, task_type="regression"),
ScirepevalConfig(name="pub_year", features={"paper_id": datasets.Value("string"),
"label": datasets.Value("float64")}, task_type="regression"),
ScirepevalConfig(name="high_influence_cite", features={"query_id": datasets.Value("string"),
"cand_id": datasets.Value("string"), "score": datasets.Value("uint8")}, task_type="proximity"),
ScirepevalConfig(name="same_author", features={"query_id": datasets.Value("string"),
"cand_id": datasets.Value("string"), "score": datasets.Value("uint8")}, task_type="proximity"),
ScirepevalConfig(name="search", features={"query_id": datasets.Value("string"),
"cand_id": datasets.Value("string"), "score": datasets.Value("uint8")}, task_type="search"),
ScirepevalConfig(name="drsm", task_type="classification", features={"paper_id": datasets.Value("string"),
"label": datasets.Value("int32")}),
ScirepevalConfig(name="relish", features={"query_id": datasets.Value("string"),
"cand_id": datasets.Value("string"), "score": datasets.Value("uint8")}, task_type="proximity"),
ScirepevalConfig(name="nfcorpus", features={"query_id": datasets.Value("string"),
"cand_id": datasets.Value("string"), "score": datasets.Value("uint8")}, task_type="search"),
ScirepevalConfig(name="peer_review_score", task_type="regression", url="peer_review_score_hIndex/peer_review_score", features={"paper_id": datasets.Value("string"),
"label": datasets.Value("float64")}),
ScirepevalConfig(name="hIndex", task_type="regression", url="peer_review_score_hIndex/hIndex", features={"paper_id": datasets.Value("string"),
"label": datasets.Value("float64")}),
ScirepevalConfig(name="trec_covid", features={"query_id": datasets.Value("string"),
"cand_id": datasets.Value("string"), "score": datasets.Value("int8")}, task_type="search"),
ScirepevalConfig(name="tweet_mentions", task_type="regression", features={"paper_id": datasets.Value("string"),
"label": datasets.Value("float64")}),
ScirepevalConfig(name="scidocs_mag", task_type="classification", url="scidocs/mag_mesh/mag", features={"paper_id": datasets.Value("string"),
"label": datasets.Value("int32")}),
ScirepevalConfig(name="scidocs_mesh", task_type="classification", url="scidocs/mag_mesh/mesh", features={"paper_id": datasets.Value("string"),
"label": datasets.Value("int32")}),
ScirepevalConfig(name="scidocs_view", features={"query_id": datasets.Value("string"),
"cand_id": datasets.Value("string"), "score": datasets.Value("uint8")}, task_type="proximity", url="scidocs/view_cite_read/coview"),
ScirepevalConfig(name="scidocs_cite", features={"query_id": datasets.Value("string"),
"cand_id": datasets.Value("string"), "score": datasets.Value("uint8")}, task_type="proximity", url="scidocs/view_cite_read/cite"),
ScirepevalConfig(name="scidocs_cocite", features={"query_id": datasets.Value("string"),
"cand_id": datasets.Value("string"), "score": datasets.Value("uint8")}, task_type="proximity", url="scidocs/view_cite_read/cocite"),
ScirepevalConfig(name="scidocs_read", features={"query_id": datasets.Value("string"),
"cand_id": datasets.Value("string"), "score": datasets.Value("uint8")}, task_type="proximity", url="scidocs/view_cite_read/coread"),
ScirepevalConfig(name="reviewers", task_type="metadata", url="paper_reviewer_matching", features={"r_id": datasets.Value("string"),
"papers": datasets.Sequence(datasets.Value("string"))}),
ScirepevalConfig(name="paper_reviewer_matching", features={"query_id": datasets.Value("string"),
"cand_id": datasets.Value("string"), "score": datasets.Value("uint8")}, task_type="proximity"),
]