holylovenia commited on
Commit
76c4fcd
1 Parent(s): 974128d

Upload id_coreference_resolution.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. 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 nusacrowd.utils.constants import Tasks
5
- from nusacrowd.utils import schemas
6
 
7
  import datasets
8
  import json
9
  import xml.etree.ElementTree as ET
10
 
11
- from nusacrowd.utils.configs import NusantaraConfig
12
 
13
  _CITATION = """\
14
  @INPROCEEDINGS{8074648,
@@ -51,26 +51,26 @@ _SUPPORTED_TASKS = [Tasks.COREFERENCE_RESOLUTION]
51
 
52
  _SOURCE_VERSION = "1.0.0"
53
 
54
- _NUSANTARA_VERSION = "1.0.0"
55
 
56
  class IDCoreferenceResolution(datasets.GeneratorBasedBuilder):
57
 
58
  SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
59
- NUSANTARA_VERSION = datasets.Version(_NUSANTARA_VERSION)
60
 
61
  BUILDER_CONFIGS = [
62
- NusantaraConfig(
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
- NusantaraConfig(
70
- name="id_coreference_resolution_nusantara_kb",
71
- version=NUSANTARA_VERSION,
72
  description="ID Coreference Resolution Nusantara schema",
73
- schema="nusantara_kb",
74
  subset_id="id_coreference_resolution",
75
  ),
76
  ]
@@ -99,7 +99,7 @@ class IDCoreferenceResolution(datasets.GeneratorBasedBuilder):
99
  }
100
  )
101
 
102
- elif self.config.schema == "nusantara_kb":
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 == "nusantara_kb":
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": [],