Upload 4 files
Browse files- fact2019.py +100 -0
- test-task1.json +0 -0
- train.json +0 -0
- validation.json +0 -0
fact2019.py
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# coding=utf-8
|
| 2 |
+
#
|
| 3 |
+
#
|
| 4 |
+
|
| 5 |
+
# Lint as: python3
|
| 6 |
+
"""Overview of FACT at IberLEF 2020: Events Detection and Classification"""
|
| 7 |
+
|
| 8 |
+
import os
|
| 9 |
+
|
| 10 |
+
import datasets
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
logger = datasets.logging.get_logger(__name__)
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
_CITATION = """\
|
| 17 |
+
@inproceedings{fact2020,
|
| 18 |
+
title = "Overview of FACT at IberLEF 2020: Events Detection and Classification",
|
| 19 |
+
author = "Rosa, Aiala and Chiruzzo, Luis and Wonsever, Dina and Malcuori, Marisa and Curell, Hortènsia and Castellón, Irene and Vázquez, Gloria and Fernández-Montraveta, Ana and Góngora, Santiago and Alonso, Laura",
|
| 20 |
+
booktitle = "Proceedings of the Seventh Conference on Natural Language Learning at {HLT}-{NAACL} 2003",
|
| 21 |
+
year = "2020",
|
| 22 |
+
url = "https://www.aclweb.org/anthology/W03-0419",
|
| 23 |
+
}
|
| 24 |
+
"""
|
| 25 |
+
|
| 26 |
+
_DESCRIPTION = """\
|
| 27 |
+
In this paper we present the second edition of the FACT shared task (Factuality Annotation and Classification
|
| 28 |
+
Task), included in IberLEF2020. The main objective of this task is to advance in the study of the factuality of
|
| 29 |
+
the events mentioned in texts. This year, the FACT task includes a subtask on event identification in addition
|
| 30 |
+
to the factuality classification subtask. We describe the submitted systems as well as the corpus used, which is
|
| 31 |
+
the same used in FACT 2019 but extended by adding annotations for nominal events.
|
| 32 |
+
"""
|
| 33 |
+
|
| 34 |
+
_URL = "https://huggingface.co/datasets/filevich/fact2020/raw/main/"
|
| 35 |
+
_URLS = {
|
| 36 |
+
"train": _URL + "train.json",
|
| 37 |
+
"validation": _URL + "validation.json",
|
| 38 |
+
"test": _URL + "test-task1.json",
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
class Fact2020Config(datasets.BuilderConfig):
|
| 43 |
+
"""BuilderConfig for Fact2020"""
|
| 44 |
+
|
| 45 |
+
def __init__(self, **kwargs):
|
| 46 |
+
"""BuilderConfig forFact2020.
|
| 47 |
+
Args:
|
| 48 |
+
**kwargs: keyword arguments forwarded to super.
|
| 49 |
+
"""
|
| 50 |
+
super(Fact2020Config, self).__init__(**kwargs)
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
class Fact2020(datasets.GeneratorBasedBuilder):
|
| 54 |
+
"""Fact2020 dataset."""
|
| 55 |
+
|
| 56 |
+
BUILDER_CONFIGS = [
|
| 57 |
+
Fact2020Config(name="fact2020", version=datasets.Version("1.0.0"), description="Fact2020 dataset"),
|
| 58 |
+
]
|
| 59 |
+
|
| 60 |
+
def _info(self):
|
| 61 |
+
return datasets.DatasetInfo(
|
| 62 |
+
description=_DESCRIPTION,
|
| 63 |
+
features=datasets.Features(
|
| 64 |
+
{
|
| 65 |
+
"id": datasets.Value("string"),
|
| 66 |
+
"tokens": datasets.Sequence(datasets.Value("string")),
|
| 67 |
+
"fact_tags": datasets.Sequence(
|
| 68 |
+
datasets.features.ClassLabel(
|
| 69 |
+
names=[
|
| 70 |
+
"O",
|
| 71 |
+
"F",
|
| 72 |
+
"CF",
|
| 73 |
+
"U",
|
| 74 |
+
]
|
| 75 |
+
)
|
| 76 |
+
),
|
| 77 |
+
}
|
| 78 |
+
),
|
| 79 |
+
supervised_keys=None,
|
| 80 |
+
homepage="https://ceur-ws.org/Vol-2664/fact_overview.pdf",
|
| 81 |
+
citation=_CITATION,
|
| 82 |
+
)
|
| 83 |
+
|
| 84 |
+
def _split_generators(self, dl_manager):
|
| 85 |
+
urls_to_download = _URLS
|
| 86 |
+
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
| 87 |
+
return [
|
| 88 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
|
| 89 |
+
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["validation"]}),
|
| 90 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
|
| 91 |
+
]
|
| 92 |
+
|
| 93 |
+
def _generate_examples(self, filepath):
|
| 94 |
+
logger.info("⏳ Generating examples from = %s", filepath)
|
| 95 |
+
|
| 96 |
+
import json
|
| 97 |
+
with open(filepath, encoding="utf-8") as f:
|
| 98 |
+
data = json.load(f)
|
| 99 |
+
return [(i, {"id": str(i), **d}) for i,d in enumerate(data)]
|
| 100 |
+
|
test-task1.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
train.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
validation.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|