Datasets:
Tasks:
Token Classification
Modalities:
Text
Sub-tasks:
coreference-resolution
Languages:
English
Size:
< 1K
License:
"""SciCo""" | |
import os | |
from datasets.arrow_dataset import DatasetTransformationNotAllowedError | |
import jsonlines | |
import datasets | |
_CITATION = """\ | |
@inproceedings{ | |
cattan2021scico, | |
title={SciCo: Hierarchical Cross-Document Coreference for Scientific Concepts}, | |
author={Arie Cattan and Sophie Johnson and Daniel S. Weld and Ido Dagan and Iz Beltagy and Doug Downey and Tom Hope}, | |
booktitle={3rd Conference on Automated Knowledge Base Construction}, | |
year={2021}, | |
url={https://openreview.net/forum?id=OFLbgUP04nC} | |
} | |
""" | |
_DESCRIPTION = """\ | |
SciCo is a dataset for hierarchical cross-document coreference resolution | |
over scientific papers in the CS domain. | |
""" | |
_DATA_URL = "https://nlp.biu.ac.il/~ariecattan/scico/data.tar" | |
class Scico(datasets.GeneratorBasedBuilder): | |
# BUILDER_CONFIGS = [ | |
# datasets.BuilderConfig( | |
# name="plain_text", | |
# version=datasets.Version("1.0.0", ""), | |
# description="SciCo", | |
# ) | |
# ] | |
def _info(self): | |
return datasets.DatasetInfo( | |
description=_DESCRIPTION, | |
homepage="https://scico.apps.allenai.org/", | |
features=datasets.Features( | |
{ | |
"flatten_tokens": datasets.features.Sequence(datasets.features.Value("string")), | |
"flatten_mentions": datasets.features.Sequence(datasets.features.Value("int32"), length=3), | |
"tokens": datasets.features.Sequence(datasets.features.Value("string")), | |
"doc_ids": datasets.features.Sequence(datasets.features.Value("int32")), | |
"metadata": datasets.features.Sequence( | |
{ | |
"title": datasets.feature.Value("string"), | |
"_merge": datasets.feature.Value("string"), | |
"paper_sha": datasets.feature.Value("string"), | |
"fields_of_study": datasets.features.Sequences(datasets.feature.Value("string")), | |
"Year": datasets.feature.Value("string"), | |
"BookTitle": datasets.feature.Value("string"), | |
"url": datasets.feature.Value("string") | |
} | |
), | |
"sentences": datasets.features.Sequence(datasets.features.Sequence(datasets.features.Sequence(datasets.features.Value("int32")))), | |
"mentions": datasets.features.Sequence(datasets.features.Sequence(datasets.features.Value("int32"), length=4)), | |
"relations": datasets.features.Sequence(datasets.features.Sequence(datasets.features.Value("int32"), length=2)), | |
"id": datasets.Value("int32"), | |
"source": datasets.Value("string") | |
} | |
), | |
supervised_keys=None, | |
citation = _CITATION) | |
def _split_generators(self, dl_manager): | |
data_dir = dl_manager.download_and_extract(_DATA_URL) | |
return [ | |
datasets.SplitGenerator( | |
name=datasets.Split.TEST, gen_kwargs={"filepath": os.path.join(data_dir, "test.jsonl")} | |
), | |
datasets.SplitGenerator( | |
name=datasets.Split.VALIDATION, gen_kwargs={"filepath": os.path.join(data_dir, "dev.jsonl")} | |
), | |
datasets.SplitGenerator( | |
name=datasets.Split.TRAIN, gen_kwargs={"filepath": os.path.join(data_dir, "train.jsonl")} | |
), | |
] | |
def _generate_examples(self, filepath): | |
"""This function returns the examples in the raw (text) form.""" | |
with jsonlines.open(filepath, 'r') as f: | |
for topic in f: | |
yield topic | |