albertvillanova HF staff commited on
Commit
775098d
1 Parent(s): 148a68f

Convert dataset to Parquet (#2)

Browse files

- Convert dataset to Parquet (b689f32b082b05df49ff3e94f09793fe275fe492)
- Delete loading script (0288b0aa9dd81bf2e3bef02c97ada97147661850)
- Delete legacy dataset_infos.json (b8d09e8daaece833a931cd9e4d11af183f472c25)

README.md CHANGED
@@ -40,25 +40,40 @@ dataset_info:
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
40
  dtype: bool
41
  splits:
42
  - name: exercise_contest_train
43
+ num_bytes: 220112348
44
  num_examples: 154592
45
  - name: exercise_contest_valid
46
+ num_bytes: 21702109
47
  num_examples: 17131
48
  - name: exercise_contest_test
49
+ num_bytes: 41057538
50
  num_examples: 32508
51
  - name: first_stage_train
52
+ num_bytes: 1779653382
53
  num_examples: 1710856
54
  - name: first_stage_test
55
+ num_bytes: 244334666
56
  num_examples: 217016
57
  - name: final_test
58
+ num_bytes: 44194611
59
  num_examples: 35922
60
+ download_size: 1167828091
61
+ dataset_size: 2351054654
62
+ configs:
63
+ - config_name: default
64
+ data_files:
65
+ - split: exercise_contest_train
66
+ path: data/exercise_contest_train-*
67
+ - split: exercise_contest_valid
68
+ path: data/exercise_contest_valid-*
69
+ - split: exercise_contest_test
70
+ path: data/exercise_contest_test-*
71
+ - split: first_stage_train
72
+ path: data/first_stage_train-*
73
+ - split: first_stage_test
74
+ path: data/first_stage_test-*
75
+ - split: final_test
76
+ path: data/final_test-*
77
  ---
78
  ---
79
  # Dataset Card for CAIL 2018
cail2018.py DELETED
@@ -1,116 +0,0 @@
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
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
data/exercise_contest_test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e077299eeda80a12ee4e529cd1e052101e586d7f239fda8e2782ee5581106350
3
+ size 21036060
data/exercise_contest_train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b1b9803f777e484b22034e1c11fc2ae4449341ce0b78a545c3fe994b3394b5f8
3
+ size 112387981
data/exercise_contest_valid-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f0f1c3136c58dc1d84b540bfbbe290dd5d5cccc17512e8d6ef3b1462f90537df
3
+ size 10851075
data/final_test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9874ea0df4835b438fe394cba99efe9d8f65d259f8d8177fc6939bd8f83d073a
3
+ size 20383366
data/first_stage_test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec710ad1a45d5b2f9a87499fc07d63836c006415a9a2413c4fd6e8bcfa693cae
3
+ size 120551158
data/first_stage_train-00000-of-00004.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c16398cf930e462eca9d2dc8fdc312bd0624758db087629444b276181c0cd9e5
3
+ size 224570610
data/first_stage_train-00001-of-00004.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca0f9f1aadc756e1947fee58335f2417fe90852bba9e84163a1f7183c3ea2039
3
+ size 210488513
data/first_stage_train-00002-of-00004.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5324ce52cab740e0b4ad29338522ed9811aee451c4dfdbd923e48edbc6232e64
3
+ size 193101855
data/first_stage_train-00003-of-00004.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d52d7b3f96df5d7477145af51ae42d0a37b60c89f9b6c2b6bf73f2d94c7ccc44
3
+ size 254457473
dataset_infos.json DELETED
@@ -1 +0,0 @@
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}}