joelniklaus commited on
Commit
c990c74
1 Parent(s): 8f18f30

Update swiss judgment prediction (#5019)

Browse files

* updated swiss_judgment_prediction dataset with new data

* fixed some problems

* Update datasets/swiss_judgment_prediction/README.md

Co-authored-by: Albert Villanova del Moral <8515462+albertvillanova@users.noreply.github.com>

* simplified code

* ran make style

* simplified code

* updated dummy data and dataset card and simplified code

* added dummy_data and updated dataset_infos.json

* removed unnecessary variable

Co-authored-by: Albert Villanova del Moral <8515462+albertvillanova@users.noreply.github.com>

Commit from https://github.com/huggingface/datasets/commit/9ff1278226ee2f4239e3d78104dacb9851fce7c4

README.md CHANGED
@@ -8,6 +8,7 @@ language:
8
  - de
9
  - fr
10
  - it
 
11
  license:
12
  - cc-by-sa-4.0
13
  multilinguality:
@@ -74,6 +75,8 @@ Switzerland has four official languages with 3 languages (German, French and Ita
74
 
75
  ## Dataset Structure
76
 
 
 
77
  ### Data Instances
78
 
79
  **Multilingual use of the dataset**
@@ -124,7 +127,7 @@ dataset = load_dataset('swiss_judgment_prediction', 'de')
124
 
125
  **Multilingual use of the dataset**
126
 
127
- The following data fields are provided for documents (`train`, `dev`, `test`):
128
 
129
  `id`: (**int**) a unique identifier of the for the document \
130
  `year`: (**int**) the publication year \
@@ -139,7 +142,7 @@ The following data fields are provided for documents (`train`, `dev`, `test`):
139
 
140
  **Monolingual use of the dataset**
141
 
142
- The following data fields are provided for documents (`train`, `dev`, `test`):
143
 
144
  `id`: (**int**) a unique identifier of the for the document \
145
  `year`: (**int**) the publication year \
@@ -153,11 +156,16 @@ The following data fields are provided for documents (`train`, `dev`, `test`):
153
 
154
  ### Data Splits
155
 
156
- | Language | ISO code | Number of Documents (Training/Dev/Test) |
157
- | ---- | ---- | ---- |
158
- | German | **de** | 35'452 / 4'705 / 9'725
159
- | French | **fr** | 21'179 / 3'095 / 6'820
160
- Italian | **it** | 3'072 / 408 / 812
 
 
 
 
 
161
 
162
  ## Dataset Creation
163
 
8
  - de
9
  - fr
10
  - it
11
+ - en
12
  license:
13
  - cc-by-sa-4.0
14
  multilinguality:
75
 
76
  ## Dataset Structure
77
 
78
+ In version 2 we added machine translated data using [EasyNMT](https://github.com/UKPLab/EasyNMT) for all documents into German, French, Italian and English as an additional training set.
79
+
80
  ### Data Instances
81
 
82
  **Multilingual use of the dataset**
127
 
128
  **Multilingual use of the dataset**
129
 
130
+ The following data fields are provided for documents (`train`, `validation`, `test`):
131
 
132
  `id`: (**int**) a unique identifier of the for the document \
133
  `year`: (**int**) the publication year \
142
 
143
  **Monolingual use of the dataset**
144
 
145
+ The following data fields are provided for documents (`train`, `validation`, `test`):
146
 
147
  `id`: (**int**) a unique identifier of the for the document \
148
  `year`: (**int**) the publication year \
156
 
157
  ### Data Splits
158
 
159
+ | Language | Subset | Number of Documents (Training/Validation/Test) |
160
+ |------------|------------|------------------------------------------------|
161
+ | German | **de** | 35'452 / 4'705 / 9'725 |
162
+ | French | **fr** | 21'179 / 3'095 / 6'820 |
163
+ | Italian | **it** | 3'072 / 408 / 812 |
164
+ | All | **all** | 59'709 / 8'208 / 17'357 |
165
+ | MT German | **mt_de** | 24'251 / 0 / 0 |
166
+ | MT French | **mt_fr** | 38'524 / 0 / 0 |
167
+ | MT Italian | **mt_it** | 56'631 / 0 / 0 |
168
+ | MT All | **all+mt** | 238'818 / 8'208 / 17'357 |
169
 
170
  ## Dataset Creation
171
 
dataset_infos.json CHANGED
@@ -1 +1 @@
1
- {"de": {"description": "Swiss-Judgment-Prediction is a multilingual, diachronic dataset of 85K Swiss Federal Supreme Court (FSCS) cases annotated with\nthe respective binarized judgment outcome (approval/dismissal), posing a challenging text classification task. \nWe also provide additional metadata, i.e., the publication year, the legal area and the canton of origin per case, \nto promote robustness and fairness studies on the critical area of legal NLP. \n", "citation": "@InProceedings{niklaus-etal-2021-swiss,\n author = {Niklaus, Joel\n and Chalkidis, Ilias\n and St\u00fcrmer, Matthias},\n title = {Swiss-Court-Predict: A Multilingual Legal Judgment Prediction Benchmark},\n booktitle = {Proceedings of the 2021 Natural Legal Language Processing Workshop},\n year = {2021},\n location = {Punta Cana, Dominican Republic},\n}", "homepage": "https://github.com/JoelNiklaus/SwissCourtRulingCorpus", "license": "", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "year": {"dtype": "int32", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["dismissal", "approval"], "names_file": null, "id": null, "_type": "ClassLabel"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "region": {"dtype": "string", "id": null, "_type": "Value"}, "canton": {"dtype": "string", "id": null, "_type": "Value"}, "legal area": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "swiss_judgment_prediction", "config_name": "de", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 104022593, "num_examples": 35458, "dataset_name": "swiss_judgment_prediction"}, "test": {"name": "test", "num_bytes": 25988122, "num_examples": 9725, "dataset_name": "swiss_judgment_prediction"}, "validation": {"name": "validation", "num_bytes": 12098963, "num_examples": 4705, "dataset_name": "swiss_judgment_prediction"}}, "download_checksums": {"https://zenodo.org/record/5529712/files/train.jsonl": {"num_bytes": 234401262, "checksum": "191992c204ad10d76c2a08005f1cdd94531b531ba12f5ea889cec7cd94dbb232"}, "https://zenodo.org/record/5529712/files/test.jsonl": {"num_bytes": 68876958, "checksum": "3e7a6542cd061579599cd93ec4c3af48171f0f8c2331c81477e77fac253247c1"}, "https://zenodo.org/record/5529712/files/val.jsonl": {"num_bytes": 29157311, "checksum": "a395f523de0e536953ac3af7960243b7be90423183097a1856275fc694b6e415"}}, "download_size": 332435531, "post_processing_size": null, "dataset_size": 142109678, "size_in_bytes": 474545209}, "fr": {"description": "Swiss-Judgment-Prediction is a multilingual, diachronic dataset of 85K Swiss Federal Supreme Court (FSCS) cases annotated with\nthe respective binarized judgment outcome (approval/dismissal), posing a challenging text classification task. \nWe also provide additional metadata, i.e., the publication year, the legal area and the canton of origin per case, \nto promote robustness and fairness studies on the critical area of legal NLP. \n", "citation": "@InProceedings{niklaus-etal-2021-swiss,\n author = {Niklaus, Joel\n and Chalkidis, Ilias\n and St\u00fcrmer, Matthias},\n title = {Swiss-Court-Predict: A Multilingual Legal Judgment Prediction Benchmark},\n booktitle = {Proceedings of the 2021 Natural Legal Language Processing Workshop},\n year = {2021},\n location = {Punta Cana, Dominican Republic},\n}", "homepage": "https://github.com/JoelNiklaus/SwissCourtRulingCorpus", "license": "", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "year": {"dtype": "int32", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["dismissal", "approval"], "names_file": null, "id": null, "_type": "ClassLabel"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "region": {"dtype": "string", "id": null, "_type": "Value"}, "canton": {"dtype": "string", "id": null, "_type": "Value"}, "legal area": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "swiss_judgment_prediction", "config_name": "fr", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 96659764, "num_examples": 21179, "dataset_name": "swiss_judgment_prediction"}, "test": {"name": "test", "num_bytes": 33270639, "num_examples": 6820, "dataset_name": "swiss_judgment_prediction"}, "validation": {"name": "validation", "num_bytes": 13010259, "num_examples": 3095, "dataset_name": "swiss_judgment_prediction"}}, "download_checksums": {"https://zenodo.org/record/5529712/files/train.jsonl": {"num_bytes": 234401262, "checksum": "191992c204ad10d76c2a08005f1cdd94531b531ba12f5ea889cec7cd94dbb232"}, "https://zenodo.org/record/5529712/files/test.jsonl": {"num_bytes": 68876958, "checksum": "3e7a6542cd061579599cd93ec4c3af48171f0f8c2331c81477e77fac253247c1"}, "https://zenodo.org/record/5529712/files/val.jsonl": {"num_bytes": 29157311, "checksum": "a395f523de0e536953ac3af7960243b7be90423183097a1856275fc694b6e415"}}, "download_size": 332435531, "post_processing_size": null, "dataset_size": 142940662, "size_in_bytes": 475376193}, "it": {"description": "Swiss-Judgment-Prediction is a multilingual, diachronic dataset of 85K Swiss Federal Supreme Court (FSCS) cases annotated with\nthe respective binarized judgment outcome (approval/dismissal), posing a challenging text classification task. \nWe also provide additional metadata, i.e., the publication year, the legal area and the canton of origin per case, \nto promote robustness and fairness studies on the critical area of legal NLP. \n", "citation": "@InProceedings{niklaus-etal-2021-swiss,\n author = {Niklaus, Joel\n and Chalkidis, Ilias\n and St\u00fcrmer, Matthias},\n title = {Swiss-Court-Predict: A Multilingual Legal Judgment Prediction Benchmark},\n booktitle = {Proceedings of the 2021 Natural Legal Language Processing Workshop},\n year = {2021},\n location = {Punta Cana, Dominican Republic},\n}", "homepage": "https://github.com/JoelNiklaus/SwissCourtRulingCorpus", "license": "", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "year": {"dtype": "int32", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["dismissal", "approval"], "names_file": null, "id": null, "_type": "ClassLabel"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "region": {"dtype": "string", "id": null, "_type": "Value"}, "canton": {"dtype": "string", "id": null, "_type": "Value"}, "legal area": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "swiss_judgment_prediction", "config_name": "it", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 10752032, "num_examples": 3072, "dataset_name": "swiss_judgment_prediction"}, "test": {"name": "test", "num_bytes": 2469097, "num_examples": 812, "dataset_name": "swiss_judgment_prediction"}, "validation": {"name": "validation", "num_bytes": 1042715, "num_examples": 408, "dataset_name": "swiss_judgment_prediction"}}, "download_checksums": {"https://zenodo.org/record/5529712/files/train.jsonl": {"num_bytes": 234401262, "checksum": "191992c204ad10d76c2a08005f1cdd94531b531ba12f5ea889cec7cd94dbb232"}, "https://zenodo.org/record/5529712/files/test.jsonl": {"num_bytes": 68876958, "checksum": "3e7a6542cd061579599cd93ec4c3af48171f0f8c2331c81477e77fac253247c1"}, "https://zenodo.org/record/5529712/files/val.jsonl": {"num_bytes": 29157311, "checksum": "a395f523de0e536953ac3af7960243b7be90423183097a1856275fc694b6e415"}}, "download_size": 332435531, "post_processing_size": null, "dataset_size": 14263844, "size_in_bytes": 346699375}, "all_languages": {"description": "Swiss-Judgment-Prediction is a multilingual, diachronic dataset of 85K Swiss Federal Supreme Court (FSCS) cases annotated with\nthe respective binarized judgment outcome (approval/dismissal), posing a challenging text classification task. \nWe also provide additional metadata, i.e., the publication year, the legal area and the canton of origin per case, \nto promote robustness and fairness studies on the critical area of legal NLP. \n", "citation": "@InProceedings{niklaus-etal-2021-swiss,\n author = {Niklaus, Joel\n and Chalkidis, Ilias\n and St\u00fcrmer, Matthias},\n title = {Swiss-Court-Predict: A Multilingual Legal Judgment Prediction Benchmark},\n booktitle = {Proceedings of the 2021 Natural Legal Language Processing Workshop},\n year = {2021},\n location = {Punta Cana, Dominican Republic},\n}", "homepage": "https://github.com/JoelNiklaus/SwissCourtRulingCorpus", "license": "", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "year": {"dtype": "int32", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["dismissal", "approval"], "names_file": null, "id": null, "_type": "ClassLabel"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "region": {"dtype": "string", "id": null, "_type": "Value"}, "canton": {"dtype": "string", "id": null, "_type": "Value"}, "legal area": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "swiss_judgment_prediction", "config_name": "all_languages", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 211434349, "num_examples": 59709, "dataset_name": "swiss_judgment_prediction"}, "test": {"name": "test", "num_bytes": 61727838, "num_examples": 17357, "dataset_name": "swiss_judgment_prediction"}, "validation": {"name": "validation", "num_bytes": 26151897, "num_examples": 8208, "dataset_name": "swiss_judgment_prediction"}}, "download_checksums": {"https://zenodo.org/record/5529712/files/train.jsonl": {"num_bytes": 234401262, "checksum": "191992c204ad10d76c2a08005f1cdd94531b531ba12f5ea889cec7cd94dbb232"}, "https://zenodo.org/record/5529712/files/test.jsonl": {"num_bytes": 68876958, "checksum": "3e7a6542cd061579599cd93ec4c3af48171f0f8c2331c81477e77fac253247c1"}, "https://zenodo.org/record/5529712/files/val.jsonl": {"num_bytes": 29157311, "checksum": "a395f523de0e536953ac3af7960243b7be90423183097a1856275fc694b6e415"}}, "download_size": 332435531, "post_processing_size": null, "dataset_size": 299314084, "size_in_bytes": 631749615}}
1
+ {"de": {"description": "\nSwiss-Judgment-Prediction is a multilingual, diachronic dataset of 85K Swiss Federal Supreme Court (FSCS) cases annotated with the respective binarized judgment outcome (approval/dismissal), posing a challenging text classification task. We also provide additional metadata, i.e., the publication year, the legal area and the canton of origin per case, to promote robustness and fairness studies on the critical area of legal NLP.\n", "citation": "@InProceedings{niklaus-etal-2021-swiss,\n author = {Niklaus, Joel\n and Chalkidis, Ilias\n and St\u00fcrmer, Matthias},\n title = {Swiss-Court-Predict: A Multilingual Legal Judgment Prediction Benchmark},\n booktitle = {Proceedings of the 2021 Natural Legal Language Processing Workshop},\n year = {2021},\n location = {Punta Cana, Dominican Republic},\n}", "homepage": "https://github.com/JoelNiklaus/SwissCourtRulingCorpus", "license": "", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "year": {"dtype": "int32", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["dismissal", "approval"], "id": null, "_type": "ClassLabel"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "region": {"dtype": "string", "id": null, "_type": "Value"}, "canton": {"dtype": "string", "id": null, "_type": "Value"}, "legal area": {"dtype": "string", "id": null, "_type": "Value"}, "source_language": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "swiss_judgment_prediction", "config_name": "de", "version": {"version_str": "2.0.0", "description": "", "major": 2, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 104270719, "num_examples": 35458, "dataset_name": "swiss_judgment_prediction"}, "validation": {"name": "validation", "num_bytes": 12131878, "num_examples": 4705, "dataset_name": "swiss_judgment_prediction"}, "test": {"name": "test", "num_bytes": 26056177, "num_examples": 9725, "dataset_name": "swiss_judgment_prediction"}}, "download_checksums": {"https://zenodo.org/record/7109926/files/train.jsonl": {"num_bytes": 234401262, "checksum": "191992c204ad10d76c2a08005f1cdd94531b531ba12f5ea889cec7cd94dbb232"}, "https://zenodo.org/record/7109926/files/train_mt.jsonl": {"num_bytes": 667946800, "checksum": "f57b8998acba9ac4b06fef7bcb03b8718da7b1d61228efb06afb8088f057d80c"}, "https://zenodo.org/record/7109926/files/val.jsonl": {"num_bytes": 29157311, "checksum": "a395f523de0e536953ac3af7960243b7be90423183097a1856275fc694b6e415"}, "https://zenodo.org/record/7109926/files/test.jsonl": {"num_bytes": 68876958, "checksum": "3e7a6542cd061579599cd93ec4c3af48171f0f8c2331c81477e77fac253247c1"}}, "download_size": 1000382331, "post_processing_size": null, "dataset_size": 142458774, "size_in_bytes": 1142841105}, "fr": {"description": "\nSwiss-Judgment-Prediction is a multilingual, diachronic dataset of 85K Swiss Federal Supreme Court (FSCS) cases annotated with the respective binarized judgment outcome (approval/dismissal), posing a challenging text classification task. We also provide additional metadata, i.e., the publication year, the legal area and the canton of origin per case, to promote robustness and fairness studies on the critical area of legal NLP.\n", "citation": "@InProceedings{niklaus-etal-2021-swiss,\n author = {Niklaus, Joel\n and Chalkidis, Ilias\n and St\u00fcrmer, Matthias},\n title = {Swiss-Court-Predict: A Multilingual Legal Judgment Prediction Benchmark},\n booktitle = {Proceedings of the 2021 Natural Legal Language Processing Workshop},\n year = {2021},\n location = {Punta Cana, Dominican Republic},\n}", "homepage": "https://github.com/JoelNiklaus/SwissCourtRulingCorpus", "license": "", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "year": {"dtype": "int32", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["dismissal", "approval"], "id": null, "_type": "ClassLabel"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "region": {"dtype": "string", "id": null, "_type": "Value"}, "canton": {"dtype": "string", "id": null, "_type": "Value"}, "legal area": {"dtype": "string", "id": null, "_type": "Value"}, "source_language": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "swiss_judgment_prediction", "config_name": "fr", "version": {"version_str": "2.0.0", "description": "", "major": 2, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 96807957, "num_examples": 21179, "dataset_name": "swiss_judgment_prediction"}, "validation": {"name": "validation", "num_bytes": 13031904, "num_examples": 3095, "dataset_name": "swiss_judgment_prediction"}, "test": {"name": "test", "num_bytes": 33318359, "num_examples": 6820, "dataset_name": "swiss_judgment_prediction"}}, "download_checksums": {"https://zenodo.org/record/7109926/files/train.jsonl": {"num_bytes": 234401262, "checksum": "191992c204ad10d76c2a08005f1cdd94531b531ba12f5ea889cec7cd94dbb232"}, "https://zenodo.org/record/7109926/files/train_mt.jsonl": {"num_bytes": 667946800, "checksum": "f57b8998acba9ac4b06fef7bcb03b8718da7b1d61228efb06afb8088f057d80c"}, "https://zenodo.org/record/7109926/files/val.jsonl": {"num_bytes": 29157311, "checksum": "a395f523de0e536953ac3af7960243b7be90423183097a1856275fc694b6e415"}, "https://zenodo.org/record/7109926/files/test.jsonl": {"num_bytes": 68876958, "checksum": "3e7a6542cd061579599cd93ec4c3af48171f0f8c2331c81477e77fac253247c1"}}, "download_size": 1000382331, "post_processing_size": null, "dataset_size": 143158220, "size_in_bytes": 1143540551}, "it": {"description": "\nSwiss-Judgment-Prediction is a multilingual, diachronic dataset of 85K Swiss Federal Supreme Court (FSCS) cases annotated with the respective binarized judgment outcome (approval/dismissal), posing a challenging text classification task. We also provide additional metadata, i.e., the publication year, the legal area and the canton of origin per case, to promote robustness and fairness studies on the critical area of legal NLP.\n", "citation": "@InProceedings{niklaus-etal-2021-swiss,\n author = {Niklaus, Joel\n and Chalkidis, Ilias\n and St\u00fcrmer, Matthias},\n title = {Swiss-Court-Predict: A Multilingual Legal Judgment Prediction Benchmark},\n booktitle = {Proceedings of the 2021 Natural Legal Language Processing Workshop},\n year = {2021},\n location = {Punta Cana, Dominican Republic},\n}", "homepage": "https://github.com/JoelNiklaus/SwissCourtRulingCorpus", "license": "", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "year": {"dtype": "int32", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["dismissal", "approval"], "id": null, "_type": "ClassLabel"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "region": {"dtype": "string", "id": null, "_type": "Value"}, "canton": {"dtype": "string", "id": null, "_type": "Value"}, "legal area": {"dtype": "string", "id": null, "_type": "Value"}, "source_language": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "swiss_judgment_prediction", "config_name": "it", "version": {"version_str": "2.0.0", "description": "", "major": 2, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 10773516, "num_examples": 3072, "dataset_name": "swiss_judgment_prediction"}, "validation": {"name": "validation", "num_bytes": 1045551, "num_examples": 408, "dataset_name": "swiss_judgment_prediction"}, "test": {"name": "test", "num_bytes": 2474761, "num_examples": 812, "dataset_name": "swiss_judgment_prediction"}}, "download_checksums": {"https://zenodo.org/record/7109926/files/train.jsonl": {"num_bytes": 234401262, "checksum": "191992c204ad10d76c2a08005f1cdd94531b531ba12f5ea889cec7cd94dbb232"}, "https://zenodo.org/record/7109926/files/train_mt.jsonl": {"num_bytes": 667946800, "checksum": "f57b8998acba9ac4b06fef7bcb03b8718da7b1d61228efb06afb8088f057d80c"}, "https://zenodo.org/record/7109926/files/val.jsonl": {"num_bytes": 29157311, "checksum": "a395f523de0e536953ac3af7960243b7be90423183097a1856275fc694b6e415"}, "https://zenodo.org/record/7109926/files/test.jsonl": {"num_bytes": 68876958, "checksum": "3e7a6542cd061579599cd93ec4c3af48171f0f8c2331c81477e77fac253247c1"}}, "download_size": 1000382331, "post_processing_size": null, "dataset_size": 14293828, "size_in_bytes": 1014676159}, "mt_de": {"description": "\nSwiss-Judgment-Prediction is a multilingual, diachronic dataset of 85K Swiss Federal Supreme Court (FSCS) cases annotated with the respective binarized judgment outcome (approval/dismissal), posing a challenging text classification task. We also provide additional metadata, i.e., the publication year, the legal area and the canton of origin per case, to promote robustness and fairness studies on the critical area of legal NLP.\n", "citation": "@InProceedings{niklaus-etal-2021-swiss,\n author = {Niklaus, Joel\n and Chalkidis, Ilias\n and St\u00fcrmer, Matthias},\n title = {Swiss-Court-Predict: A Multilingual Legal Judgment Prediction Benchmark},\n booktitle = {Proceedings of the 2021 Natural Legal Language Processing Workshop},\n year = {2021},\n location = {Punta Cana, Dominican Republic},\n}", "homepage": "https://github.com/JoelNiklaus/SwissCourtRulingCorpus", "license": "", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "year": {"dtype": "int32", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["dismissal", "approval"], "id": null, "_type": "ClassLabel"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "region": {"dtype": "string", "id": null, "_type": "Value"}, "canton": {"dtype": "string", "id": null, "_type": "Value"}, "legal area": {"dtype": "string", "id": null, "_type": "Value"}, "source_language": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "swiss_judgment_prediction", "config_name": "mt_de", "version": {"version_str": "2.0.0", "description": "", "major": 2, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 106990696, "num_examples": 24251, "dataset_name": "swiss_judgment_prediction"}, "validation": {"name": "validation", "num_bytes": 0, "num_examples": 0, "dataset_name": "swiss_judgment_prediction"}, "test": {"name": "test", "num_bytes": 0, "num_examples": 0, "dataset_name": "swiss_judgment_prediction"}}, "download_checksums": {"https://zenodo.org/record/7109926/files/train.jsonl": {"num_bytes": 234401262, "checksum": "191992c204ad10d76c2a08005f1cdd94531b531ba12f5ea889cec7cd94dbb232"}, "https://zenodo.org/record/7109926/files/train_mt.jsonl": {"num_bytes": 667946800, "checksum": "f57b8998acba9ac4b06fef7bcb03b8718da7b1d61228efb06afb8088f057d80c"}, "https://zenodo.org/record/7109926/files/val.jsonl": {"num_bytes": 29157311, "checksum": "a395f523de0e536953ac3af7960243b7be90423183097a1856275fc694b6e415"}, "https://zenodo.org/record/7109926/files/test.jsonl": {"num_bytes": 68876958, "checksum": "3e7a6542cd061579599cd93ec4c3af48171f0f8c2331c81477e77fac253247c1"}}, "download_size": 1000382331, "post_processing_size": null, "dataset_size": 106990696, "size_in_bytes": 1107373027}, "mt_fr": {"description": "\nSwiss-Judgment-Prediction is a multilingual, diachronic dataset of 85K Swiss Federal Supreme Court (FSCS) cases annotated with the respective binarized judgment outcome (approval/dismissal), posing a challenging text classification task. We also provide additional metadata, i.e., the publication year, the legal area and the canton of origin per case, to promote robustness and fairness studies on the critical area of legal NLP.\n", "citation": "@InProceedings{niklaus-etal-2021-swiss,\n author = {Niklaus, Joel\n and Chalkidis, Ilias\n and St\u00fcrmer, Matthias},\n title = {Swiss-Court-Predict: A Multilingual Legal Judgment Prediction Benchmark},\n booktitle = {Proceedings of the 2021 Natural Legal Language Processing Workshop},\n year = {2021},\n location = {Punta Cana, Dominican Republic},\n}", "homepage": "https://github.com/JoelNiklaus/SwissCourtRulingCorpus", "license": "", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "year": {"dtype": "int32", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["dismissal", "approval"], "id": null, "_type": "ClassLabel"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "region": {"dtype": "string", "id": null, "_type": "Value"}, "canton": {"dtype": "string", "id": null, "_type": "Value"}, "legal area": {"dtype": "string", "id": null, "_type": "Value"}, "source_language": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "swiss_judgment_prediction", "config_name": "mt_fr", "version": {"version_str": "2.0.0", "description": "", "major": 2, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 117932134, "num_examples": 38524, "dataset_name": "swiss_judgment_prediction"}, "validation": {"name": "validation", "num_bytes": 0, "num_examples": 0, "dataset_name": "swiss_judgment_prediction"}, "test": {"name": "test", "num_bytes": 0, "num_examples": 0, "dataset_name": "swiss_judgment_prediction"}}, "download_checksums": {"https://zenodo.org/record/7109926/files/train.jsonl": {"num_bytes": 234401262, "checksum": "191992c204ad10d76c2a08005f1cdd94531b531ba12f5ea889cec7cd94dbb232"}, "https://zenodo.org/record/7109926/files/train_mt.jsonl": {"num_bytes": 667946800, "checksum": "f57b8998acba9ac4b06fef7bcb03b8718da7b1d61228efb06afb8088f057d80c"}, "https://zenodo.org/record/7109926/files/val.jsonl": {"num_bytes": 29157311, "checksum": "a395f523de0e536953ac3af7960243b7be90423183097a1856275fc694b6e415"}, "https://zenodo.org/record/7109926/files/test.jsonl": {"num_bytes": 68876958, "checksum": "3e7a6542cd061579599cd93ec4c3af48171f0f8c2331c81477e77fac253247c1"}}, "download_size": 1000382331, "post_processing_size": null, "dataset_size": 117932134, "size_in_bytes": 1118314465}, "mt_it": {"description": "\nSwiss-Judgment-Prediction is a multilingual, diachronic dataset of 85K Swiss Federal Supreme Court (FSCS) cases annotated with the respective binarized judgment outcome (approval/dismissal), posing a challenging text classification task. We also provide additional metadata, i.e., the publication year, the legal area and the canton of origin per case, to promote robustness and fairness studies on the critical area of legal NLP.\n", "citation": "@InProceedings{niklaus-etal-2021-swiss,\n author = {Niklaus, Joel\n and Chalkidis, Ilias\n and St\u00fcrmer, Matthias},\n title = {Swiss-Court-Predict: A Multilingual Legal Judgment Prediction Benchmark},\n booktitle = {Proceedings of the 2021 Natural Legal Language Processing Workshop},\n year = {2021},\n location = {Punta Cana, Dominican Republic},\n}", "homepage": "https://github.com/JoelNiklaus/SwissCourtRulingCorpus", "license": "", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "year": {"dtype": "int32", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["dismissal", "approval"], "id": null, "_type": "ClassLabel"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "region": {"dtype": "string", "id": null, "_type": "Value"}, "canton": {"dtype": "string", "id": null, "_type": "Value"}, "legal area": {"dtype": "string", "id": null, "_type": "Value"}, "source_language": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "swiss_judgment_prediction", "config_name": "mt_it", "version": {"version_str": "2.0.0", "description": "", "major": 2, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 201749076, "num_examples": 56631, "dataset_name": "swiss_judgment_prediction"}, "validation": {"name": "validation", "num_bytes": 0, "num_examples": 0, "dataset_name": "swiss_judgment_prediction"}, "test": {"name": "test", "num_bytes": 0, "num_examples": 0, "dataset_name": "swiss_judgment_prediction"}}, "download_checksums": {"https://zenodo.org/record/7109926/files/train.jsonl": {"num_bytes": 234401262, "checksum": "191992c204ad10d76c2a08005f1cdd94531b531ba12f5ea889cec7cd94dbb232"}, "https://zenodo.org/record/7109926/files/train_mt.jsonl": {"num_bytes": 667946800, "checksum": "f57b8998acba9ac4b06fef7bcb03b8718da7b1d61228efb06afb8088f057d80c"}, "https://zenodo.org/record/7109926/files/val.jsonl": {"num_bytes": 29157311, "checksum": "a395f523de0e536953ac3af7960243b7be90423183097a1856275fc694b6e415"}, "https://zenodo.org/record/7109926/files/test.jsonl": {"num_bytes": 68876958, "checksum": "3e7a6542cd061579599cd93ec4c3af48171f0f8c2331c81477e77fac253247c1"}}, "download_size": 1000382331, "post_processing_size": null, "dataset_size": 201749076, "size_in_bytes": 1202131407}, "mt_en": {"description": "\nSwiss-Judgment-Prediction is a multilingual, diachronic dataset of 85K Swiss Federal Supreme Court (FSCS) cases annotated with the respective binarized judgment outcome (approval/dismissal), posing a challenging text classification task. We also provide additional metadata, i.e., the publication year, the legal area and the canton of origin per case, to promote robustness and fairness studies on the critical area of legal NLP.\n", "citation": "@InProceedings{niklaus-etal-2021-swiss,\n author = {Niklaus, Joel\n and Chalkidis, Ilias\n and St\u00fcrmer, Matthias},\n title = {Swiss-Court-Predict: A Multilingual Legal Judgment Prediction Benchmark},\n booktitle = {Proceedings of the 2021 Natural Legal Language Processing Workshop},\n year = {2021},\n location = {Punta Cana, Dominican Republic},\n}", "homepage": "https://github.com/JoelNiklaus/SwissCourtRulingCorpus", "license": "", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "year": {"dtype": "int32", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["dismissal", "approval"], "id": null, "_type": "ClassLabel"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "region": {"dtype": "string", "id": null, "_type": "Value"}, "canton": {"dtype": "string", "id": null, "_type": "Value"}, "legal area": {"dtype": "string", "id": null, "_type": "Value"}, "source_language": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "swiss_judgment_prediction", "config_name": "mt_en", "version": {"version_str": "2.0.0", "description": "", "major": 2, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 196352783, "num_examples": 59703, "dataset_name": "swiss_judgment_prediction"}, "validation": {"name": "validation", "num_bytes": 0, "num_examples": 0, "dataset_name": "swiss_judgment_prediction"}, "test": {"name": "test", "num_bytes": 0, "num_examples": 0, "dataset_name": "swiss_judgment_prediction"}}, "download_checksums": {"https://zenodo.org/record/7109926/files/train.jsonl": {"num_bytes": 234401262, "checksum": "191992c204ad10d76c2a08005f1cdd94531b531ba12f5ea889cec7cd94dbb232"}, "https://zenodo.org/record/7109926/files/train_mt.jsonl": {"num_bytes": 667946800, "checksum": "f57b8998acba9ac4b06fef7bcb03b8718da7b1d61228efb06afb8088f057d80c"}, "https://zenodo.org/record/7109926/files/val.jsonl": {"num_bytes": 29157311, "checksum": "a395f523de0e536953ac3af7960243b7be90423183097a1856275fc694b6e415"}, "https://zenodo.org/record/7109926/files/test.jsonl": {"num_bytes": 68876958, "checksum": "3e7a6542cd061579599cd93ec4c3af48171f0f8c2331c81477e77fac253247c1"}}, "download_size": 1000382331, "post_processing_size": null, "dataset_size": 196352783, "size_in_bytes": 1196735114}, "all": {"description": "\nSwiss-Judgment-Prediction is a multilingual, diachronic dataset of 85K Swiss Federal Supreme Court (FSCS) cases annotated with the respective binarized judgment outcome (approval/dismissal), posing a challenging text classification task. We also provide additional metadata, i.e., the publication year, the legal area and the canton of origin per case, to promote robustness and fairness studies on the critical area of legal NLP.\n", "citation": "@InProceedings{niklaus-etal-2021-swiss,\n author = {Niklaus, Joel\n and Chalkidis, Ilias\n and St\u00fcrmer, Matthias},\n title = {Swiss-Court-Predict: A Multilingual Legal Judgment Prediction Benchmark},\n booktitle = {Proceedings of the 2021 Natural Legal Language Processing Workshop},\n year = {2021},\n location = {Punta Cana, Dominican Republic},\n}", "homepage": "https://github.com/JoelNiklaus/SwissCourtRulingCorpus", "license": "", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "year": {"dtype": "int32", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["dismissal", "approval"], "id": null, "_type": "ClassLabel"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "region": {"dtype": "string", "id": null, "_type": "Value"}, "canton": {"dtype": "string", "id": null, "_type": "Value"}, "legal area": {"dtype": "string", "id": null, "_type": "Value"}, "source_language": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "swiss_judgment_prediction", "config_name": "all", "version": {"version_str": "2.0.0", "description": "", "major": 2, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 211852192, "num_examples": 59709, "dataset_name": "swiss_judgment_prediction"}, "validation": {"name": "validation", "num_bytes": 26209333, "num_examples": 8208, "dataset_name": "swiss_judgment_prediction"}, "test": {"name": "test", "num_bytes": 61849297, "num_examples": 17357, "dataset_name": "swiss_judgment_prediction"}}, "download_checksums": {"https://zenodo.org/record/7109926/files/train.jsonl": {"num_bytes": 234401262, "checksum": "191992c204ad10d76c2a08005f1cdd94531b531ba12f5ea889cec7cd94dbb232"}, "https://zenodo.org/record/7109926/files/train_mt.jsonl": {"num_bytes": 667946800, "checksum": "f57b8998acba9ac4b06fef7bcb03b8718da7b1d61228efb06afb8088f057d80c"}, "https://zenodo.org/record/7109926/files/val.jsonl": {"num_bytes": 29157311, "checksum": "a395f523de0e536953ac3af7960243b7be90423183097a1856275fc694b6e415"}, "https://zenodo.org/record/7109926/files/test.jsonl": {"num_bytes": 68876958, "checksum": "3e7a6542cd061579599cd93ec4c3af48171f0f8c2331c81477e77fac253247c1"}}, "download_size": 1000382331, "post_processing_size": null, "dataset_size": 299910822, "size_in_bytes": 1300293153}, "all+mt": {"description": "\nSwiss-Judgment-Prediction is a multilingual, diachronic dataset of 85K Swiss Federal Supreme Court (FSCS) cases annotated with the respective binarized judgment outcome (approval/dismissal), posing a challenging text classification task. We also provide additional metadata, i.e., the publication year, the legal area and the canton of origin per case, to promote robustness and fairness studies on the critical area of legal NLP.\n", "citation": "@InProceedings{niklaus-etal-2021-swiss,\n author = {Niklaus, Joel\n and Chalkidis, Ilias\n and St\u00fcrmer, Matthias},\n title = {Swiss-Court-Predict: A Multilingual Legal Judgment Prediction Benchmark},\n booktitle = {Proceedings of the 2021 Natural Legal Language Processing Workshop},\n year = {2021},\n location = {Punta Cana, Dominican Republic},\n}", "homepage": "https://github.com/JoelNiklaus/SwissCourtRulingCorpus", "license": "", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "year": {"dtype": "int32", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["dismissal", "approval"], "id": null, "_type": "ClassLabel"}, "language": {"dtype": "string", "id": null, "_type": "Value"}, "region": {"dtype": "string", "id": null, "_type": "Value"}, "canton": {"dtype": "string", "id": null, "_type": "Value"}, "legal area": {"dtype": "string", "id": null, "_type": "Value"}, "source_language": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "swiss_judgment_prediction", "config_name": "all+mt", "version": {"version_str": "2.0.0", "description": "", "major": 2, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 834876881, "num_examples": 238818, "dataset_name": "swiss_judgment_prediction"}, "validation": {"name": "validation", "num_bytes": 26209333, "num_examples": 8208, "dataset_name": "swiss_judgment_prediction"}, "test": {"name": "test", "num_bytes": 61849297, "num_examples": 17357, "dataset_name": "swiss_judgment_prediction"}}, "download_checksums": {"https://zenodo.org/record/7109926/files/train.jsonl": {"num_bytes": 234401262, "checksum": "191992c204ad10d76c2a08005f1cdd94531b531ba12f5ea889cec7cd94dbb232"}, "https://zenodo.org/record/7109926/files/train_mt.jsonl": {"num_bytes": 667946800, "checksum": "f57b8998acba9ac4b06fef7bcb03b8718da7b1d61228efb06afb8088f057d80c"}, "https://zenodo.org/record/7109926/files/val.jsonl": {"num_bytes": 29157311, "checksum": "a395f523de0e536953ac3af7960243b7be90423183097a1856275fc694b6e415"}, "https://zenodo.org/record/7109926/files/test.jsonl": {"num_bytes": 68876958, "checksum": "3e7a6542cd061579599cd93ec4c3af48171f0f8c2331c81477e77fac253247c1"}}, "download_size": 1000382331, "post_processing_size": null, "dataset_size": 922935511, "size_in_bytes": 1923317842}}
dummy/{all_languages/1.0.0 → all+mt/2.0.0}/dummy_data.zip RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:065dcb6ead752b189279d2082b34ad96e8499b57a261c6e77db7b02049edb755
3
- size 11676
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40781150ee4cbf7b759d75e7061f1ff889c9e3e2f7f971fc0b5c8e70e00726ba
3
+ size 27112
dummy/{de/1.0.0 → all/2.0.0}/dummy_data.zip RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e5fd6b04e5c9804664357d6929f8db046b61ce4e578ffa9dfe5dae8d501a6eb1
3
- size 5283
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0a4891a32a28da27c63678dbec7be568f7228102e3879ed3820ca1d1172de418
3
+ size 27112
dummy/{fr/1.0.0 → de/2.0.0}/dummy_data.zip RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e4081dbe49cc10caf72a9285274c12fa0b4088914c90e4149f5451230e521974
3
- size 5130
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:07f5c330d7741fb29f4ad77d41489a6b494b540a4a5acf7473fc37c199e3aaaa
3
+ size 27112
dummy/{it/1.0.0 → fr/2.0.0}/dummy_data.zip RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:05769bf13b52f08f34d87f2dc9f7c3ae7ab350e91f1449258db8269d31c2a667
3
- size 3453
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:799d02d1d694728dd61ab86ff71eff43b3315a9052ed3251cbfd79d83767dba5
3
+ size 27112
dummy/it/2.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4c17d49f768c7ed3297222632eb0a790dea79549c8a69f4479a5d130633443b6
3
+ size 27112
dummy/mt_de/2.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f5e321a06ede89b1c0ce46e78fd977e82f45da245de949a3aca91471bcd4ab83
3
+ size 27112
dummy/mt_en/2.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f3eb14d3ce1b7edd06f1ad6fecdcf4ce08f2b3d2b0df6e5ef680e3c8616aa4d7
3
+ size 27112
dummy/mt_fr/2.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2d40c4f36ba333b14a8666f4949905eae044ab00c192dc090398fc4ac92df74f
3
+ size 27112
dummy/mt_it/2.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:803ed0d6c037054d0dcdf9dee1cc16e412ed5768a3d62bf0b2188566f0e3daf9
3
+ size 27112
swiss_judgment_prediction.py CHANGED
@@ -36,58 +36,68 @@ _DESCRIPTION = """
36
  Swiss-Judgment-Prediction is a multilingual, diachronic dataset of 85K Swiss Federal Supreme Court (FSCS) cases annotated with the respective binarized judgment outcome (approval/dismissal), posing a challenging text classification task. We also provide additional metadata, i.e., the publication year, the legal area and the canton of origin per case, to promote robustness and fairness studies on the critical area of legal NLP.
37
  """
38
 
39
- _LANGUAGES = [
40
  "de",
41
  "fr",
42
  "it",
43
  ]
 
 
 
 
 
 
 
44
 
45
- _URL = "https://zenodo.org/record/5529712/files/"
46
  _URLS = {
47
  "train": _URL + "train.jsonl",
48
- "test": _URL + "test.jsonl",
49
  "val": _URL + "val.jsonl",
 
50
  }
51
 
52
 
53
  class SwissJudgmentPredictionConfig(datasets.BuilderConfig):
54
  """BuilderConfig for SwissJudgmentPrediction."""
55
 
56
- def __init__(self, language: str, languages=None, **kwargs):
57
  """BuilderConfig for SwissJudgmentPrediction.
58
 
59
  Args:
60
- language: One of de,fr,it, or all_languages
61
  **kwargs: keyword arguments forwarded to super.
62
  """
63
  super(SwissJudgmentPredictionConfig, self).__init__(**kwargs)
64
  self.language = language
65
- if language != "all_languages":
66
- self.languages = [language]
67
- else:
68
- self.languages = languages if languages is not None else _LANGUAGES
69
 
70
 
71
  class SwissJudgmentPrediction(datasets.GeneratorBasedBuilder):
72
  """SwissJudgmentPrediction: A Multilingual Legal Judgment PredictionBenchmark"""
73
 
74
- VERSION = datasets.Version("1.0.0", "")
75
  BUILDER_CONFIG_CLASS = SwissJudgmentPredictionConfig
76
  BUILDER_CONFIGS = [
77
  SwissJudgmentPredictionConfig(
78
  name=lang,
79
  language=lang,
80
- version=datasets.Version("1.0.0", ""),
81
  description=f"Plain text import of SwissJudgmentPrediction for the {lang} language",
82
  )
83
  for lang in _LANGUAGES
84
  ] + [
85
  SwissJudgmentPredictionConfig(
86
- name="all_languages",
87
- language="all_languages",
88
- version=datasets.Version("1.0.0", ""),
89
  description="Plain text import of SwissJudgmentPrediction for all languages",
90
- )
 
 
 
 
 
 
91
  ]
92
 
93
  def _info(self):
@@ -101,6 +111,7 @@ class SwissJudgmentPrediction(datasets.GeneratorBasedBuilder):
101
  "region": datasets.Value("string"),
102
  "canton": datasets.Value("string"),
103
  "legal area": datasets.Value("string"),
 
104
  }
105
  )
106
  return datasets.DatasetInfo(
@@ -114,61 +125,48 @@ class SwissJudgmentPrediction(datasets.GeneratorBasedBuilder):
114
  def _split_generators(self, dl_manager):
115
  # dl_manager is a datasets.download.DownloadManager that can be used to
116
  # download and extract URLs
117
- urls_to_dl = _URLS
118
  try:
119
- dl_dir = dl_manager.download_and_extract(urls_to_dl)
120
  except Exception:
121
  logger.warning(
122
- "This dataset is downloaded through Zenodo which is flaky. If this download failed try a few times before reporting an issue"
 
123
  )
124
  raise
125
  return [
126
  datasets.SplitGenerator(
127
  name=datasets.Split.TRAIN,
128
  # These kwargs will be passed to _generate_examples
129
- gen_kwargs={"filepath": dl_dir["train"], "split": "train"},
130
  ),
131
  datasets.SplitGenerator(
132
- name=datasets.Split.TEST,
133
  # These kwargs will be passed to _generate_examples
134
- gen_kwargs={"filepath": dl_dir["test"], "split": "test"},
135
  ),
136
  datasets.SplitGenerator(
137
- name=datasets.Split.VALIDATION,
138
  # These kwargs will be passed to _generate_examples
139
- gen_kwargs={"filepath": dl_dir["val"], "split": "dev"},
140
  ),
141
  ]
142
 
143
- def _generate_examples(self, filepath, split):
144
  """This function returns the examples in the raw (text) form."""
145
-
146
- if self.config.language == "all_languages":
147
- with open(filepath, encoding="utf-8") as f:
148
- for id_, row in enumerate(f):
149
- data = json.loads(row)
150
- yield id_, {
151
- "id": data["id"],
152
- "year": data["year"],
153
- "text": data["text"],
154
- "label": data["label"],
155
- "language": data["language"],
156
- "region": data["region"],
157
- "canton": data["canton"],
158
- "legal area": data["legal area"],
159
- }
160
- else:
161
  with open(filepath, encoding="utf-8") as f:
162
  for id_, row in enumerate(f):
163
  data = json.loads(row)
164
- if data["language"] == self.config.language:
165
- yield id_, {
166
- "id": data["id"],
167
- "year": data["year"],
168
- "text": data["text"],
169
- "label": data["label"],
170
- "language": data["language"],
171
- "region": data["region"],
172
- "canton": data["canton"],
173
- "legal area": data["legal area"],
174
- }
 
 
36
  Swiss-Judgment-Prediction is a multilingual, diachronic dataset of 85K Swiss Federal Supreme Court (FSCS) cases annotated with the respective binarized judgment outcome (approval/dismissal), posing a challenging text classification task. We also provide additional metadata, i.e., the publication year, the legal area and the canton of origin per case, to promote robustness and fairness studies on the critical area of legal NLP.
37
  """
38
 
39
+ _ORIGINAL_LANGUAGES = [
40
  "de",
41
  "fr",
42
  "it",
43
  ]
44
+ _MT_LANGUAGES = [
45
+ "mt_de",
46
+ "mt_fr",
47
+ "mt_it",
48
+ "mt_en",
49
+ ]
50
+ _LANGUAGES = _ORIGINAL_LANGUAGES + _MT_LANGUAGES
51
 
52
+ _URL = "https://zenodo.org/record/7109926/files/"
53
  _URLS = {
54
  "train": _URL + "train.jsonl",
55
+ "train_mt": _URL + "train_mt.jsonl",
56
  "val": _URL + "val.jsonl",
57
+ "test": _URL + "test.jsonl",
58
  }
59
 
60
 
61
  class SwissJudgmentPredictionConfig(datasets.BuilderConfig):
62
  """BuilderConfig for SwissJudgmentPrediction."""
63
 
64
+ def __init__(self, language: str, **kwargs):
65
  """BuilderConfig for SwissJudgmentPrediction.
66
 
67
  Args:
68
+ language: One of de, fr, it, or all, or all+mt
69
  **kwargs: keyword arguments forwarded to super.
70
  """
71
  super(SwissJudgmentPredictionConfig, self).__init__(**kwargs)
72
  self.language = language
 
 
 
 
73
 
74
 
75
  class SwissJudgmentPrediction(datasets.GeneratorBasedBuilder):
76
  """SwissJudgmentPrediction: A Multilingual Legal Judgment PredictionBenchmark"""
77
 
78
+ VERSION = datasets.Version("2.0.0", "")
79
  BUILDER_CONFIG_CLASS = SwissJudgmentPredictionConfig
80
  BUILDER_CONFIGS = [
81
  SwissJudgmentPredictionConfig(
82
  name=lang,
83
  language=lang,
84
+ version=datasets.Version("2.0.0", ""),
85
  description=f"Plain text import of SwissJudgmentPrediction for the {lang} language",
86
  )
87
  for lang in _LANGUAGES
88
  ] + [
89
  SwissJudgmentPredictionConfig(
90
+ name="all",
91
+ language="all",
92
+ version=datasets.Version("2.0.0", ""),
93
  description="Plain text import of SwissJudgmentPrediction for all languages",
94
+ ),
95
+ SwissJudgmentPredictionConfig(
96
+ name="all+mt",
97
+ language="all+mt",
98
+ version=datasets.Version("2.0.0", ""),
99
+ description="Plain text import of SwissJudgmentPrediction for all languages with machine translation",
100
+ ),
101
  ]
102
 
103
  def _info(self):
111
  "region": datasets.Value("string"),
112
  "canton": datasets.Value("string"),
113
  "legal area": datasets.Value("string"),
114
+ "source_language": datasets.Value("string"),
115
  }
116
  )
117
  return datasets.DatasetInfo(
125
  def _split_generators(self, dl_manager):
126
  # dl_manager is a datasets.download.DownloadManager that can be used to
127
  # download and extract URLs
 
128
  try:
129
+ dl_dir = dl_manager.download(_URLS)
130
  except Exception:
131
  logger.warning(
132
+ "This dataset is downloaded through Zenodo which is flaky. "
133
+ "If this download failed try a few times before reporting an issue"
134
  )
135
  raise
136
  return [
137
  datasets.SplitGenerator(
138
  name=datasets.Split.TRAIN,
139
  # These kwargs will be passed to _generate_examples
140
+ gen_kwargs={"filepath": dl_dir["train"], "mt_filepath": dl_dir["train_mt"]},
141
  ),
142
  datasets.SplitGenerator(
143
+ name=datasets.Split.VALIDATION,
144
  # These kwargs will be passed to _generate_examples
145
+ gen_kwargs={"filepath": dl_dir["val"], "mt_filepath": None},
146
  ),
147
  datasets.SplitGenerator(
148
+ name=datasets.Split.TEST,
149
  # These kwargs will be passed to _generate_examples
150
+ gen_kwargs={"filepath": dl_dir["test"], "mt_filepath": None},
151
  ),
152
  ]
153
 
154
+ def _generate_examples(self, filepath, mt_filepath):
155
  """This function returns the examples in the raw (text) form."""
156
+ if self.config.language in ["all", "all+mt"] + _ORIGINAL_LANGUAGES:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  with open(filepath, encoding="utf-8") as f:
158
  for id_, row in enumerate(f):
159
  data = json.loads(row)
160
+ _ = data.setdefault("source_language", "n/a")
161
+ if self.config.language in ["all", "all+mt"] or data["language"] == self.config.language:
162
+ yield id_, data
163
+ if self.config.language in ["all+mt"] + _MT_LANGUAGES:
164
+ if mt_filepath: # yield data from mt_filepath
165
+ with open(mt_filepath, encoding="utf-8") as f:
166
+ for id_, row in enumerate(f):
167
+ data = json.loads(row)
168
+ _ = data.setdefault("source_language", "n/a")
169
+ if (
170
+ self.config.language == "all+mt" or data["language"] in self.config.language
171
+ ): # "de" in "mt_de"
172
+ yield f"mt_{id_}", data