Datasets:
vr
commited on
Commit
·
03f0287
1
Parent(s):
d102db3
little change loading script
Browse files- law_area_prediction.py +8 -8
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 == "
|
46 |
return _URLS["sub"]
|
47 |
|
48 |
|
@@ -64,9 +64,9 @@ class CourtViewGeneration(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="
|
68 |
-
datasets.BuilderConfig(name="
|
69 |
-
datasets.BuilderConfig(name="criminal
|
70 |
]
|
71 |
|
72 |
DEFAULT_CONFIG_NAME = "main" # It's not mandatory to have a default configuration. Just use one if it make sense.
|
@@ -162,9 +162,9 @@ class CourtViewGeneration(datasets.GeneratorBasedBuilder):
|
|
162 |
|
163 |
def belongs_to_law_area(self, law_sub_area):
|
164 |
area_map = {
|
165 |
-
"
|
166 |
-
"
|
167 |
-
'criminal
|
168 |
}
|
169 |
if law_sub_area in area_map[self.config.name]:
|
170 |
return True
|
@@ -199,7 +199,7 @@ class CourtViewGeneration(datasets.GeneratorBasedBuilder):
|
|
199 |
"canton": data["canton"],
|
200 |
"region": data["region"]
|
201 |
}
|
202 |
-
if self.config.name == "
|
203 |
if self.belongs_to_law_area(data["label"]):
|
204 |
yield id, {
|
205 |
"decision_id": data["decision_id"],
|
|
|
42 |
def get_url(config_name):
|
43 |
if config_name == "main":
|
44 |
return _URLS["main"]
|
45 |
+
if config_name == "criminal" or config_name == "criminal" or config_name == "criminal":
|
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="criminal", version=VERSION, description="This dataset is for predicting the sub law areas of the public law"),
|
68 |
+
datasets.BuilderConfig(name="criminal", 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.
|
|
|
162 |
|
163 |
def belongs_to_law_area(self, law_sub_area):
|
164 |
area_map = {
|
165 |
+
"criminal": ['Tax', 'Urban Planning and Environmental', 'Expropriation', 'Public Administration', 'Other Fiscal'],
|
166 |
+
"criminal": ['Rental and Lease', 'Employment Contract', 'Bankruptcy', 'Family', 'Competition and Antitrust', 'Intellectual Property'],
|
167 |
+
'criminal': ['Substantive Criminal', 'Criminal Procedure']
|
168 |
}
|
169 |
if law_sub_area in area_map[self.config.name]:
|
170 |
return True
|
|
|
199 |
"canton": data["canton"],
|
200 |
"region": data["region"]
|
201 |
}
|
202 |
+
if self.config.name == "criminal" or self.config.name == "criminal" or self.config.name == "criminal":
|
203 |
if self.belongs_to_law_area(data["label"]):
|
204 |
yield id, {
|
205 |
"decision_id": data["decision_id"],
|