Upload indocoref.py with huggingface_hub
Browse files- indocoref.py +23 -23
indocoref.py
CHANGED
|
@@ -9,24 +9,24 @@ except:
|
|
| 9 |
|
| 10 |
import datasets
|
| 11 |
|
| 12 |
-
from
|
| 13 |
TextPreprocess
|
| 14 |
-
from
|
| 15 |
-
from
|
| 16 |
-
from
|
| 17 |
|
| 18 |
_CITATION = """\
|
| 19 |
@inproceedings{artari-etal-2021-multi,
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
}
|
| 31 |
"""
|
| 32 |
|
|
@@ -62,28 +62,28 @@ _URLS = {
|
|
| 62 |
_SUPPORTED_TASKS = [Tasks.COREFERENCE_RESOLUTION]
|
| 63 |
# Does not seem to have versioning
|
| 64 |
_SOURCE_VERSION = "1.0.0"
|
| 65 |
-
|
| 66 |
|
| 67 |
|
| 68 |
class Indocoref(datasets.GeneratorBasedBuilder):
|
| 69 |
"""A collection of 210 curated articles from Wikipedia Bahasa Indonesia with Coreference Annotations"""
|
| 70 |
|
| 71 |
SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
|
| 72 |
-
|
| 73 |
|
| 74 |
BUILDER_CONFIGS = [
|
| 75 |
-
|
| 76 |
name="indocoref_source",
|
| 77 |
version=SOURCE_VERSION,
|
| 78 |
description="Indocoref source schema",
|
| 79 |
schema="source",
|
| 80 |
subset_id="indocoref",
|
| 81 |
),
|
| 82 |
-
|
| 83 |
-
name="
|
| 84 |
-
version=
|
| 85 |
description="Indocoref Nusantara schema",
|
| 86 |
-
schema="
|
| 87 |
subset_id="indocoref",
|
| 88 |
),
|
| 89 |
]
|
|
@@ -121,7 +121,7 @@ class Indocoref(datasets.GeneratorBasedBuilder):
|
|
| 121 |
],
|
| 122 |
}
|
| 123 |
)
|
| 124 |
-
elif self.config.schema == "
|
| 125 |
features = schemas.kb_features
|
| 126 |
|
| 127 |
return datasets.DatasetInfo(
|
|
@@ -209,7 +209,7 @@ class Indocoref(datasets.GeneratorBasedBuilder):
|
|
| 209 |
}
|
| 210 |
yield index, row
|
| 211 |
|
| 212 |
-
elif self.config.schema == "
|
| 213 |
for index, example in enumerate(data):
|
| 214 |
passage, mentions = example["passage"], example["mentions"]
|
| 215 |
# Annotated text does not have any line breaks but the original passage does
|
|
|
|
| 9 |
|
| 10 |
import datasets
|
| 11 |
|
| 12 |
+
from seacrowd.sea_datasets.indocoref.utils.text_preprocess import \
|
| 13 |
TextPreprocess
|
| 14 |
+
from seacrowd.utils import schemas
|
| 15 |
+
from seacrowd.utils.configs import SEACrowdConfig
|
| 16 |
+
from seacrowd.utils.constants import Tasks
|
| 17 |
|
| 18 |
_CITATION = """\
|
| 19 |
@inproceedings{artari-etal-2021-multi,
|
| 20 |
+
title = {{A Multi-Pass Sieve Coreference Resolution for Indonesian}},
|
| 21 |
+
author = {Artari, Valentina Kania Prameswara and Mahendra, Rahmad and Jiwanggi, Meganingrum Arista and Anggraito, Adityo and Budi, Indra},
|
| 22 |
+
year = 2021,
|
| 23 |
+
month = {Sep},
|
| 24 |
+
booktitle = {Proceedings of the International Conference on Recent Advances in Natural Language Processing (RANLP 2021)},
|
| 25 |
+
publisher = {INCOMA Ltd.},
|
| 26 |
+
address = {Held Online},
|
| 27 |
+
pages = {79--85},
|
| 28 |
+
url = {https://aclanthology.org/2021.ranlp-1.10},
|
| 29 |
+
abstract = {Coreference resolution is an NLP task to find out whether the set of referring expressions belong to the same concept in discourse. A multi-pass sieve is a deterministic coreference model that implements several layers of sieves, where each sieve takes a pair of correlated mentions from a collection of non-coherent mentions. The multi-pass sieve is based on the principle of high precision, followed by increased recall in each sieve. In this work, we examine the portability of the multi-pass sieve coreference resolution model to the Indonesian language. We conduct the experiment on 201 Wikipedia documents and the multi-pass sieve system yields 72.74{\%} of MUC F-measure and 52.18{\%} of BCUBED F-measure.}
|
| 30 |
}
|
| 31 |
"""
|
| 32 |
|
|
|
|
| 62 |
_SUPPORTED_TASKS = [Tasks.COREFERENCE_RESOLUTION]
|
| 63 |
# Does not seem to have versioning
|
| 64 |
_SOURCE_VERSION = "1.0.0"
|
| 65 |
+
_SEACROWD_VERSION = "2024.06.20"
|
| 66 |
|
| 67 |
|
| 68 |
class Indocoref(datasets.GeneratorBasedBuilder):
|
| 69 |
"""A collection of 210 curated articles from Wikipedia Bahasa Indonesia with Coreference Annotations"""
|
| 70 |
|
| 71 |
SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
|
| 72 |
+
SEACROWD_VERSION = datasets.Version(_SEACROWD_VERSION)
|
| 73 |
|
| 74 |
BUILDER_CONFIGS = [
|
| 75 |
+
SEACrowdConfig(
|
| 76 |
name="indocoref_source",
|
| 77 |
version=SOURCE_VERSION,
|
| 78 |
description="Indocoref source schema",
|
| 79 |
schema="source",
|
| 80 |
subset_id="indocoref",
|
| 81 |
),
|
| 82 |
+
SEACrowdConfig(
|
| 83 |
+
name="indocoref_seacrowd_kb",
|
| 84 |
+
version=SEACROWD_VERSION,
|
| 85 |
description="Indocoref Nusantara schema",
|
| 86 |
+
schema="seacrowd_kb",
|
| 87 |
subset_id="indocoref",
|
| 88 |
),
|
| 89 |
]
|
|
|
|
| 121 |
],
|
| 122 |
}
|
| 123 |
)
|
| 124 |
+
elif self.config.schema == "seacrowd_kb":
|
| 125 |
features = schemas.kb_features
|
| 126 |
|
| 127 |
return datasets.DatasetInfo(
|
|
|
|
| 209 |
}
|
| 210 |
yield index, row
|
| 211 |
|
| 212 |
+
elif self.config.schema == "seacrowd_kb":
|
| 213 |
for index, example in enumerate(data):
|
| 214 |
passage, mentions = example["passage"], example["mentions"]
|
| 215 |
# Annotated text does not have any line breaks but the original passage does
|