Datasets:
Commit
•
f11bf17
0
Parent(s):
Update files from the datasets library (from 1.13.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.13.0
- .gitattributes +27 -0
- README.md +242 -0
- dataset_infos.json +1 -0
- dummy/all_languages/1.0.0/dummy_data.zip +3 -0
- dummy/de/1.0.0/dummy_data.zip +3 -0
- dummy/fr/1.0.0/dummy_data.zip +3 -0
- dummy/it/1.0.0/dummy_data.zip +3 -0
- swiss_judgment_prediction.py +174 -0
.gitattributes
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,242 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
pretty_name: Swiss-Judgment-Prediction
|
3 |
+
annotations_creators:
|
4 |
+
- found
|
5 |
+
language_creators:
|
6 |
+
- found
|
7 |
+
languages:
|
8 |
+
- de
|
9 |
+
- fr
|
10 |
+
- it
|
11 |
+
licenses:
|
12 |
+
- cc-by-sa-4-0
|
13 |
+
multilinguality:
|
14 |
+
- multilingual
|
15 |
+
size_categories:
|
16 |
+
- 10K<n<100K
|
17 |
+
source_datasets:
|
18 |
+
- original
|
19 |
+
task_categories:
|
20 |
+
- text-classification
|
21 |
+
task_ids:
|
22 |
+
- text-classification-other-judgement-prediction
|
23 |
+
---
|
24 |
+
|
25 |
+
# Dataset Card for "SwissJudgmentPrediction"
|
26 |
+
|
27 |
+
## Table of Contents
|
28 |
+
- [Dataset Description](#dataset-description)
|
29 |
+
- [Dataset Summary](#dataset-summary)
|
30 |
+
- [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
|
31 |
+
- [Languages](#languages)
|
32 |
+
- [Dataset Structure](#dataset-structure)
|
33 |
+
- [Data Instances](#data-instances)
|
34 |
+
- [Data Fields](#data-fields)
|
35 |
+
- [Data Splits](#data-splits)
|
36 |
+
- [Dataset Creation](#dataset-creation)
|
37 |
+
- [Curation Rationale](#curation-rationale)
|
38 |
+
- [Source Data](#source-data)
|
39 |
+
- [Annotations](#annotations)
|
40 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
41 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
42 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
43 |
+
- [Discussion of Biases](#discussion-of-biases)
|
44 |
+
- [Other Known Limitations](#other-known-limitations)
|
45 |
+
- [Additional Information](#additional-information)
|
46 |
+
- [Dataset Curators](#dataset-curators)
|
47 |
+
- [Licensing Information](#licensing-information)
|
48 |
+
- [Citation Information](#citation-information)
|
49 |
+
- [Contributions](#contributions)
|
50 |
+
|
51 |
+
## Dataset Description
|
52 |
+
|
53 |
+
- **Homepage:** https://github.com/JoelNiklaus/SwissCourtRulingCorpus
|
54 |
+
- **Repository:** https://github.com/JoelNiklaus/SwissCourtRulingCorpus
|
55 |
+
- **Paper:** https://arxiv.org/abs/2110.00806
|
56 |
+
- **Leaderboard:** N/A
|
57 |
+
- **Point of Contact:** [Joel Niklaus](mailto:joel.niklaus@inf.unibe.ch)
|
58 |
+
|
59 |
+
### Dataset Summary
|
60 |
+
|
61 |
+
**Documents**
|
62 |
+
|
63 |
+
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.
|
64 |
+
|
65 |
+
### Supported Tasks and Leaderboards
|
66 |
+
|
67 |
+
SwissJudgmentPrediction can be used for the legal judgment prediction task.
|
68 |
+
|
69 |
+
The dataset is not yet part of an established benchmark.
|
70 |
+
|
71 |
+
### Languages
|
72 |
+
|
73 |
+
Switzerland has four official languages with 3 languages (German, French and Italian) being represented in more than 1000 Swiss Federal Supreme court decisions. The decisions are written by the judges and clerks in the language of the proceedings.
|
74 |
+
|
75 |
+
## Dataset Structure
|
76 |
+
|
77 |
+
### Data Instances
|
78 |
+
|
79 |
+
**Multilingual use of the dataset**
|
80 |
+
|
81 |
+
When the dataset is used in a multilingual setting selecting the the 'all_languages' flag:
|
82 |
+
|
83 |
+
```python
|
84 |
+
from datasets import load_dataset
|
85 |
+
dataset = load_dataset('swiss_judgment_prediction', 'all_languages')
|
86 |
+
```
|
87 |
+
|
88 |
+
```
|
89 |
+
{
|
90 |
+
"id": 48757,
|
91 |
+
"year": 2015,
|
92 |
+
"facts": "Sachverhalt: A. X._ war bei der Krankenversicherung C._ taggeldversichert. Infolge einer Arbeitsunf\u00e4higkeit leistete ihm die C._ vom 30. Juni 2011 bis am 28. Juni 2013 Krankentaggelder, wobei die Leistungen bis am 30. September 2012 auf Grundlage einer Arbeitsunf\u00e4higkeit von 100% und danach basierend auf einer Arbeitsunf\u00e4higkeit von 55% erbracht wurden. Die Neueinsch\u00e4tzung der Arbeitsf\u00e4higkeit erfolgte anhand eines Gutachtens der D._ AG vom 27. August 2012, welches im Auftrag der C._ erstellt wurde. X._ machte daraufhin gegen\u00fcber der C._ geltend, er sei entgegen dem Gutachten auch nach dem 30. September 2012 zu 100% arbeitsunf\u00e4hig gewesen. Ferner verlangte er von der D._ AG zwecks externer \u00dcberpr\u00fcfung des Gutachtens die Herausgabe s\u00e4mtlicher diesbez\u00fcglicher Notizen, Auswertungen und Unterlagen. A._ (als Gesch\u00e4ftsf\u00fchrer der D._ AG) und B._ (als f\u00fcr das Gutachten medizinisch Verantwortliche) antworteten ihm, dass sie alle Unterlagen der C._ zugestellt h\u00e4tten und dass allf\u00e4llige Fragen zum Gutachten direkt der C._ zu stellen seien. X._ reichte am 2. Januar 2014 eine Strafanzeige gegen A._ und B._ ein. Er wirft diesen vor, ihn durch die Nichtherausgabe der Dokumente und durch Behinderung des IV-Verfahrens gen\u00f6tigt, Daten besch\u00e4digt bzw. vernichtet und ein falsches \u00e4rztliches Zeugnis ausgestellt zu haben. Zudem h\u00e4tten sie durch die Verz\u00f6gerung des IV-Verfahrens und insbesondere durch das falsche \u00e4rztliche Zeugnis sein Verm\u00f6gen arglistig gesch\u00e4digt. B. Die Staatsanwaltschaft des Kantons Bern, Region Oberland, nahm das Verfahren wegen N\u00f6tigung, Datenbesch\u00e4digung, falschem \u00e4rztlichem Zeugnis und arglistiger Verm\u00f6genssch\u00e4digung mit Verf\u00fcgung vom 10. November 2014 nicht an die Hand. Das Obergericht des Kantons Bern wies die von X._ dagegen erhobene Beschwerde am 27. April 2015 ab, soweit darauf einzutreten war. C. X._ beantragt mit Beschwerde in Strafsachen, der Beschluss vom 27. April 2015 sei aufzuheben und die Angelegenheit zur korrekten Ermittlung des Sachverhalts an die Staatsanwaltschaft zur\u00fcckzuweisen. Er stellt zudem den sinngem\u00e4ssen Antrag, das bundesgerichtliche Verfahren sei w\u00e4hrend der Dauer des konnexen Strafverfahrens gegen eine Teilgutachterin und des ebenfalls konnexen Zivil- oder Strafverfahrens gegen die C._ wegen Einsichtsverweigerung in das mutmasslich gef\u00e4lschte Originalgutachten zu sistieren. X._ ersucht um unentgeltliche Rechtspflege. ",
|
93 |
+
"labels": 0, # dismissal
|
94 |
+
"language": "de",
|
95 |
+
"region": "Espace Mittelland",
|
96 |
+
"canton": "be",
|
97 |
+
"legal area": "penal law"
|
98 |
+
}
|
99 |
+
```
|
100 |
+
|
101 |
+
**Monolingual use of the dataset**
|
102 |
+
|
103 |
+
When the dataset is used in a monolingual setting selecting the ISO language code for one of the 3 supported languages. For example:
|
104 |
+
|
105 |
+
```python
|
106 |
+
from datasets import load_dataset
|
107 |
+
dataset = load_dataset('swiss_judgment_prediction', 'de')
|
108 |
+
```
|
109 |
+
|
110 |
+
```
|
111 |
+
{
|
112 |
+
"id": 48757,
|
113 |
+
"year": 2015,
|
114 |
+
"facts": "Sachverhalt: A. X._ war bei der Krankenversicherung C._ taggeldversichert. Infolge einer Arbeitsunf\u00e4higkeit leistete ihm die C._ vom 30. Juni 2011 bis am 28. Juni 2013 Krankentaggelder, wobei die Leistungen bis am 30. September 2012 auf Grundlage einer Arbeitsunf\u00e4higkeit von 100% und danach basierend auf einer Arbeitsunf\u00e4higkeit von 55% erbracht wurden. Die Neueinsch\u00e4tzung der Arbeitsf\u00e4higkeit erfolgte anhand eines Gutachtens der D._ AG vom 27. August 2012, welches im Auftrag der C._ erstellt wurde. X._ machte daraufhin gegen\u00fcber der C._ geltend, er sei entgegen dem Gutachten auch nach dem 30. September 2012 zu 100% arbeitsunf\u00e4hig gewesen. Ferner verlangte er von der D._ AG zwecks externer \u00dcberpr\u00fcfung des Gutachtens die Herausgabe s\u00e4mtlicher diesbez\u00fcglicher Notizen, Auswertungen und Unterlagen. A._ (als Gesch\u00e4ftsf\u00fchrer der D._ AG) und B._ (als f\u00fcr das Gutachten medizinisch Verantwortliche) antworteten ihm, dass sie alle Unterlagen der C._ zugestellt h\u00e4tten und dass allf\u00e4llige Fragen zum Gutachten direkt der C._ zu stellen seien. X._ reichte am 2. Januar 2014 eine Strafanzeige gegen A._ und B._ ein. Er wirft diesen vor, ihn durch die Nichtherausgabe der Dokumente und durch Behinderung des IV-Verfahrens gen\u00f6tigt, Daten besch\u00e4digt bzw. vernichtet und ein falsches \u00e4rztliches Zeugnis ausgestellt zu haben. Zudem h\u00e4tten sie durch die Verz\u00f6gerung des IV-Verfahrens und insbesondere durch das falsche \u00e4rztliche Zeugnis sein Verm\u00f6gen arglistig gesch\u00e4digt. B. Die Staatsanwaltschaft des Kantons Bern, Region Oberland, nahm das Verfahren wegen N\u00f6tigung, Datenbesch\u00e4digung, falschem \u00e4rztlichem Zeugnis und arglistiger Verm\u00f6genssch\u00e4digung mit Verf\u00fcgung vom 10. November 2014 nicht an die Hand. Das Obergericht des Kantons Bern wies die von X._ dagegen erhobene Beschwerde am 27. April 2015 ab, soweit darauf einzutreten war. C. X._ beantragt mit Beschwerde in Strafsachen, der Beschluss vom 27. April 2015 sei aufzuheben und die Angelegenheit zur korrekten Ermittlung des Sachverhalts an die Staatsanwaltschaft zur\u00fcckzuweisen. Er stellt zudem den sinngem\u00e4ssen Antrag, das bundesgerichtliche Verfahren sei w\u00e4hrend der Dauer des konnexen Strafverfahrens gegen eine Teilgutachterin und des ebenfalls konnexen Zivil- oder Strafverfahrens gegen die C._ wegen Einsichtsverweigerung in das mutmasslich gef\u00e4lschte Originalgutachten zu sistieren. X._ ersucht um unentgeltliche Rechtspflege. ",
|
115 |
+
"labels": 0, # dismissal
|
116 |
+
"language": "de",
|
117 |
+
"region": "Espace Mittelland",
|
118 |
+
"canton": "be",
|
119 |
+
"legal area": "penal law"
|
120 |
+
}
|
121 |
+
```
|
122 |
+
|
123 |
+
### Data Fields
|
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 \
|
131 |
+
`text`: (**str**) the facts of the case \
|
132 |
+
`label`: (**class label**) the judgment outcome: 0 (dismissal) or 1 (approval) \
|
133 |
+
`language`: (**str**) one of (de, fr, it) \
|
134 |
+
`region`: (**str**) the region of the lower court \
|
135 |
+
`canton`: (**str**) the canton of the lower court \
|
136 |
+
`legal area`: (**str**) the legal area of the case
|
137 |
+
|
138 |
+
|
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 \
|
146 |
+
`text`: (**str**) the facts of the case \
|
147 |
+
`label`: (**class label**) the judgment outcome: 0 (dismissal) or 1 (approval) \
|
148 |
+
`language`: (**str**) one of (de, fr, it) \
|
149 |
+
`region`: (**str**) the region of the lower court \
|
150 |
+
`canton`: (**str**) the canton of the lower court \
|
151 |
+
`legal area`: (**str**) the legal area of the case
|
152 |
+
|
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 |
+
|
164 |
+
### Curation Rationale
|
165 |
+
|
166 |
+
The dataset was curated by Niklaus et al. (2021).
|
167 |
+
|
168 |
+
### Source Data
|
169 |
+
|
170 |
+
#### Initial Data Collection and Normalization
|
171 |
+
|
172 |
+
The original data are available at the Swiss Federal Supreme Court (https://www.bger.ch) in unprocessed formats (HTML). The documents were downloaded from the Entscheidsuche portal (https://entscheidsuche.ch) in HTML.
|
173 |
+
|
174 |
+
#### Who are the source language producers?
|
175 |
+
|
176 |
+
Switzerland has four official languages with 3 languages (German, French and Italian) being represented in more than 1000 Swiss Federal Supreme court decisions. The decisions are written by the judges and clerks in the language of the proceedings.
|
177 |
+
|
178 |
+
### Annotations
|
179 |
+
|
180 |
+
#### Annotation process
|
181 |
+
|
182 |
+
The decisions have been annotated with the binarized judgment outcome using parsers and regular expressions.
|
183 |
+
|
184 |
+
#### Who are the annotators?
|
185 |
+
|
186 |
+
Joel Niklaus and Adrian Jörg annotated the binarized judgment outcomes.
|
187 |
+
Metadata is published by the Swiss Federal Supreme Court (https://www.bger.ch).
|
188 |
+
|
189 |
+
### Personal and Sensitive Information
|
190 |
+
|
191 |
+
The dataset contains publicly available court decisions from the Swiss Federal Supreme Court. Personal or sensitive information has been anonymized by the court before publication according to the following guidelines: https://www.bger.ch/home/juridiction/anonymisierungsregeln.html.
|
192 |
+
|
193 |
+
## Considerations for Using the Data
|
194 |
+
|
195 |
+
### Social Impact of Dataset
|
196 |
+
|
197 |
+
[More Information Needed]
|
198 |
+
|
199 |
+
### Discussion of Biases
|
200 |
+
|
201 |
+
[More Information Needed]
|
202 |
+
|
203 |
+
### Other Known Limitations
|
204 |
+
|
205 |
+
[More Information Needed]
|
206 |
+
|
207 |
+
## Additional Information
|
208 |
+
|
209 |
+
### Dataset Curators
|
210 |
+
|
211 |
+
Niklaus et al. (2021)
|
212 |
+
|
213 |
+
### Licensing Information
|
214 |
+
|
215 |
+
We release the data under CC-BY-4.0 which complies with the court licensing (https://www.bger.ch/files/live/sites/bger/files/pdf/de/urteilsveroeffentlichung_d.pdf)
|
216 |
+
|
217 |
+
© Swiss Federal Supreme Court, 2000-2020
|
218 |
+
|
219 |
+
The copyright for the editorial content of this website and the consolidated texts, which is owned by the Swiss Federal Supreme Court, is licensed under the Creative Commons Attribution 4.0 International licence. This means that you can re-use the content provided you acknowledge the source and indicate any changes you have made.
|
220 |
+
|
221 |
+
Source: https://www.bger.ch/files/live/sites/bger/files/pdf/de/urteilsveroeffentlichung_d.pdf
|
222 |
+
|
223 |
+
### Citation Information
|
224 |
+
|
225 |
+
*Joel Niklaus, Ilias Chalkidis, and Matthias Stürmer.*
|
226 |
+
*Swiss-Judgment-Prediction: A Multilingual Legal Judgment Prediction Benchmark*
|
227 |
+
*Proceedings of the 2021 Natural Legal Language Processing Workshop. Punta Cana, Dominican Republic. 2021*
|
228 |
+
```
|
229 |
+
@InProceedings{niklaus-etal-2021-swiss,
|
230 |
+
author = {Niklaus, Joel
|
231 |
+
and Chalkidis, Ilias
|
232 |
+
and Stürmer, Matthias},
|
233 |
+
title = {Swiss-Judgment-Prediction: A Multilingual Legal Judgment Prediction Benchmark},
|
234 |
+
booktitle = {Proceedings of the 2021 Natural Legal Language Processing Workshop},
|
235 |
+
year = {2021},
|
236 |
+
location = {Punta Cana, Dominican Republic},
|
237 |
+
}
|
238 |
+
```
|
239 |
+
|
240 |
+
### Contributions
|
241 |
+
|
242 |
+
Thanks to [@joelniklaus](https://github.com/joelniklaus) for adding this dataset.
|
dataset_infos.json
ADDED
@@ -0,0 +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}}
|
dummy/all_languages/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:065dcb6ead752b189279d2082b34ad96e8499b57a261c6e77db7b02049edb755
|
3 |
+
size 11676
|
dummy/de/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e5fd6b04e5c9804664357d6929f8db046b61ce4e578ffa9dfe5dae8d501a6eb1
|
3 |
+
size 5283
|
dummy/fr/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e4081dbe49cc10caf72a9285274c12fa0b4088914c90e4149f5451230e521974
|
3 |
+
size 5130
|
dummy/it/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:05769bf13b52f08f34d87f2dc9f7c3ae7ab350e91f1449258db8269d31c2a667
|
3 |
+
size 3453
|
swiss_judgment_prediction.py
ADDED
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
3 |
+
#
|
4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
# you may not use this file except in compliance with the License.
|
6 |
+
# You may obtain a copy of the License at
|
7 |
+
#
|
8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
#
|
10 |
+
# Unless required by applicable law or agreed to in writing, software
|
11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
# See the License for the specific language governing permissions and
|
14 |
+
# limitations under the License.
|
15 |
+
"""Swiss-Court-Predict: A Multilingual Legal Judgment Prediction Benchmark"""
|
16 |
+
|
17 |
+
import json
|
18 |
+
|
19 |
+
import datasets
|
20 |
+
|
21 |
+
|
22 |
+
logger = datasets.logging.get_logger(__name__)
|
23 |
+
|
24 |
+
_CITATION = """\
|
25 |
+
@InProceedings{niklaus-etal-2021-swiss,
|
26 |
+
author = {Niklaus, Joel
|
27 |
+
and Chalkidis, Ilias
|
28 |
+
and Stürmer, Matthias},
|
29 |
+
title = {Swiss-Court-Predict: A Multilingual Legal Judgment Prediction Benchmark},
|
30 |
+
booktitle = {Proceedings of the 2021 Natural Legal Language Processing Workshop},
|
31 |
+
year = {2021},
|
32 |
+
location = {Punta Cana, Dominican Republic},
|
33 |
+
}"""
|
34 |
+
|
35 |
+
_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):
|
94 |
+
features = datasets.Features(
|
95 |
+
{
|
96 |
+
"id": datasets.Value("int32"),
|
97 |
+
"year": datasets.Value("int32"),
|
98 |
+
"text": datasets.Value("string"),
|
99 |
+
"label": datasets.ClassLabel(names=["dismissal", "approval"]),
|
100 |
+
"language": datasets.Value("string"),
|
101 |
+
"region": datasets.Value("string"),
|
102 |
+
"canton": datasets.Value("string"),
|
103 |
+
"legal area": datasets.Value("string"),
|
104 |
+
}
|
105 |
+
)
|
106 |
+
return datasets.DatasetInfo(
|
107 |
+
description=_DESCRIPTION,
|
108 |
+
features=features,
|
109 |
+
supervised_keys=None,
|
110 |
+
homepage="https://github.com/JoelNiklaus/SwissCourtRulingCorpus",
|
111 |
+
citation=_CITATION,
|
112 |
+
)
|
113 |
+
|
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 |
+
}
|