Datasets:
rcds
/

Modalities:
Text
ArXiv:
Libraries:
Datasets
License:
vr commited on
Commit
1b01a66
·
1 Parent(s): 5706f36

changing to one sub area dataset

Browse files
Files changed (1) hide show
  1. swiss_law_area_prediction.py +3 -6
swiss_law_area_prediction.py CHANGED
@@ -42,7 +42,7 @@ _URLS = {
42
  def get_url(config_name):
43
  if config_name == "main":
44
  return _URLS["main"]
45
- if config_name == "public" or config_name == "civil" or config_name == "criminal":
46
  return _URLS["sub"]
47
 
48
 
@@ -64,9 +64,7 @@ class LawAreaPrediction(datasets.GeneratorBasedBuilder):
64
  # data = datasets.load_dataset('my_dataset', 'second_domain')
65
  BUILDER_CONFIGS = [
66
  datasets.BuilderConfig(name="main", version=VERSION, description="This part of my dataset covers the whole dataset"),
67
- datasets.BuilderConfig(name="public", version=VERSION, description="This dataset is for predicting the sub law areas of the public law"),
68
- datasets.BuilderConfig(name="civil", version=VERSION, description="This dataset is for predicting the sub law areas of the civil law"),
69
- datasets.BuilderConfig(name="criminal", version=VERSION, description="This dataset is for predicting the sub law areas of the criminal law"),
70
  ]
71
 
72
  DEFAULT_CONFIG_NAME = "main" # It's not mandatory to have a default configuration. Just use one if it make sense.
@@ -199,8 +197,7 @@ class LawAreaPrediction(datasets.GeneratorBasedBuilder):
199
  "canton": data["canton"],
200
  "region": data["region"]
201
  }
202
- if self.config.name == "public" or self.config.name == "civil" or self.config.name == "criminal":
203
- if self.belongs_to_law_area(data["label"]):
204
  yield id, {
205
  "decision_id": data["decision_id"],
206
  "facts": data["facts"],
 
42
  def get_url(config_name):
43
  if config_name == "main":
44
  return _URLS["main"]
45
+ if config_name == "sub_area":
46
  return _URLS["sub"]
47
 
48
 
 
64
  # data = datasets.load_dataset('my_dataset', 'second_domain')
65
  BUILDER_CONFIGS = [
66
  datasets.BuilderConfig(name="main", version=VERSION, description="This part of my dataset covers the whole dataset"),
67
+ datasets.BuilderConfig(name="sub_area", version=VERSION, description="This dataset is for predicting sub law areas"),
 
 
68
  ]
69
 
70
  DEFAULT_CONFIG_NAME = "main" # It's not mandatory to have a default configuration. Just use one if it make sense.
 
197
  "canton": data["canton"],
198
  "region": data["region"]
199
  }
200
+ if self.config.name == "sub_area":
 
201
  yield id, {
202
  "decision_id": data["decision_id"],
203
  "facts": data["facts"],