holylovenia commited on
Commit
313dc39
·
verified ·
1 Parent(s): 8ff12e6

Upload indo_law.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. indo_law.py +12 -12
indo_law.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
  @article{nuranti2022predicting,
@@ -46,28 +46,28 @@ _SUPPORTED_TASKS = [Tasks.LEGAL_CLASSIFICATION]
46
 
47
  _SOURCE_VERSION = "1.0.0"
48
 
49
- _NUSANTARA_VERSION = "1.0.0"
50
 
51
  class IndoLaw(datasets.GeneratorBasedBuilder):
52
 
53
  SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
54
- NUSANTARA_VERSION = datasets.Version(_NUSANTARA_VERSION)
55
 
56
  _LABELS = ["pidana-khusus", "pidana-umum"]
57
 
58
  BUILDER_CONFIGS = [
59
- NusantaraConfig(
60
  name="indo_law_source",
61
  version=SOURCE_VERSION,
62
  description="Indo-Law source schema",
63
  schema="source",
64
  subset_id="indo_law",
65
  ),
66
- NusantaraConfig(
67
- name="indo_law_nusantara_text",
68
- version=NUSANTARA_VERSION,
69
  description="Indo-Law Nusantara schema",
70
- schema="nusantara_text",
71
  subset_id="indo_law",
72
  ),
73
  ]
@@ -89,7 +89,7 @@ class IndoLaw(datasets.GeneratorBasedBuilder):
89
  }
90
  )
91
 
92
- elif self.config.schema == "nusantara_text":
93
  features = schemas.text_features(self._LABELS)
94
 
95
  return datasets.DatasetInfo(
@@ -142,7 +142,7 @@ class IndoLaw(datasets.GeneratorBasedBuilder):
142
  yield key, example
143
  key+=1
144
 
145
- elif self.config.schema == "nusantara_text":
146
  key = 0
147
  for result in results:
148
  example = {
 
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
  @article{nuranti2022predicting,
 
46
 
47
  _SOURCE_VERSION = "1.0.0"
48
 
49
+ _SEACROWD_VERSION = "2024.06.20"
50
 
51
  class IndoLaw(datasets.GeneratorBasedBuilder):
52
 
53
  SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
54
+ SEACROWD_VERSION = datasets.Version(_SEACROWD_VERSION)
55
 
56
  _LABELS = ["pidana-khusus", "pidana-umum"]
57
 
58
  BUILDER_CONFIGS = [
59
+ SEACrowdConfig(
60
  name="indo_law_source",
61
  version=SOURCE_VERSION,
62
  description="Indo-Law source schema",
63
  schema="source",
64
  subset_id="indo_law",
65
  ),
66
+ SEACrowdConfig(
67
+ name="indo_law_seacrowd_text",
68
+ version=SEACROWD_VERSION,
69
  description="Indo-Law Nusantara schema",
70
+ schema="seacrowd_text",
71
  subset_id="indo_law",
72
  ),
73
  ]
 
89
  }
90
  )
91
 
92
+ elif self.config.schema == "seacrowd_text":
93
  features = schemas.text_features(self._LABELS)
94
 
95
  return datasets.DatasetInfo(
 
142
  yield key, example
143
  key+=1
144
 
145
+ elif self.config.schema == "seacrowd_text":
146
  key = 0
147
  for result in results:
148
  example = {