polinaeterna HF staff parquet-converter commited on
Commit
d744792
0 Parent(s):

Duplicate from cail2018

Browse files

Co-authored-by: Parquet-converter (BOT) <parquet-converter@users.noreply.huggingface.co>

Files changed (4) hide show
  1. .gitattributes +27 -0
  2. README.md +184 -0
  3. cail2018.py +116 -0
  4. dataset_infos.json +1 -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,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - found
4
+ language_creators:
5
+ - found
6
+ language:
7
+ - zh
8
+ license:
9
+ - unknown
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - 1M<n<10M
14
+ source_datasets:
15
+ - original
16
+ task_categories:
17
+ - other
18
+ task_ids: []
19
+ paperswithcode_id: chinese-ai-and-law-cail-2018
20
+ pretty_name: CAIL 2018
21
+ tags:
22
+ - judgement-prediction
23
+ dataset_info:
24
+ features:
25
+ - name: fact
26
+ dtype: string
27
+ - name: relevant_articles
28
+ sequence: int32
29
+ - name: accusation
30
+ sequence: string
31
+ - name: punish_of_money
32
+ dtype: float32
33
+ - name: criminals
34
+ sequence: string
35
+ - name: death_penalty
36
+ dtype: bool
37
+ - name: imprisonment
38
+ dtype: float32
39
+ - name: life_imprisonment
40
+ dtype: bool
41
+ splits:
42
+ - name: exercise_contest_train
43
+ num_bytes: 220112732
44
+ num_examples: 154592
45
+ - name: exercise_contest_valid
46
+ num_bytes: 21702157
47
+ num_examples: 17131
48
+ - name: exercise_contest_test
49
+ num_bytes: 41057634
50
+ num_examples: 32508
51
+ - name: first_stage_train
52
+ num_bytes: 1779657510
53
+ num_examples: 1710856
54
+ - name: first_stage_test
55
+ num_bytes: 244335194
56
+ num_examples: 217016
57
+ - name: final_test
58
+ num_bytes: 44194707
59
+ num_examples: 35922
60
+ download_size: 984551626
61
+ dataset_size: 2351059934
62
+ ---
63
+ ---
64
+ # Dataset Card for CAIL 2018
65
+
66
+ ## Table of Contents
67
+ - [Dataset Description](#dataset-description)
68
+ - [Dataset Summary](#dataset-summary)
69
+ - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
70
+ - [Languages](#languages)
71
+ - [Dataset Structure](#dataset-structure)
72
+ - [Data Instances](#data-instances)
73
+ - [Data Fields](#data-fields)
74
+ - [Data Splits](#data-splits)
75
+ - [Dataset Creation](#dataset-creation)
76
+ - [Curation Rationale](#curation-rationale)
77
+ - [Source Data](#source-data)
78
+ - [Annotations](#annotations)
79
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
80
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
81
+ - [Social Impact of Dataset](#social-impact-of-dataset)
82
+ - [Discussion of Biases](#discussion-of-biases)
83
+ - [Other Known Limitations](#other-known-limitations)
84
+ - [Additional Information](#additional-information)
85
+ - [Dataset Curators](#dataset-curators)
86
+ - [Licensing Information](#licensing-information)
87
+ - [Citation Information](#citation-information)
88
+ - [Contributions](#contributions)
89
+
90
+ ## Dataset Description
91
+
92
+ - **Homepage:** [Github](https://github.com/thunlp/CAIL/blob/master/README_en.md)
93
+ - **Repository:** [Github](https://github.com/thunlp/CAIL)
94
+ - **Paper:** [Arxiv](https://arxiv.org/abs/1807.02478)
95
+ - **Leaderboard:**
96
+ - **Point of Contact:**
97
+
98
+ ### Dataset Summary
99
+
100
+ [More Information Needed]
101
+
102
+ ### Supported Tasks and Leaderboards
103
+
104
+ [More Information Needed]
105
+
106
+ ### Languages
107
+
108
+ [More Information Needed]
109
+
110
+ ## Dataset Structure
111
+
112
+ ### Data Instances
113
+
114
+ [More Information Needed]
115
+
116
+ ### Data Fields
117
+
118
+ [More Information Needed]
119
+
120
+ ### Data Splits
121
+
122
+ [More Information Needed]
123
+
124
+ ## Dataset Creation
125
+
126
+ ### Curation Rationale
127
+
128
+ [More Information Needed]
129
+
130
+ ### Source Data
131
+
132
+ #### Initial Data Collection and Normalization
133
+
134
+ [More Information Needed]
135
+
136
+ #### Who are the source language producers?
137
+
138
+ [More Information Needed]
139
+
140
+ ### Annotations
141
+
142
+ #### Annotation process
143
+
144
+ [More Information Needed]
145
+
146
+ #### Who are the annotators?
147
+
148
+ [More Information Needed]
149
+
150
+ ### Personal and Sensitive Information
151
+
152
+ [More Information Needed]
153
+
154
+ ## Considerations for Using the Data
155
+
156
+ ### Social Impact of Dataset
157
+
158
+ [More Information Needed]
159
+
160
+ ### Discussion of Biases
161
+
162
+ [More Information Needed]
163
+
164
+ ### Other Known Limitations
165
+
166
+ [More Information Needed]
167
+
168
+ ## Additional Information
169
+
170
+ ### Dataset Curators
171
+
172
+ [More Information Needed]
173
+
174
+ ### Licensing Information
175
+
176
+ [More Information Needed]
177
+
178
+ ### Citation Information
179
+
180
+ [More Information Needed]
181
+
182
+ ### Contributions
183
+
184
+ Thanks to [@JetRunner](https://github.com/JetRunner) for adding this dataset.
cail2018.py ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import os
3
+
4
+ import datasets
5
+
6
+
7
+ _CITATION = """\
8
+ @misc{xiao2018cail2018,
9
+ title={CAIL2018: A Large-Scale Legal Dataset for Judgment Prediction},
10
+ author={Chaojun Xiao and Haoxi Zhong and Zhipeng Guo and Cunchao Tu and Zhiyuan Liu and Maosong Sun and Yansong Feng and Xianpei Han and Zhen Hu and Heng Wang and Jianfeng Xu},
11
+ year={2018},
12
+ eprint={1807.02478},
13
+ archivePrefix={arXiv},
14
+ primaryClass={cs.CL}
15
+ }
16
+ """
17
+
18
+ _DESCRIPTION = """\
19
+ In this paper, we introduce Chinese AI and Law challenge dataset (CAIL2018),
20
+ the first large-scale Chinese legal dataset for judgment prediction. CAIL contains more than 2.6 million
21
+ criminal cases published by the Supreme People's Court of China, which are several times larger than other
22
+ datasets in existing works on judgment prediction. Moreover, the annotations of judgment results are more
23
+ detailed and rich. It consists of applicable law articles, charges, and prison terms, which are expected
24
+ to be inferred according to the fact descriptions of cases. For comparison, we implement several conventional
25
+ text classification baselines for judgment prediction and experimental results show that it is still a
26
+ challenge for current models to predict the judgment results of legal cases, especially on prison terms.
27
+ To help the researchers make improvements on legal judgment prediction.
28
+ """
29
+ _URL = "https://cail.oss-cn-qingdao.aliyuncs.com/CAIL2018_ALL_DATA.zip"
30
+
31
+
32
+ class Cail2018(datasets.GeneratorBasedBuilder):
33
+ VERSION = datasets.Version("1.0.0")
34
+
35
+ def _info(self):
36
+ features = datasets.Features(
37
+ {
38
+ "fact": datasets.Value("string"),
39
+ "relevant_articles": datasets.Sequence(datasets.Value("int32")),
40
+ "accusation": datasets.Sequence(datasets.Value("string")),
41
+ "punish_of_money": datasets.Value("float"),
42
+ "criminals": datasets.Sequence(datasets.Value("string")),
43
+ "death_penalty": datasets.Value("bool"),
44
+ "imprisonment": datasets.Value("float"),
45
+ "life_imprisonment": datasets.Value("bool"),
46
+ }
47
+ )
48
+ return datasets.DatasetInfo(
49
+ description=_DESCRIPTION,
50
+ features=features,
51
+ homepage="https://arxiv.org/abs/1807.02478",
52
+ citation=_CITATION,
53
+ )
54
+
55
+ def _split_generators(self, dl_manager):
56
+ """Returns SplitGenerators."""
57
+
58
+ dl_dir = dl_manager.download_and_extract(_URL)
59
+
60
+ return [
61
+ datasets.SplitGenerator(
62
+ name=datasets.Split("exercise_contest_train"),
63
+ gen_kwargs={
64
+ "filepath": os.path.join(dl_dir, "final_all_data/exercise_contest/data_train.json"),
65
+ "split": "exercise_contest_train",
66
+ },
67
+ ),
68
+ datasets.SplitGenerator(
69
+ name=datasets.Split("exercise_contest_valid"),
70
+ gen_kwargs={
71
+ "filepath": os.path.join(dl_dir, "final_all_data/exercise_contest/data_valid.json"),
72
+ "split": "exercise_contest_valid",
73
+ },
74
+ ),
75
+ datasets.SplitGenerator(
76
+ name=datasets.Split("exercise_contest_test"),
77
+ gen_kwargs={
78
+ "filepath": os.path.join(dl_dir, "final_all_data/exercise_contest/data_test.json"),
79
+ "split": "exercise_contest_test",
80
+ },
81
+ ),
82
+ datasets.SplitGenerator(
83
+ name=datasets.Split("first_stage_train"),
84
+ gen_kwargs={
85
+ "filepath": os.path.join(dl_dir, "final_all_data/first_stage/train.json"),
86
+ "split": "first_stage_train",
87
+ },
88
+ ),
89
+ datasets.SplitGenerator(
90
+ name=datasets.Split("first_stage_test"),
91
+ gen_kwargs={
92
+ "filepath": os.path.join(dl_dir, "final_all_data/first_stage/test.json"),
93
+ "split": "first_stage_test",
94
+ },
95
+ ),
96
+ datasets.SplitGenerator(
97
+ name=datasets.Split("final_test"),
98
+ gen_kwargs={"filepath": os.path.join(dl_dir, "final_all_data/final_test.json"), "split": "final_test"},
99
+ ),
100
+ ]
101
+
102
+ def _generate_examples(self, filepath, split):
103
+ """Yields examples."""
104
+ with open(filepath, encoding="utf-8") as f:
105
+ for idx, row in enumerate(f):
106
+ data = json.loads(row)
107
+ yield idx, {
108
+ "fact": data["fact"],
109
+ "relevant_articles": data["meta"]["relevant_articles"],
110
+ "accusation": data["meta"]["accusation"],
111
+ "punish_of_money": data["meta"]["punish_of_money"],
112
+ "criminals": data["meta"]["criminals"],
113
+ "death_penalty": data["meta"]["term_of_imprisonment"]["death_penalty"],
114
+ "imprisonment": data["meta"]["term_of_imprisonment"]["imprisonment"],
115
+ "life_imprisonment": data["meta"]["term_of_imprisonment"]["life_imprisonment"],
116
+ }
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"default": {"description": "In this paper, we introduce Chinese AI and Law challenge dataset (CAIL2018),\nthe first large-scale Chinese legal dataset for judgment prediction. CAIL contains more than 2.6 million\ncriminal cases published by the Supreme People's Court of China, which are several times larger than other\ndatasets in existing works on judgment prediction. Moreover, the annotations of judgment results are more\ndetailed and rich. It consists of applicable law articles, charges, and prison terms, which are expected\nto be inferred according to the fact descriptions of cases. For comparison, we implement several conventional\ntext classification baselines for judgment prediction and experimental results show that it is still a\nchallenge for current models to predict the judgment results of legal cases, especially on prison terms.\nTo help the researchers make improvements on legal judgment prediction.\n", "citation": "@misc{xiao2018cail2018,\n title={CAIL2018: A Large-Scale Legal Dataset for Judgment Prediction}, \n author={Chaojun Xiao and Haoxi Zhong and Zhipeng Guo and Cunchao Tu and Zhiyuan Liu and Maosong Sun and Yansong Feng and Xianpei Han and Zhen Hu and Heng Wang and Jianfeng Xu},\n year={2018},\n eprint={1807.02478},\n archivePrefix={arXiv},\n primaryClass={cs.CL}\n}\n", "homepage": "https://arxiv.org/abs/1807.02478", "license": "", "features": {"fact": {"dtype": "string", "id": null, "_type": "Value"}, "relevant_articles": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "accusation": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "punish_of_money": {"dtype": "float32", "id": null, "_type": "Value"}, "criminals": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "death_penalty": {"dtype": "bool", "id": null, "_type": "Value"}, "imprisonment": {"dtype": "float32", "id": null, "_type": "Value"}, "life_imprisonment": {"dtype": "bool", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "cail2018", "config_name": "default", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"exercise_contest_train": {"name": "exercise_contest_train", "num_bytes": 220112732, "num_examples": 154592, "dataset_name": "cail2018"}, "exercise_contest_valid": {"name": "exercise_contest_valid", "num_bytes": 21702157, "num_examples": 17131, "dataset_name": "cail2018"}, "exercise_contest_test": {"name": "exercise_contest_test", "num_bytes": 41057634, "num_examples": 32508, "dataset_name": "cail2018"}, "first_stage_train": {"name": "first_stage_train", "num_bytes": 1779657510, "num_examples": 1710856, "dataset_name": "cail2018"}, "first_stage_test": {"name": "first_stage_test", "num_bytes": 244335194, "num_examples": 217016, "dataset_name": "cail2018"}, "final_test": {"name": "final_test", "num_bytes": 44194707, "num_examples": 35922, "dataset_name": "cail2018"}}, "download_checksums": {"https://cail.oss-cn-qingdao.aliyuncs.com/CAIL2018_ALL_DATA.zip": {"num_bytes": 984551626, "checksum": "3c05dfdade742f8b0d5e782d174475e7769448a5f407bfb7f14f0aed72d61d4a"}}, "download_size": 984551626, "post_processing_size": null, "dataset_size": 2351059934, "size_in_bytes": 3335611560}}