holylovenia commited on
Commit
ef647c9
·
verified ·
1 Parent(s): a41b445

Upload indotacos.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. indotacos.py +13 -13
indotacos.py CHANGED
@@ -3,9 +3,9 @@ from typing import List
3
 
4
  import datasets
5
 
6
- from nusacrowd.utils.configs import NusantaraConfig
7
- from nusacrowd.utils.constants import Tasks
8
- from nusacrowd.utils import schemas
9
 
10
  import pandas as pd
11
 
@@ -32,7 +32,7 @@ _HOMEPAGE = "https://www.kaggle.com/datasets/christianwbsn/indonesia-tax-court-v
32
  _LICENSE = "Creative Common Attribution Share-Alike 4.0 International"
33
 
34
  # For publicly available datasets you will most likely end up passing these URLs to dl_manager in _split_generators.
35
- # In most cases the URLs will be the same for the source and nusantara config.
36
  # However, if you need to access different files for each config you can have multiple entries in this dict.
37
  # This can be an arbitrarily nested dict/list of URLs (see below in `_split_generators` method)
38
  _URLS = {_DATASETNAME: {"indotacos": "https://huggingface.co/datasets/christianwbsn/indotacos/resolve/main/indonesia_tax_court_verdict.csv"}}
@@ -41,28 +41,28 @@ _SUPPORTED_TASKS = [Tasks.TAX_COURT_VERDICT]
41
 
42
  _SOURCE_VERSION = "1.0.0"
43
 
44
- _NUSANTARA_VERSION = "1.0.0"
45
 
46
 
47
  class IndoTacos(datasets.GeneratorBasedBuilder):
48
  """IndoTacos, an Indonesian Tax Court verdict summary containing 12283 tax court cases provided by perpajakan.ddtc.co.id."""
49
 
50
  SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
51
- NUSANTARA_VERSION = datasets.Version(_NUSANTARA_VERSION)
52
 
53
  BUILDER_CONFIGS = [
54
- NusantaraConfig(
55
  name="indotacos_source",
56
  version=SOURCE_VERSION,
57
  description="indotacos source schema",
58
  schema="source",
59
  subset_id="indotacos",
60
  ),
61
- NusantaraConfig(
62
- name="indotacos_nusantara_text",
63
- version=NUSANTARA_VERSION,
64
  description="IndoTacos Nusantara schema",
65
- schema="nusantara_text",
66
  subset_id="indotacos",
67
  ),
68
  ]
@@ -85,7 +85,7 @@ class IndoTacos(datasets.GeneratorBasedBuilder):
85
  "jenis_putusan": datasets.Value("string"),
86
  }
87
  )
88
- elif self.config.schema == "nusantara_text":
89
  features = schemas.text_features(self.labels)
90
 
91
  return datasets.DatasetInfo(
@@ -127,7 +127,7 @@ class IndoTacos(datasets.GeneratorBasedBuilder):
127
  }
128
  yield row_id, ex
129
  row_id += 1
130
- elif self.config.schema == "nusantara_text":
131
  row_id = 1
132
  for row in df.itertuples():
133
  ex = {
 
3
 
4
  import datasets
5
 
6
+ from seacrowd.utils.configs import SEACrowdConfig
7
+ from seacrowd.utils.constants import Tasks
8
+ from seacrowd.utils import schemas
9
 
10
  import pandas as pd
11
 
 
32
  _LICENSE = "Creative Common Attribution Share-Alike 4.0 International"
33
 
34
  # For publicly available datasets you will most likely end up passing these URLs to dl_manager in _split_generators.
35
+ # In most cases the URLs will be the same for the source and seacrowd config.
36
  # However, if you need to access different files for each config you can have multiple entries in this dict.
37
  # This can be an arbitrarily nested dict/list of URLs (see below in `_split_generators` method)
38
  _URLS = {_DATASETNAME: {"indotacos": "https://huggingface.co/datasets/christianwbsn/indotacos/resolve/main/indonesia_tax_court_verdict.csv"}}
 
41
 
42
  _SOURCE_VERSION = "1.0.0"
43
 
44
+ _SEACROWD_VERSION = "2024.06.20"
45
 
46
 
47
  class IndoTacos(datasets.GeneratorBasedBuilder):
48
  """IndoTacos, an Indonesian Tax Court verdict summary containing 12283 tax court cases provided by perpajakan.ddtc.co.id."""
49
 
50
  SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
51
+ SEACROWD_VERSION = datasets.Version(_SEACROWD_VERSION)
52
 
53
  BUILDER_CONFIGS = [
54
+ SEACrowdConfig(
55
  name="indotacos_source",
56
  version=SOURCE_VERSION,
57
  description="indotacos source schema",
58
  schema="source",
59
  subset_id="indotacos",
60
  ),
61
+ SEACrowdConfig(
62
+ name="indotacos_seacrowd_text",
63
+ version=SEACROWD_VERSION,
64
  description="IndoTacos Nusantara schema",
65
+ schema="seacrowd_text",
66
  subset_id="indotacos",
67
  ),
68
  ]
 
85
  "jenis_putusan": datasets.Value("string"),
86
  }
87
  )
88
+ elif self.config.schema == "seacrowd_text":
89
  features = schemas.text_features(self.labels)
90
 
91
  return datasets.DatasetInfo(
 
127
  }
128
  yield row_id, ex
129
  row_id += 1
130
+ elif self.config.schema == "seacrowd_text":
131
  row_id = 1
132
  for row in df.itertuples():
133
  ex = {