Datasets:
Tasks:
Text Classification
Sub-tasks:
multi-label-classification
Languages:
English
Size:
10K<n<100K
ArXiv:
License:
Convert dataset to Parquet
#3
by
01Matrix
- opened
- README.md +28 -10
- alleged-violation-prediction/test-00000-of-00001.parquet +3 -0
- alleged-violation-prediction/train-00000-of-00001.parquet +3 -0
- alleged-violation-prediction/validation-00000-of-00001.parquet +3 -0
- ecthr_cases.py +0 -199
- violation-prediction/test-00000-of-00001.parquet +3 -0
- violation-prediction/train-00000-of-00001.parquet +3 -0
- violation-prediction/validation-00000-of-00001.parquet +3 -0
README.md
CHANGED
|
@@ -36,16 +36,16 @@ dataset_info:
|
|
| 36 |
sequence: int32
|
| 37 |
splits:
|
| 38 |
- name: train
|
| 39 |
-
num_bytes:
|
| 40 |
num_examples: 9000
|
| 41 |
- name: test
|
| 42 |
-
num_bytes:
|
| 43 |
num_examples: 1000
|
| 44 |
- name: validation
|
| 45 |
-
num_bytes:
|
| 46 |
num_examples: 1000
|
| 47 |
-
download_size:
|
| 48 |
-
dataset_size:
|
| 49 |
- config_name: violation-prediction
|
| 50 |
features:
|
| 51 |
- name: facts
|
|
@@ -56,16 +56,34 @@ dataset_info:
|
|
| 56 |
sequence: int32
|
| 57 |
splits:
|
| 58 |
- name: train
|
| 59 |
-
num_bytes:
|
| 60 |
num_examples: 9000
|
| 61 |
- name: test
|
| 62 |
-
num_bytes:
|
| 63 |
num_examples: 1000
|
| 64 |
- name: validation
|
| 65 |
-
num_bytes:
|
| 66 |
num_examples: 1000
|
| 67 |
-
download_size:
|
| 68 |
-
dataset_size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
---
|
| 70 |
|
| 71 |
# Dataset Card for the ECtHR cases dataset
|
|
|
|
| 36 |
sequence: int32
|
| 37 |
splits:
|
| 38 |
- name: train
|
| 39 |
+
num_bytes: 89835114
|
| 40 |
num_examples: 9000
|
| 41 |
- name: test
|
| 42 |
+
num_bytes: 11917574
|
| 43 |
num_examples: 1000
|
| 44 |
- name: validation
|
| 45 |
+
num_bytes: 11015846
|
| 46 |
num_examples: 1000
|
| 47 |
+
download_size: 53421279
|
| 48 |
+
dataset_size: 112768534
|
| 49 |
- config_name: violation-prediction
|
| 50 |
features:
|
| 51 |
- name: facts
|
|
|
|
| 56 |
sequence: int32
|
| 57 |
splits:
|
| 58 |
- name: train
|
| 59 |
+
num_bytes: 89776390
|
| 60 |
num_examples: 9000
|
| 61 |
- name: test
|
| 62 |
+
num_bytes: 11909294
|
| 63 |
num_examples: 1000
|
| 64 |
- name: validation
|
| 65 |
+
num_bytes: 11009330
|
| 66 |
num_examples: 1000
|
| 67 |
+
download_size: 53415379
|
| 68 |
+
dataset_size: 112695014
|
| 69 |
+
configs:
|
| 70 |
+
- config_name: alleged-violation-prediction
|
| 71 |
+
data_files:
|
| 72 |
+
- split: train
|
| 73 |
+
path: alleged-violation-prediction/train-*
|
| 74 |
+
- split: test
|
| 75 |
+
path: alleged-violation-prediction/test-*
|
| 76 |
+
- split: validation
|
| 77 |
+
path: alleged-violation-prediction/validation-*
|
| 78 |
+
default: true
|
| 79 |
+
- config_name: violation-prediction
|
| 80 |
+
data_files:
|
| 81 |
+
- split: train
|
| 82 |
+
path: violation-prediction/train-*
|
| 83 |
+
- split: test
|
| 84 |
+
path: violation-prediction/test-*
|
| 85 |
+
- split: validation
|
| 86 |
+
path: violation-prediction/validation-*
|
| 87 |
---
|
| 88 |
|
| 89 |
# Dataset Card for the ECtHR cases dataset
|
alleged-violation-prediction/test-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:259970b92d1f78065c7d9bcf5307c6db0f5d6f42bef762184f058d460b123f6f
|
| 3 |
+
size 5686152
|
alleged-violation-prediction/train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:69ca4902cfd72cc1d1e82e9e80a5e38165461e4d38d0d962c1b596a2dd507ca3
|
| 3 |
+
size 42467055
|
alleged-violation-prediction/validation-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9422cf41236fc75932964eae87722dc30a4a5bf52eeec0276a2b439e24a4a5be
|
| 3 |
+
size 5268072
|
ecthr_cases.py
DELETED
|
@@ -1,199 +0,0 @@
|
|
| 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 |
-
"""The ECtHR Cases dataset is designed for experimentation of neural judgment prediction and rationale extraction considering ECtHR cases."""
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
import json
|
| 19 |
-
import os
|
| 20 |
-
|
| 21 |
-
import datasets
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
_CITATION = """\
|
| 25 |
-
@InProceedings{chalkidis-et-al-2021-ecthr,
|
| 26 |
-
title = "Paragraph-level Rationale Extraction through Regularization: A case study on European Court of Human Rights Cases",
|
| 27 |
-
author = "Chalkidis, Ilias and Fergadiotis, Manos and Tsarapatsanis, Dimitrios and Aletras, Nikolaos and Androutsopoulos, Ion and Malakasiotis, Prodromos",
|
| 28 |
-
booktitle = "Proceedings of the Annual Conference of the North American Chapter of the Association for Computational Linguistics",
|
| 29 |
-
year = "2021",
|
| 30 |
-
address = "Mexico City, Mexico",
|
| 31 |
-
publisher = "Association for Computational Linguistics"
|
| 32 |
-
}
|
| 33 |
-
"""
|
| 34 |
-
|
| 35 |
-
_DESCRIPTION = """\
|
| 36 |
-
The ECtHR Cases dataset is designed for experimentation of neural judgment prediction and rationale extraction considering ECtHR cases.
|
| 37 |
-
"""
|
| 38 |
-
|
| 39 |
-
_HOMEPAGE = "http://archive.org/details/ECtHR-NAACL2021/"
|
| 40 |
-
|
| 41 |
-
_LICENSE = "CC BY-NC-SA (Creative Commons / Attribution-NonCommercial-ShareAlike)"
|
| 42 |
-
|
| 43 |
-
_URLs = {
|
| 44 |
-
"alleged-violation-prediction": "http://archive.org/download/ECtHR-NAACL2021/dataset.zip",
|
| 45 |
-
"violation-prediction": "http://archive.org/download/ECtHR-NAACL2021/dataset.zip",
|
| 46 |
-
}
|
| 47 |
-
|
| 48 |
-
ARTICLES = {
|
| 49 |
-
"2": "Right to life",
|
| 50 |
-
"3": "Prohibition of torture",
|
| 51 |
-
"4": "Prohibition of slavery and forced labour",
|
| 52 |
-
"5": "Right to liberty and security",
|
| 53 |
-
"6": "Right to a fair trial",
|
| 54 |
-
"7": "No punishment without law",
|
| 55 |
-
"8": "Right to respect for private and family life",
|
| 56 |
-
"9": "Freedom of thought, conscience and religion",
|
| 57 |
-
"10": "Freedom of expression",
|
| 58 |
-
"11": "Freedom of assembly and association",
|
| 59 |
-
"12": "Right to marry",
|
| 60 |
-
"13": "Right to an effective remedy",
|
| 61 |
-
"14": "Prohibition of discrimination",
|
| 62 |
-
"15": "Derogation in time of emergency",
|
| 63 |
-
"16": "Restrictions on political activity of aliens",
|
| 64 |
-
"17": "Prohibition of abuse of rights",
|
| 65 |
-
"18": "Limitation on use of restrictions on rights",
|
| 66 |
-
"34": "Individual applications",
|
| 67 |
-
"38": "Examination of the case",
|
| 68 |
-
"39": "Friendly settlements",
|
| 69 |
-
"46": "Binding force and execution of judgments",
|
| 70 |
-
"P1-1": "Protection of property",
|
| 71 |
-
"P1-2": "Right to education",
|
| 72 |
-
"P1-3": "Right to free elections",
|
| 73 |
-
"P3-1": "Right to free elections",
|
| 74 |
-
"P4-1": "Prohibition of imprisonment for debt",
|
| 75 |
-
"P4-2": "Freedom of movement",
|
| 76 |
-
"P4-3": "Prohibition of expulsion of nationals",
|
| 77 |
-
"P4-4": "Prohibition of collective expulsion of aliens",
|
| 78 |
-
"P6-1": "Abolition of the death penalty",
|
| 79 |
-
"P6-2": "Death penalty in time of war",
|
| 80 |
-
"P6-3": "Prohibition of derogations",
|
| 81 |
-
"P7-1": "Procedural safeguards relating to expulsion of aliens",
|
| 82 |
-
"P7-2": "Right of appeal in criminal matters",
|
| 83 |
-
"P7-3": "Compensation for wrongful conviction",
|
| 84 |
-
"P7-4": "Right not to be tried or punished twice",
|
| 85 |
-
"P7-5": "Equality between spouses",
|
| 86 |
-
"P12-1": "General prohibition of discrimination",
|
| 87 |
-
"P13-1": "Abolition of the death penalty",
|
| 88 |
-
"P13-2": "Prohibition of derogations",
|
| 89 |
-
"P13-3": "Prohibition of reservations",
|
| 90 |
-
}
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
# TODO: Name of the dataset usually match the script name with CamelCase instead of snake_case
|
| 94 |
-
class EcthrCases(datasets.GeneratorBasedBuilder):
|
| 95 |
-
"""The ECtHR Cases dataset is designed for experimentation of neural judgment prediction and rationale extraction considering ECtHR cases."""
|
| 96 |
-
|
| 97 |
-
VERSION = datasets.Version("1.1.0")
|
| 98 |
-
|
| 99 |
-
BUILDER_CONFIGS = [
|
| 100 |
-
datasets.BuilderConfig(
|
| 101 |
-
name="alleged-violation-prediction",
|
| 102 |
-
version=VERSION,
|
| 103 |
-
description="This part of the dataset covers alleged violation prediction",
|
| 104 |
-
),
|
| 105 |
-
datasets.BuilderConfig(
|
| 106 |
-
name="violation-prediction",
|
| 107 |
-
version=VERSION,
|
| 108 |
-
description="This part of the dataset covers violation prediction",
|
| 109 |
-
),
|
| 110 |
-
]
|
| 111 |
-
|
| 112 |
-
DEFAULT_CONFIG_NAME = "alleged-violation-prediction"
|
| 113 |
-
|
| 114 |
-
def _info(self):
|
| 115 |
-
if self.config.name == "alleged-violation-prediction":
|
| 116 |
-
features = datasets.Features(
|
| 117 |
-
{
|
| 118 |
-
"facts": datasets.features.Sequence(datasets.Value("string")),
|
| 119 |
-
"labels": datasets.features.Sequence(datasets.Value("string")),
|
| 120 |
-
"silver_rationales": datasets.features.Sequence(datasets.Value("int32")),
|
| 121 |
-
"gold_rationales": datasets.features.Sequence(datasets.Value("int32"))
|
| 122 |
-
# These are the features of your dataset like images, labels ...
|
| 123 |
-
}
|
| 124 |
-
)
|
| 125 |
-
else:
|
| 126 |
-
features = datasets.Features(
|
| 127 |
-
{
|
| 128 |
-
"facts": datasets.features.Sequence(datasets.Value("string")),
|
| 129 |
-
"labels": datasets.features.Sequence(datasets.Value("string")),
|
| 130 |
-
"silver_rationales": datasets.features.Sequence(datasets.Value("int32"))
|
| 131 |
-
# These are the features of your dataset like images, labels ...
|
| 132 |
-
}
|
| 133 |
-
)
|
| 134 |
-
return datasets.DatasetInfo(
|
| 135 |
-
# This is the description that will appear on the datasets page.
|
| 136 |
-
description=_DESCRIPTION,
|
| 137 |
-
# This defines the different columns of the dataset and their types
|
| 138 |
-
features=features, # Here we define them above because they are different between the two configurations
|
| 139 |
-
# If there's a common (input, target) tuple from the features,
|
| 140 |
-
# specify them here. They'll be used if as_supervised=True in
|
| 141 |
-
# builder.as_dataset.
|
| 142 |
-
supervised_keys=None,
|
| 143 |
-
# Homepage of the dataset for documentation
|
| 144 |
-
homepage=_HOMEPAGE,
|
| 145 |
-
# License for the dataset if available
|
| 146 |
-
license=_LICENSE,
|
| 147 |
-
# Citation for the dataset
|
| 148 |
-
citation=_CITATION,
|
| 149 |
-
)
|
| 150 |
-
|
| 151 |
-
def _split_generators(self, dl_manager):
|
| 152 |
-
"""Returns SplitGenerators."""
|
| 153 |
-
my_urls = _URLs[self.config.name]
|
| 154 |
-
data_dir = dl_manager.download_and_extract(my_urls)
|
| 155 |
-
return [
|
| 156 |
-
datasets.SplitGenerator(
|
| 157 |
-
name=datasets.Split.TRAIN,
|
| 158 |
-
# These kwargs will be passed to _generate_examples
|
| 159 |
-
gen_kwargs={
|
| 160 |
-
"filepath": os.path.join(data_dir, "train.jsonl"),
|
| 161 |
-
"split": "train",
|
| 162 |
-
},
|
| 163 |
-
),
|
| 164 |
-
datasets.SplitGenerator(
|
| 165 |
-
name=datasets.Split.TEST,
|
| 166 |
-
# These kwargs will be passed to _generate_examples
|
| 167 |
-
gen_kwargs={"filepath": os.path.join(data_dir, "test.jsonl"), "split": "test"},
|
| 168 |
-
),
|
| 169 |
-
datasets.SplitGenerator(
|
| 170 |
-
name=datasets.Split.VALIDATION,
|
| 171 |
-
# These kwargs will be passed to _generate_examples
|
| 172 |
-
gen_kwargs={
|
| 173 |
-
"filepath": os.path.join(data_dir, "dev.jsonl"),
|
| 174 |
-
"split": "dev",
|
| 175 |
-
},
|
| 176 |
-
),
|
| 177 |
-
]
|
| 178 |
-
|
| 179 |
-
def _generate_examples(
|
| 180 |
-
self, filepath, split # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
| 181 |
-
):
|
| 182 |
-
"""Yields examples as (key, example) tuples."""
|
| 183 |
-
|
| 184 |
-
with open(filepath, encoding="utf-8") as f:
|
| 185 |
-
for id_, row in enumerate(f):
|
| 186 |
-
data = json.loads(row)
|
| 187 |
-
if self.config.name == "alleged-violation-prediction":
|
| 188 |
-
yield id_, {
|
| 189 |
-
"facts": data["facts"],
|
| 190 |
-
"labels": data["allegedly_violated_articles"],
|
| 191 |
-
"silver_rationales": data["silver_rationales"],
|
| 192 |
-
"gold_rationales": data["gold_rationales"],
|
| 193 |
-
}
|
| 194 |
-
else:
|
| 195 |
-
yield id_, {
|
| 196 |
-
"facts": data["facts"],
|
| 197 |
-
"labels": data["violated_articles"],
|
| 198 |
-
"silver_rationales": data["silver_rationales"],
|
| 199 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
violation-prediction/test-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3db29411ea67275773aa1099e8034bf7e03575eff7829be2bb3de2a8cac1d59e
|
| 3 |
+
size 5684672
|
violation-prediction/train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a1f6850a8458bfaccc704353e4b2dd46bbb5c98d0d76b8e3868cab235c7e4a63
|
| 3 |
+
size 42463303
|
violation-prediction/validation-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:04b89106477bafaceb011d63afc1ce86dbb3c243929fe09c2467abcc0bcfeb4c
|
| 3 |
+
size 5267404
|