holylovenia
commited on
Commit
•
76c4fcd
1
Parent(s):
974128d
Upload id_coreference_resolution.py with huggingface_hub
Browse files- id_coreference_resolution.py +12 -12
id_coreference_resolution.py
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
import os
|
2 |
from pathlib import Path
|
3 |
from typing import Dict, List, Tuple
|
4 |
-
from
|
5 |
-
from
|
6 |
|
7 |
import datasets
|
8 |
import json
|
9 |
import xml.etree.ElementTree as ET
|
10 |
|
11 |
-
from
|
12 |
|
13 |
_CITATION = """\
|
14 |
@INPROCEEDINGS{8074648,
|
@@ -51,26 +51,26 @@ _SUPPORTED_TASKS = [Tasks.COREFERENCE_RESOLUTION]
|
|
51 |
|
52 |
_SOURCE_VERSION = "1.0.0"
|
53 |
|
54 |
-
|
55 |
|
56 |
class IDCoreferenceResolution(datasets.GeneratorBasedBuilder):
|
57 |
|
58 |
SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
|
59 |
-
|
60 |
|
61 |
BUILDER_CONFIGS = [
|
62 |
-
|
63 |
name="id_coreference_resolution_source",
|
64 |
version=SOURCE_VERSION,
|
65 |
description="ID Coreference Resolution source schema",
|
66 |
schema="source",
|
67 |
subset_id="id_coreference_resolution",
|
68 |
),
|
69 |
-
|
70 |
-
name="
|
71 |
-
version=
|
72 |
description="ID Coreference Resolution Nusantara schema",
|
73 |
-
schema="
|
74 |
subset_id="id_coreference_resolution",
|
75 |
),
|
76 |
]
|
@@ -99,7 +99,7 @@ class IDCoreferenceResolution(datasets.GeneratorBasedBuilder):
|
|
99 |
}
|
100 |
)
|
101 |
|
102 |
-
elif self.config.schema == "
|
103 |
features = schemas.kb_features
|
104 |
|
105 |
return datasets.DatasetInfo(
|
@@ -179,7 +179,7 @@ class IDCoreferenceResolution(datasets.GeneratorBasedBuilder):
|
|
179 |
if self.config.schema == "source":
|
180 |
yield int(each_sentence.attrib["id"]), sentence
|
181 |
|
182 |
-
elif self.config.schema == "
|
183 |
ex = {
|
184 |
"id": each_sentence.attrib["id"],
|
185 |
"passages": [],
|
|
|
1 |
import os
|
2 |
from pathlib import Path
|
3 |
from typing import Dict, List, Tuple
|
4 |
+
from seacrowd.utils.constants import Tasks
|
5 |
+
from seacrowd.utils import schemas
|
6 |
|
7 |
import datasets
|
8 |
import json
|
9 |
import xml.etree.ElementTree as ET
|
10 |
|
11 |
+
from seacrowd.utils.configs import SEACrowdConfig
|
12 |
|
13 |
_CITATION = """\
|
14 |
@INPROCEEDINGS{8074648,
|
|
|
51 |
|
52 |
_SOURCE_VERSION = "1.0.0"
|
53 |
|
54 |
+
_SEACROWD_VERSION = "2024.06.20"
|
55 |
|
56 |
class IDCoreferenceResolution(datasets.GeneratorBasedBuilder):
|
57 |
|
58 |
SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
|
59 |
+
SEACROWD_VERSION = datasets.Version(_SEACROWD_VERSION)
|
60 |
|
61 |
BUILDER_CONFIGS = [
|
62 |
+
SEACrowdConfig(
|
63 |
name="id_coreference_resolution_source",
|
64 |
version=SOURCE_VERSION,
|
65 |
description="ID Coreference Resolution source schema",
|
66 |
schema="source",
|
67 |
subset_id="id_coreference_resolution",
|
68 |
),
|
69 |
+
SEACrowdConfig(
|
70 |
+
name="id_coreference_resolution_seacrowd_kb",
|
71 |
+
version=SEACROWD_VERSION,
|
72 |
description="ID Coreference Resolution Nusantara schema",
|
73 |
+
schema="seacrowd_kb",
|
74 |
subset_id="id_coreference_resolution",
|
75 |
),
|
76 |
]
|
|
|
99 |
}
|
100 |
)
|
101 |
|
102 |
+
elif self.config.schema == "seacrowd_kb":
|
103 |
features = schemas.kb_features
|
104 |
|
105 |
return datasets.DatasetInfo(
|
|
|
179 |
if self.config.schema == "source":
|
180 |
yield int(each_sentence.attrib["id"]), sentence
|
181 |
|
182 |
+
elif self.config.schema == "seacrowd_kb":
|
183 |
ex = {
|
184 |
"id": each_sentence.attrib["id"],
|
185 |
"passages": [],
|