parquet-converter commited on
Commit
28b8b48
1 Parent(s): 9d975af

Update parquet files

Browse files
README.md DELETED
@@ -1,200 +0,0 @@
1
- ---
2
- annotations_creators:
3
- - machine-generated
4
- language:
5
- - de
6
- - fr
7
- - it
8
- language_creators:
9
- - expert-generated
10
- license: []
11
- multilinguality:
12
- - multilingual
13
- pretty_name: Legal Criticality Prediction
14
- size_categories:
15
- - 100K<n<1M
16
- source_datasets:
17
- - original
18
- tags: []
19
- task_categories:
20
- - text-classification
21
- ---
22
- # Dataset Card for [legal criticality prediction]
23
-
24
- ## Table of Contents
25
- - [Table of Contents](#table-of-contents)
26
- - [Dataset Description](#dataset-description)
27
- - [Dataset Summary](#dataset-summary)
28
- - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
29
- - [Languages](#languages)
30
- - [Dataset Structure](#dataset-structure)
31
- - [Data Instances](#data-instances)
32
- - [Data Fields](#data-fields)
33
- - [Data Splits](#data-splits)
34
- - [Dataset Creation](#dataset-creation)
35
- - [Curation Rationale](#curation-rationale)
36
- - [Source Data](#source-data)
37
- - [Annotations](#annotations)
38
- - [Personal and Sensitive Information](#personal-and-sensitive-information)
39
- - [Considerations for Using the Data](#considerations-for-using-the-data)
40
- - [Social Impact of Dataset](#social-impact-of-dataset)
41
- - [Discussion of Biases](#discussion-of-biases)
42
- - [Other Known Limitations](#other-known-limitations)
43
- - [Additional Information](#additional-information)
44
- - [Dataset Curators](#dataset-curators)
45
- - [Licensing Information](#licensing-information)
46
- - [Citation Information](#citation-information)
47
- - [Contributions](#contributions)
48
-
49
- ## Dataset Description
50
-
51
- - **Homepage:**
52
- - **Repository:**
53
- - **Paper:**
54
- - **Leaderboard:**
55
- - **Point of Contact:**
56
-
57
- ### Dataset Summary
58
-
59
- Legal Criticality Prediction (LCP) is a multilingual, diachronic dataset of 130K Swiss Federal Supreme Court (FSCS) cases annotated with two criticality labels. The bge_label i a binary label (critical, non-critical), while the citation label has 5 classes (critical-1, critical-2, critical-3, critical-4, non-critical). Critical classes of the citation_label are distinct subsets of the critical class of the bge_label. This dataset creates a challenging text classification task. We also provide additional metadata as the publication year, the law area and the canton of origin per case, to promote robustness and fairness studies on the critical area of legal NLP.
60
-
61
- ### Supported Tasks and Leaderboards
62
-
63
- LCP can be used as text classification task
64
-
65
- ### Languages
66
-
67
- Switzerland has four official languages with three languages German, French and Italian being represenated. The decisions are written by the judges and clerks in the language of the proceedings.
68
- German (80k), French (40k), Italian (10k)
69
-
70
- ## Dataset Structure
71
-
72
- ```
73
- {
74
- "decision_id": ,
75
- "language": de,
76
- "year": 2018,
77
- "chamber": ,
78
- "court": ,
79
- "canton": ,
80
- "region": ,
81
- "origin_chamber": ,
82
- "origin_court": ,
83
- "origin_canton": ,
84
- "law_area": ,
85
- "law_sub_area": ,
86
- "bge_label": ,
87
- "citation_label": ,
88
- "facts": ,
89
- "considerations": ,
90
- "rulings": ,
91
- "origin_facts": ,
92
- "origin_considerations": ,
93
- }
94
- ```
95
-
96
- ### Data Fields
97
-
98
- ```
99
- decision_id: (str) a unique identifier of the for the document
100
- language: (str) one of (de, fr, it)
101
- year: (int) the publication year
102
- chamber: (str) the chamber of the case
103
- court: (str) the court of the case
104
- canton: (str) the canton
105
- region: (str) the region of the case
106
- origin_chamber: (str) the chamber of the origin case
107
- origin_court: (str) the court of the origin case
108
- origin_canton: (str) the canton of the origin case
109
- law_area: (str) the law area of the case
110
- law_sub_area:(str) the law sub area of the case
111
- bge_label: (str) critical or non-critical
112
- citation_label: (str) critical-1, critical-2, critical-3, critical-4, non-critical
113
- facts: (str) the facts of the case
114
- considerations: (str) the considerations of the case
115
- rulings: (str) the rulings of the case
116
- origin_facts: (str) the facts of the origin case
117
- origin_considerations: (str) the considerations of the origin case
118
- ```
119
-
120
- ### Data Instances
121
- [More Information Needed]
122
- ### Data Fields
123
- [More Information Needed]
124
- ### Data Splits
125
-
126
- The dataset was split date-stratisfied
127
- - Train: 2002-2015
128
- - Validation: 2016-2017
129
- - Test: 2018-2022
130
-
131
- | Language | Subset | Number of Documents (Training/Validation/Test) |
132
- |------------|------------|--------------------------------------------|
133
- | German | **de** | / / |
134
- | French | **fr** | / / |
135
- | Italian | **it** | / / |
136
-
137
- ## Dataset Creation
138
- ### Curation Rationale
139
-
140
- The dataset was curated by Stern et al. (2023).
141
-
142
- ### Source Data
143
- #### Initial Data Collection and Normalization
144
-
145
- The original data are published from 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.
146
-
147
- #### Who are the source language producers?
148
-
149
- The decisions are written by the judges and clerks in the language of the proceedings.
150
-
151
- ### Annotations
152
- #### Annotation process
153
-
154
- bge_label:
155
- 1. all bger_references in the bge header were extracted
156
- 2. bger file_names are compared with the found references
157
-
158
- citation_label:
159
- 1. count all citations for all bger cases and weight citations
160
- 2. divide cited cases in four different classes, depending on amount of citations
161
-
162
- #### Who are the annotators?
163
-
164
- Ronja Stern annotated the citations.
165
- Metadata is published by the Swiss Federal Supreme Court (https://www.bger.ch).
166
-
167
- ### Personal and Sensitive Information
168
-
169
- 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.
170
-
171
- ## Considerations for Using the Data
172
- ### Social Impact of Dataset
173
- [More Information Needed]
174
- ### Discussion of Biases
175
- [More Information Needed]
176
- ### Other Known Limitations
177
- [More Information Needed]
178
- ## Additional Information
179
- ### Dataset Curators
180
- [More Information Needed]
181
- ### Licensing Information
182
-
183
- 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)
184
- © Swiss Federal Supreme Court, 2002-2022
185
-
186
- 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.
187
- Source: https://www.bger.ch/files/live/sites/bger/files/pdf/de/urteilsveroeffentlichung_d.pdf
188
-
189
- ### Citation Information
190
-
191
- *Visu, Ronja, Joel*
192
- *Title: Blabliblablu*
193
- *Name of conference*
194
- ```
195
- cit
196
- ```
197
-
198
- ### Contributions
199
-
200
- Thanks to [@Stern5497](https://github.com/stern5497) for adding this dataset.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
data/test.jsonl.xz → full/swiss_criticality_prediction-test.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:0c28da5a9f31dd774dcd1bf31b4b1a57f17b41a9832ff6bc205c0d4692167d57
3
- size 87979896
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:584014372fd54c1cfd2e381c4a48ffa36f5cb8e4346e141719b1cad40bea4b86
3
+ size 242060693
data/train.jsonl.xz → full/swiss_criticality_prediction-train-00000-of-00003.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:9eccc885fb41f5121a2e98ad87e4128551159606d622b223d34271b25b1ffb01
3
- size 230247948
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b1631aaaae8db85b5e7b957e5e7954e2f5bb59860b7eeac493c5be6f822f755
3
+ size 249733456
data/validation.jsonl.xz → full/swiss_criticality_prediction-train-00001-of-00003.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:dc7799bbd942bc69085c032271e124393968a61d76304e879325ee19ed2c7ff8
3
- size 36331956
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a97e5ce44d04f0069addb3a34aafa065f7fd7166614afcd95866a9ffd9b5fc55
3
+ size 247125765
full/swiss_criticality_prediction-train-00002-of-00003.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0cadc46bf297deaabda2e95b03d67b128442b2c06e9aa41e268ac1924a99669c
3
+ size 127054618
full/swiss_criticality_prediction-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b39b87c1a033ca51209e07afab71c4dec1c64fa5bd13a5fe53d18ee8351d9f3a
3
+ size 100420329
swiss_criticality_prediction.py DELETED
@@ -1,166 +0,0 @@
1
- # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- """Dataset for the Legal Criticality Prediction task."""
15
-
16
- import json
17
- import lzma
18
- import os
19
-
20
- import datasets
21
- try:
22
- import lzma as xz
23
- except ImportError:
24
- import pylzma as xz
25
-
26
-
27
- # TODO: Add BibTeX citation
28
- # Find for instance the citation on arxiv or on the dataset repo/website
29
- _CITATION = """\
30
- @InProceedings{huggingface:dataset,
31
- title = {A great new dataset},
32
- author={huggingface, Inc.
33
- },
34
- year={2020}
35
- }
36
- """
37
-
38
- # You can copy an official description
39
- _DESCRIPTION = """\
40
- This dataset contains Swiss federal court decisions for the legal criticality prediction task
41
- """
42
-
43
- _URLS = {
44
- "full": "https://huggingface.co/datasets/rcds/swiss_criticality_prediction/resolve/main/data",
45
- }
46
-
47
-
48
- class SwissCriticalityPrediction(datasets.GeneratorBasedBuilder):
49
- """This dataset contains court decision for court view generation task."""
50
-
51
-
52
- BUILDER_CONFIGS = [
53
- datasets.BuilderConfig(name="full", description="This part covers the whole dataset"),
54
- ]
55
-
56
- DEFAULT_CONFIG_NAME = "full" # It's not mandatory to have a default configuration. Just use one if it make sense.
57
-
58
- def _info(self):
59
- if self.config.name == "full": # This is the name of the configuration selected in BUILDER_CONFIGS above
60
- features = datasets.Features(
61
- {
62
- # Todo check if these are all
63
- "decision_id": datasets.Value("string"),
64
- "language": datasets.Value("string"),
65
- "year": datasets.Value("int32"),
66
- "chamber": datasets.Value("string"),
67
- "region": datasets.Value("string"),
68
- "origin_chamber": datasets.Value("string"),
69
- "origin_court": datasets.Value("string"),
70
- "origin_canton": datasets.Value("string"),
71
- "law_area": datasets.Value("string"),
72
- "law_sub_area": datasets.Value("string"),
73
- "bge_label": datasets.Value("string"),
74
- "citation_label": datasets.Value("string"),
75
- "facts": datasets.Value("string"),
76
- "considerations": datasets.Value("string"),
77
- "rulings": datasets.Value("string"),
78
- # These are the features of your dataset like images, labels ...
79
- }
80
- )
81
- return datasets.DatasetInfo(
82
- # This is the description that will appear on the datasets page.
83
- description=_DESCRIPTION,
84
- # This defines the different columns of the dataset and their types
85
- features=features, # Here we define them above because they are different between the two configurations
86
- # If there's a common (input, target) tuple from the features, uncomment supervised_keys line below and
87
- # specify them. They'll be used if as_supervised=True in builder.as_dataset.
88
- # supervised_keys=("sentence", "label"),
89
- # Homepage of the dataset for documentation
90
- # homepage=_HOMEPAGE,
91
- # License for the dataset if available
92
- # license=_LICENSE,
93
- # Citation for the dataset
94
- # citation=_CITATION,
95
- )
96
-
97
- def _split_generators(self, dl_manager):
98
- # If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
99
-
100
- # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
101
- # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
102
- # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
103
- urls = _URLS[self.config.name]
104
- filepath_train = dl_manager.download(os.path.join(urls, "train.jsonl.xz"))
105
- filepath_validation = dl_manager.download(os.path.join(urls, "validation.jsonl.xz"))
106
- filepath_test = dl_manager.download(os.path.join(urls, "test.jsonl.xz"))
107
-
108
- return [
109
- datasets.SplitGenerator(
110
- name=datasets.Split.TRAIN,
111
- # These kwargs will be passed to _generate_examples
112
- gen_kwargs={
113
- "filepath": filepath_train,
114
- "split": "train",
115
- },
116
- ),
117
- datasets.SplitGenerator(
118
- name=datasets.Split.VALIDATION,
119
- # These kwargs will be passed to _generate_examples
120
- gen_kwargs={
121
- "filepath": filepath_validation,
122
- "split": "validation",
123
- },
124
- ),
125
- datasets.SplitGenerator(
126
- name=datasets.Split.TEST,
127
- # These kwargs will be passed to _generate_examples
128
- gen_kwargs={
129
- "filepath": filepath_test,
130
- "split": "test"
131
- },
132
- )
133
- ]
134
-
135
- # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
136
- def _generate_examples(self, filepath, split):
137
- # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
138
- line_counter = 0
139
- try:
140
- with xz.open(open(filepath, "rb"), "rt", encoding="utf-8") as f:
141
- for id, line in enumerate(f):
142
- line_counter += 1
143
- if line:
144
- data = json.loads(line)
145
- if self.config.name == "full":
146
- yield id, {
147
- "decision_id": data["decision_id"],
148
- "language": data["language"],
149
- "year": data["year"],
150
- "chamber": data["chamber"],
151
- "region": data["region"],
152
- "origin_chamber": data["origin_chamber"],
153
- "origin_court": data["origin_court"],
154
- "origin_canton": data["origin_canton"],
155
- "law_area": data["law_area"],
156
- "law_sub_area": data["law_sub_area"],
157
- "citation_label": data["citation_label"],
158
- "bge_label": data["bge_label"],
159
- "facts": data["facts"],
160
- "considerations": data["considerations"],
161
- "rulings": data["rulings"],
162
- }
163
- except lzma.LZMAError as e:
164
- print(split, e)
165
- if line_counter == 0:
166
- raise e