parquet-converter commited on
Commit
4dfd60d
1 Parent(s): 205025a

Update parquet files

Browse files
README.md DELETED
@@ -1,189 +0,0 @@
1
- ---
2
- annotations_creators:
3
- - expert-generated
4
- language:
5
- - de
6
- - fr
7
- - it
8
- - en
9
- language_creators:
10
- - expert-generated
11
- - found
12
- license:
13
- - cc-by-sa-4.0
14
- multilinguality:
15
- - multilingual
16
- pretty_name: LowerCourtInsertionSwissJudgmentPrediction
17
- size_categories:
18
- - 1K<n<10K
19
- source_datasets:
20
- - extended|swiss_judgment_prediction
21
- tags:
22
- - explainability-judgment-prediction
23
- task_categories:
24
- - text-classification
25
- - other
26
- task_ids: []
27
- ---
28
-
29
- # Dataset Card for "LowerCourtInsertionSwissJudgmentPrediction": An implementation of lower court insertion bias analysis for Swiss judgment prediction
30
-
31
- ## Table of Contents
32
- - [Table of Contents](#table-of-contents)
33
- - [Dataset Summary](#dataset-summary)
34
- - [Documents](#documents)
35
- - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
36
- - [Languages](#languages)
37
- - [Dataset **str**ucture](#dataset-**str**ucture)
38
- - [Data Instances](#data-instances)
39
- - [Data Fields](#data-fields)
40
- - [Data Splits](#data-splits)
41
- - [Dataset Creation](#dataset-creation)
42
- - [Curation Rationale](#curation-rationale)
43
- - [Source Data](#source-data)
44
- - [Annotations](#annotations)
45
- - [Personal and Sensitive Information](#personal-and-sensitive-information)
46
- - [Additional Information](#additional-information)
47
- - [Dataset Curators](#dataset-curators)
48
- - [Licensing Information](#licensing-information)
49
- - [Citation Information](#citation-information)
50
- - [Contributions](#contributions)
51
-
52
- ## Dataset Summary
53
-
54
- This dataset contains an implementation of lower-court-insertion for the SwissJudgmentPrediction task.
55
- Note that this dataset only provides a test set and should be used in comination with the [Swiss-Judgment-Prediction](https://huggingface.co/datasets/swiss_judgment_prediction) dataset.
56
-
57
-
58
- ### Documents
59
- Lower-Court-Insertion-Swiss-Judgment-Prediction is a subset of the [Swiss-Judgment-Prediction](https://huggingface.co/datasets/swiss_judgment_prediction) dataset.
60
- The Swiss-Judgment-Prediction dataset is a multilingual, diachronic dataset of 85K Swiss Federal Supreme Court (FSCS) cases annotated with the respective binarized judgment outcome (approval/dismissal), the publication year, the legal area and the canton of origin per case. Lower-Court-Insertion-Swiss-Judgment-Prediction extends this dataset by adding lower court insertion.
61
- ### Supported Tasks and Leaderboards
62
-
63
- LowerCourtInsertionSwissJudgmentPrediction can be used for performing the LowerCourtInsertion in the legal judgment prediction task.
64
-
65
- ### Languages
66
-
67
- 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.
68
-
69
- ## Dataset structure
70
-
71
- ### Data Instances
72
- #### Multilingual use of the dataset
73
-
74
- When the dataset is used in a multilingual setting selecting the the 'all' flag:
75
-
76
- ```python
77
- from datasets import load_dataset
78
- dataset = load_dataset('rcds/lower_court_insertion_swiss_judgment_prediction', 'all')
79
- ```
80
-
81
-
82
-
83
- #### Monolingual use of the dataset
84
-
85
- When the dataset is used in a monolingual setting selecting the ISO language code for one of the 3 supported languages. For example:
86
-
87
- ```python
88
- from datasets import load_dataset
89
- dataset = load_dataset('rcds/lower-court-insertion_swiss_judgment_prediction', 'de')
90
- ```
91
-
92
- ### Data Fields
93
-
94
- The following data fields are provided for documents (train, validation):
95
-
96
- id: (**int**) a unique identifier of the for the document
97
- year: (**int**) the publication year
98
- text: (**str**) the facts of the case
99
- label: (class label) the judgment outcome: 0 (dismissal) or 1 (approval)
100
- language: (**str**) one of (de, fr, it)
101
- region: (**str**) the region of the lower court
102
- canton: (**str**) the canton of the lower court
103
- legal area: (**str**) the legal area of the case
104
-
105
-
106
- The following data fields are provided for documents (test):
107
-
108
- id: (**int**) a unique identifier of the for the document
109
- year: (**int**) the publication year
110
- label: (**str**) the judgment outcome: dismissal or approval
111
- language: (**str**) one of (de, fr, it)
112
- region: (**str**) the region of the lower court
113
- canton: (**str**) the canton of the lower court
114
- legal area: (**str**) the legal area of the case
115
- explainability_label: (**str**) the explainability label assigned to the occluded text: Lower court, Baseline
116
- text: (**str**) the facts of the case w/o the occluded text except for cases w/ explainability label "Baseline" (contain entire facts)
117
- lower_court: (**str**) the inserted lower_court (for Baseline there is no insertion)
118
-
119
- ### Data Splits
120
- Language | Subset | Number of Documents (Training/Validation/Test)
121
- |-----|-----|------|
122
- German| de| 35'452 / 4'705 / 378
123
- French | fr| 21'179 / 3'095 / 414
124
- Italian | it| 3'072 / 408 / 335
125
- All | all | 59'709 / 8'208 / 1127
126
-
127
-
128
- ## Dataset Creation
129
-
130
- ### Curation Rationale
131
-
132
- The dataset was curated by Niklaus et al. (2021) and Nina Baumgartner.
133
-
134
- ### Source Data
135
-
136
- #### Initial Data Collection and Normalization
137
-
138
- 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.
139
-
140
- #### Who are the source language producers?
141
-
142
- 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.
143
-
144
- ### Annotations
145
-
146
- #### Annotation process
147
-
148
- The decisions have been annotated with the binarized judgment outcome using parsers and regular expressions. In addition the a subset of the test set (27 cases in German, 24 in French and 23 in Italian spanning over the years 2017 an 20200) was annotated by legal experts with the lower court. These lower court annotations were then use the insert each lower court into each case once (instead of the original lower court). Allowing an analysis of the changes in the models performance for each inserted lower court, giving insight into a possible bias among them. The legal expert annotation were conducted from April 2020 to August 2020.
149
-
150
- #### Who are the annotators?
151
-
152
- Joel Niklaus and Adrian Jörg annotated the binarized judgment outcomes. Metadata is published by the Swiss Federal Supreme Court (https://www.bger.ch). The group of legal experts consists of Thomas Lüthi (lawyer), Lynn Grau (law student at master's level) and Angela Stefanelli (law student at master's level).
153
-
154
- ### Personal and Sensitive Information
155
-
156
- 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.
157
-
158
- ## Additional Information
159
-
160
- ### Dataset Curators
161
-
162
- Niklaus et al. (2021) and Nina Baumgartner
163
-
164
- ### Licensing Information
165
-
166
- 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)
167
-
168
- © Swiss Federal Supreme Court, 2000-2020
169
-
170
- 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.
171
-
172
- Source: https://www.bger.ch/files/live/sites/bger/files/pdf/de/urteilsveroeffentlichung_d.pdf
173
-
174
- ### Citation Information
175
-
176
- ```
177
- @misc{baumgartner_nina_occlusion_2019,
178
- title = {From Occlusion to Transparancy – An Occlusion-Based Explainability Approach for Legal Judgment Prediction in Switzerland},
179
- shorttitle = {From Occlusion to Transparancy},
180
- abstract = {Natural Language Processing ({NLP}) models have been used for more and more complex tasks such as Legal Judgment Prediction ({LJP}). A {LJP} model predicts the outcome of a legal case by utilizing its facts. This increasing deployment of Artificial Intelligence ({AI}) in high-stakes domains such as law and the involvement of sensitive data has increased the need for understanding such systems. We propose a multilingual occlusion-based explainability approach for {LJP} in Switzerland and conduct a study on the bias using Lower Court Insertion ({LCI}). We evaluate our results using different explainability metrics introduced in this thesis and by comparing them to high-quality Legal Expert Annotations using Inter Annotator Agreement. Our findings show that the model has a varying understanding of the semantic meaning and context of the facts section, and struggles to distinguish between legally relevant and irrelevant sentences. We also found that the insertion of a different lower court can have an effect on the prediction, but observed no distinct effects based on legal areas, cantons, or regions. However, we did identify a language disparity with Italian performing worse than the other languages due to representation inequality in the training data, which could lead to potential biases in the prediction in multilingual regions of Switzerland. Our results highlight the challenges and limitations of using {NLP} in the judicial field and the importance of addressing concerns about fairness, transparency, and potential bias in the development and use of {NLP} systems. The use of explainable artificial intelligence ({XAI}) techniques, such as occlusion and {LCI}, can help provide insight into the decision-making processes of {NLP} systems and identify areas for improvement. Finally, we identify areas for future research and development in this field in order to address the remaining limitations and challenges.},
181
- author = {{Baumgartner, Nina}},
182
- year = {2022},
183
- langid = {english}
184
- }
185
- ```
186
-
187
- ### Contributions
188
-
189
- Thanks to [@ninabaumgartner](https://github.com/ninabaumgartner) for adding this dataset.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
all/lower_court_insertion_swiss_judgment_prediction-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eaadbb24c971f17b9fa1f9f47fe401e4f88ce0fa7f6ec85914f80d12fb3af941
3
+ size 366292
data/lci_test.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
de/lower_court_insertion_swiss_judgment_prediction-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:35c94e0ccd52c1be4f01a7b0407725faa82c54e4e8344a719a72b2e8971c8e4f
3
+ size 124510
fr/lower_court_insertion_swiss_judgment_prediction-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7f11c1c9d894efaa0dd30d924e056cfd310acfa6a7f94aff830f76e086ec8bc8
3
+ size 131257
it/lower_court_insertion_swiss_judgment_prediction-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7a4e517014009e15dcea6716b1c72d162be914725934fd324ed1abde8c508df1
3
+ size 124719
lower_court_insertion_swiss_judgment_prediction.py DELETED
@@ -1,145 +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 Lower Court Insertion task."""
15
-
16
- import json
17
-
18
- import datasets
19
-
20
- logger = datasets.logging.get_logger(__name__)
21
-
22
- try:
23
- import lzma as xz
24
- except ImportError:
25
- import pylzma as xz
26
-
27
- # TODO: Add final BibTeX citation
28
- # Find for instance the citation on arxiv or on the dataset repo/website
29
- _CITATION = """\
30
- @misc{baumgartner_nina_occlusion_2022,
31
- title = {From Occlusion to Transparancy – An Occlusion-Based Explainability Approach for Legal Judgment Prediction in Switzerland},
32
- shorttitle = {From Occlusion to Transparancy},
33
- abstract = {Natural Language Processing ({NLP}) models have been used for more and more complex tasks such as Legal Judgment Prediction ({LJP}). A {LJP} model predicts the outcome of a legal case by utilizing its facts. This increasing deployment of Artificial Intelligence ({AI}) in high-stakes domains such as law and the involvement of sensitive data has increased the need for understanding such systems. We propose a multilingual occlusion-based explainability approach for {LJP} in Switzerland and conduct a study on the bias using Lower Court Insertion ({LCI}). We evaluate our results using different explainability metrics introduced in this thesis and by comparing them to high-quality Legal Expert Annotations using Inter Annotator Agreement. Our findings show that the model has a varying understanding of the semantic meaning and context of the facts section, and struggles to distinguish between legally relevant and irrelevant sentences. We also found that the insertion of a different lower court can have an effect on the prediction, but observed no distinct effects based on legal areas, cantons, or regions. However, we did identify a language disparity with Italian performing worse than the other languages due to representation inequality in the training data, which could lead to potential biases in the prediction in multilingual regions of Switzerland. Our results highlight the challenges and limitations of using {NLP} in the judicial field and the importance of addressing concerns about fairness, transparency, and potential bias in the development and use of {NLP} systems. The use of explainable artificial intelligence ({XAI}) techniques, such as occlusion and {LCI}, can help provide insight into the decision-making processes of {NLP} systems and identify areas for improvement. Finally, we identify areas for future research and development in this field in order to address the remaining limitations and challenges.},
34
- author = {{Baumgartner, Nina}},
35
- year = {2022},
36
- langid = {english}
37
- }
38
- """
39
-
40
- # You can copy an official description
41
- _DESCRIPTION = """\
42
- This dataset contains an implementation of lower court insertion for the SwissJudgmentPrediction task.
43
- """
44
- _LICENSE = "cc-by-sa-4.0"
45
-
46
- _LANGUAGES = [
47
- "de",
48
- "fr",
49
- "it",
50
- ]
51
-
52
- _URL = "https://huggingface.co/datasets/rcds/lower_court_insertion_swiss_judgment_prediction/resolve/main/data/"
53
-
54
- _URLS = {
55
- "test": _URL + "lci_test.jsonl"
56
- }
57
-
58
-
59
- class LowerCourtInsertionSwissJudgmentPredictionConfig(datasets.BuilderConfig):
60
- """BuilderConfig for LowerCourtInsertionSwissJudgmentPrediction."""
61
-
62
- def __init__(self, language: str, **kwargs):
63
- """BuilderConfig for LowerCourtInsertionSwissJudgmentPrediction.
64
- Args:
65
- language: One of de, fr, it, or all
66
- **kwargs: keyword arguments forwarded to super.
67
- """
68
- super(LowerCourtInsertionSwissJudgmentPredictionConfig, self).__init__(**kwargs)
69
- self.language = language
70
-
71
-
72
- class LowerCourtInsertionSwissJudgmentPrediction(datasets.GeneratorBasedBuilder):
73
- """This dataset contains court decision for the lower court insertion task in swiss judgment prediction"""
74
-
75
- VERSION = datasets.Version("1.1.0")
76
- BUILDER_CONFIG_CLASS = LowerCourtInsertionSwissJudgmentPredictionConfig
77
- BUILDER_CONFIGS = [
78
- LowerCourtInsertionSwissJudgmentPredictionConfig(
79
- name=lang,
80
- language=lang,
81
- version=datasets.Version("1.1.0", ""),
82
- description=f"Plain text import of OcclusionSwissJudgmentPrediction for the {lang} language",
83
- )
84
- for lang in _LANGUAGES
85
- ] + [
86
- LowerCourtInsertionSwissJudgmentPredictionConfig(
87
- name="all",
88
- language="all",
89
- version=datasets.Version("1.1.0", ""),
90
- description="Plain text import of OcclusionSwissJudgmentPrediction for all languages",
91
- )
92
- ]
93
-
94
- def _info(self):
95
- features = datasets.Features(
96
- {
97
- "id": datasets.Value("int32"),
98
- "year": datasets.Value("int32"),
99
- "label": datasets.Value("string"),
100
- "language": datasets.Value("string"),
101
- "region": datasets.Value("string"),
102
- "canton": datasets.Value("string"),
103
- "legal_area": datasets.Value("string"),
104
- "explainability_label": datasets.Value("string"),
105
- "lower_court": datasets.Value("string"),
106
- "text": datasets.Value("string")
107
-
108
- }
109
- )
110
- return datasets.DatasetInfo(
111
- description=_DESCRIPTION,
112
- features=features,
113
- supervised_keys=None,
114
- homepage="https://github.com/ninabaumgartner/SwissCourtRulingCorpus",
115
- license=_LICENSE,
116
- citation=_CITATION,
117
- )
118
-
119
- def _split_generators(self, dl_manager):
120
- # dl_manager is a datasets.download.DownloadManager that can be used to
121
- # download and extract URLs
122
- try:
123
- dl_dir = dl_manager.download(_URLS)
124
- except Exception:
125
- logger.warning(
126
- "If this download failed try a few times before reporting an issue"
127
- )
128
- raise
129
- return [
130
- datasets.SplitGenerator(
131
- name="test",
132
- # These kwargs will be passed to _generate_examples
133
- gen_kwargs={"filepath": dl_dir["test"]},
134
- ),
135
- ]
136
-
137
- def _generate_examples(self, filepath):
138
- """This function returns the examples in the raw (text) form."""
139
- if self.config.language in ["all"] + _LANGUAGES:
140
- with open(filepath, encoding="utf-8") as f:
141
- for id_, row in enumerate(f):
142
- data = json.loads(row)
143
- _ = data.setdefault("language", "n/a")
144
- if self.config.language in ["all"] or data["language"] == self.config.language:
145
- yield id_, data