File size: 5,512 Bytes
7474d71 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
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"),
]
|