holylovenia commited on
Commit
9c5d078
1 Parent(s): f2c8d55

Upload jadi_ide.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. jadi_ide.py +12 -12
jadi_ide.py CHANGED
@@ -4,9 +4,9 @@ from typing import Dict, List, Tuple
4
  import datasets
5
  import pandas as pd
6
 
7
- from nusacrowd.utils import schemas
8
- from nusacrowd.utils.configs import NusantaraConfig
9
- from nusacrowd.utils.constants import Tasks
10
 
11
  _CITATION = """\
12
  @article{hidayatullah2020attention,
@@ -37,7 +37,7 @@ _URLS = {
37
  # TODO check supported tasks
38
  _SUPPORTED_TASKS = [Tasks.EMOTION_CLASSIFICATION]
39
  _SOURCE_VERSION = "1.0.0"
40
- _NUSANTARA_VERSION = "1.0.0"
41
 
42
 
43
  class JaDi_Ide(datasets.GeneratorBasedBuilder):
@@ -45,21 +45,21 @@ class JaDi_Ide(datasets.GeneratorBasedBuilder):
45
  data samples."""
46
 
47
  SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
48
- NUSANTARA_VERSION = datasets.Version(_NUSANTARA_VERSION)
49
 
50
  BUILDER_CONFIGS = [
51
- NusantaraConfig(
52
  name="jadi_ide_source",
53
  version=SOURCE_VERSION,
54
  description="JaDi-Ide source schema",
55
  schema="source",
56
  subset_id="jadi_ide",
57
  ),
58
- NusantaraConfig(
59
- name="jadi_ide_nusantara_text",
60
- version=NUSANTARA_VERSION,
61
  description="JaDi-Ide Nusantara schema",
62
- schema="nusantara_text",
63
  subset_id="jadi_ide",
64
  ),
65
  ]
@@ -75,7 +75,7 @@ class JaDi_Ide(datasets.GeneratorBasedBuilder):
75
  "label": datasets.Value("string")
76
  }
77
  )
78
- elif self.config.schema == "nusantara_text":
79
  features = schemas.text_features(["Jawa Timur", "Jawa Standar", "Jawa Ngapak"])
80
 
81
 
@@ -118,7 +118,7 @@ class JaDi_Ide(datasets.GeneratorBasedBuilder):
118
  }
119
  yield idx, ex
120
 
121
- elif self.config.schema == "nusantara_text":
122
  for idx, row in enumerate(df.itertuples()):
123
  ex = {
124
  "id": str(idx),
 
4
  import datasets
5
  import pandas as pd
6
 
7
+ from seacrowd.utils import schemas
8
+ from seacrowd.utils.configs import SEACrowdConfig
9
+ from seacrowd.utils.constants import Tasks
10
 
11
  _CITATION = """\
12
  @article{hidayatullah2020attention,
 
37
  # TODO check supported tasks
38
  _SUPPORTED_TASKS = [Tasks.EMOTION_CLASSIFICATION]
39
  _SOURCE_VERSION = "1.0.0"
40
+ _SEACROWD_VERSION = "2024.06.20"
41
 
42
 
43
  class JaDi_Ide(datasets.GeneratorBasedBuilder):
 
45
  data samples."""
46
 
47
  SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
48
+ SEACROWD_VERSION = datasets.Version(_SEACROWD_VERSION)
49
 
50
  BUILDER_CONFIGS = [
51
+ SEACrowdConfig(
52
  name="jadi_ide_source",
53
  version=SOURCE_VERSION,
54
  description="JaDi-Ide source schema",
55
  schema="source",
56
  subset_id="jadi_ide",
57
  ),
58
+ SEACrowdConfig(
59
+ name="jadi_ide_seacrowd_text",
60
+ version=SEACROWD_VERSION,
61
  description="JaDi-Ide Nusantara schema",
62
+ schema="seacrowd_text",
63
  subset_id="jadi_ide",
64
  ),
65
  ]
 
75
  "label": datasets.Value("string")
76
  }
77
  )
78
+ elif self.config.schema == "seacrowd_text":
79
  features = schemas.text_features(["Jawa Timur", "Jawa Standar", "Jawa Ngapak"])
80
 
81
 
 
118
  }
119
  yield idx, ex
120
 
121
+ elif self.config.schema == "seacrowd_text":
122
  for idx, row in enumerate(df.itertuples()):
123
  ex = {
124
  "id": str(idx),