File size: 1,782 Bytes
056956d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""SciCo"""

import os
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):
    def _info(self):
        return datasets.DatasetInfo(
                description=_DESCRIPTION,
                homepage="https://scico.apps.allenai.org/",
                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