Julian von der Goltz commited on
Commit
6e893d8
1 Parent(s): 5ca4394

Use parquet

Browse files
README.md CHANGED
@@ -85,9 +85,9 @@ configs:
85
  - config_name: default
86
  data_files:
87
  - split: train
88
- path: data/train/data*
89
  - split: validation
90
- path: data/validation/data*
91
  task_categories:
92
  - text-generation
93
  - fill-mask
 
85
  - config_name: default
86
  data_files:
87
  - split: train
88
+ path: data/train*
89
  - split: validation
90
+ path: data/validation*
91
  task_categories:
92
  - text-generation
93
  - fill-mask
data/{train/data-00000-of-00002.arrow → train.parquet} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:d4f204beb10890b715b4cd82d3f14ed28d31fac0aa42f6dd3d929e8af9b695e1
3
- size 377355400
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eb8ac2472b2df57f694e4cf87c307134ecd0325d4ca73528f75f5061510f3200
3
+ size 296246266
data/train/data-00001-of-00002.arrow DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:537dd53cfdf036ffd64d9d0dfb475a6bca75d59d48b6dea829588fd12fca96be
3
- size 238560632
 
 
 
 
data/train/dataset_info.json DELETED
@@ -1,184 +0,0 @@
1
- {
2
- "builder_name": "json",
3
- "citation": "",
4
- "config_name": "default",
5
- "dataset_name": "json",
6
- "dataset_size": 615370214,
7
- "description": "",
8
- "download_checksums": {
9
- "/home/julian/repos/dbnl.org-dutch-public-domain-collection/src/tmp/train.jsonl": {
10
- "num_bytes": 720222877,
11
- "checksum": null
12
- }
13
- },
14
- "download_size": 720222877,
15
- "features": {
16
- "meta": {
17
- "ti_id": {
18
- "dtype": "string",
19
- "_type": "Value"
20
- },
21
- "titel": {
22
- "dtype": "string",
23
- "_type": "Value"
24
- },
25
- "vols": {
26
- "dtype": "string",
27
- "_type": "Value"
28
- },
29
- "jaar": {
30
- "dtype": "string",
31
- "_type": "Value"
32
- },
33
- "druk": {
34
- "dtype": "string",
35
- "_type": "Value"
36
- },
37
- "ppn_o": {
38
- "dtype": "string",
39
- "_type": "Value"
40
- },
41
- "bibliotheek": {
42
- "dtype": "string",
43
- "_type": "Value"
44
- },
45
- "categorie": {
46
- "dtype": "int64",
47
- "_type": "Value"
48
- },
49
- "_jaar": {
50
- "dtype": "int64",
51
- "_type": "Value"
52
- },
53
- "pers_id": {
54
- "dtype": "string",
55
- "_type": "Value"
56
- },
57
- "voornaam": {
58
- "dtype": "string",
59
- "_type": "Value"
60
- },
61
- "voorvoegsel": {
62
- "dtype": "string",
63
- "_type": "Value"
64
- },
65
- "achternaam": {
66
- "dtype": "string",
67
- "_type": "Value"
68
- },
69
- "jaar_geboren": {
70
- "dtype": "string",
71
- "_type": "Value"
72
- },
73
- "jaar_overlijden": {
74
- "dtype": "string",
75
- "_type": "Value"
76
- },
77
- "geb_datum": {
78
- "dtype": "string",
79
- "_type": "Value"
80
- },
81
- "overl_datum": {
82
- "dtype": "string",
83
- "_type": "Value"
84
- },
85
- "geb_plaats": {
86
- "dtype": "string",
87
- "_type": "Value"
88
- },
89
- "overl_plaats": {
90
- "dtype": "string",
91
- "_type": "Value"
92
- },
93
- "geb_plaats_code": {
94
- "dtype": "string",
95
- "_type": "Value"
96
- },
97
- "geb_land_code": {
98
- "dtype": "string",
99
- "_type": "Value"
100
- },
101
- "overl_plaats_code": {
102
- "dtype": "string",
103
- "_type": "Value"
104
- },
105
- "overl_land_code": {
106
- "dtype": "string",
107
- "_type": "Value"
108
- },
109
- "vrouw": {
110
- "dtype": "int64",
111
- "_type": "Value"
112
- },
113
- "url": {
114
- "dtype": "string",
115
- "_type": "Value"
116
- },
117
- "text_url": {
118
- "dtype": "string",
119
- "_type": "Value"
120
- },
121
- "maand": {
122
- "dtype": "string",
123
- "_type": "Value"
124
- },
125
- "genre": {
126
- "dtype": "string",
127
- "_type": "Value"
128
- },
129
- "Unnamed: 28": {
130
- "dtype": "string",
131
- "_type": "Value"
132
- },
133
- "revision_date": {
134
- "dtype": "timestamp[s]",
135
- "_type": "Value"
136
- },
137
- "edition": {
138
- "dtype": "string",
139
- "_type": "Value"
140
- },
141
- "language": {
142
- "dtype": "string",
143
- "_type": "Value"
144
- },
145
- "chapter": {
146
- "dtype": "int64",
147
- "_type": "Value"
148
- },
149
- "section": {
150
- "dtype": "int64",
151
- "_type": "Value"
152
- }
153
- },
154
- "text": {
155
- "dtype": "string",
156
- "_type": "Value"
157
- },
158
- "id": {
159
- "dtype": "string",
160
- "_type": "Value"
161
- }
162
- },
163
- "homepage": "",
164
- "license": "",
165
- "size_in_bytes": 1335593091,
166
- "splits": {
167
- "train": {
168
- "name": "train",
169
- "num_bytes": 615370214,
170
- "num_examples": 206086,
171
- "shard_lengths": [
172
- 149790,
173
- 56296
174
- ],
175
- "dataset_name": "json"
176
- }
177
- },
178
- "version": {
179
- "version_str": "0.0.0",
180
- "major": 0,
181
- "minor": 0,
182
- "patch": 0
183
- }
184
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
data/train/state.json DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "_data_files": [
3
- {
4
- "filename": "data-00000-of-00002.arrow"
5
- },
6
- {
7
- "filename": "data-00001-of-00002.arrow"
8
- }
9
- ],
10
- "_fingerprint": "645cec5bd749f9c8",
11
- "_format_columns": null,
12
- "_format_kwargs": {},
13
- "_format_type": null,
14
- "_output_all_columns": false,
15
- "_split": "train"
16
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
data/{validation/data-00000-of-00001.arrow → validation.parquet} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5c1a9c417cc3d133f29399e79dd9996984c134bc8a1139745515573b81a17fcd
3
- size 12270544
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3401f7214750a3e00f7fbeba2f9e72d3eef6226cb3a1fa0ce78b9ffae543695a
3
+ size 5450651
data/validation/dataset_info.json DELETED
@@ -1,180 +0,0 @@
1
- {
2
- "builder_name": "json",
3
- "citation": "",
4
- "config_name": "default",
5
- "dataset_name": "json",
6
- "dataset_size": 12249133,
7
- "description": "",
8
- "download_checksums": {
9
- "/home/julian/repos/dbnl.org-dutch-public-domain-collection/src/tmp/val.jsonl": {
10
- "num_bytes": 15156646,
11
- "checksum": null
12
- }
13
- },
14
- "download_size": 15156646,
15
- "features": {
16
- "meta": {
17
- "ti_id": {
18
- "dtype": "string",
19
- "_type": "Value"
20
- },
21
- "titel": {
22
- "dtype": "string",
23
- "_type": "Value"
24
- },
25
- "vols": {
26
- "dtype": "string",
27
- "_type": "Value"
28
- },
29
- "jaar": {
30
- "dtype": "string",
31
- "_type": "Value"
32
- },
33
- "druk": {
34
- "dtype": "string",
35
- "_type": "Value"
36
- },
37
- "ppn_o": {
38
- "dtype": "string",
39
- "_type": "Value"
40
- },
41
- "bibliotheek": {
42
- "dtype": "string",
43
- "_type": "Value"
44
- },
45
- "categorie": {
46
- "dtype": "int64",
47
- "_type": "Value"
48
- },
49
- "_jaar": {
50
- "dtype": "int64",
51
- "_type": "Value"
52
- },
53
- "pers_id": {
54
- "dtype": "string",
55
- "_type": "Value"
56
- },
57
- "voornaam": {
58
- "dtype": "string",
59
- "_type": "Value"
60
- },
61
- "voorvoegsel": {
62
- "dtype": "string",
63
- "_type": "Value"
64
- },
65
- "achternaam": {
66
- "dtype": "string",
67
- "_type": "Value"
68
- },
69
- "jaar_geboren": {
70
- "dtype": "string",
71
- "_type": "Value"
72
- },
73
- "jaar_overlijden": {
74
- "dtype": "string",
75
- "_type": "Value"
76
- },
77
- "geb_datum": {
78
- "dtype": "string",
79
- "_type": "Value"
80
- },
81
- "overl_datum": {
82
- "dtype": "string",
83
- "_type": "Value"
84
- },
85
- "geb_plaats": {
86
- "dtype": "string",
87
- "_type": "Value"
88
- },
89
- "overl_plaats": {
90
- "dtype": "string",
91
- "_type": "Value"
92
- },
93
- "geb_plaats_code": {
94
- "dtype": "string",
95
- "_type": "Value"
96
- },
97
- "geb_land_code": {
98
- "dtype": "string",
99
- "_type": "Value"
100
- },
101
- "overl_plaats_code": {
102
- "dtype": "string",
103
- "_type": "Value"
104
- },
105
- "overl_land_code": {
106
- "dtype": "string",
107
- "_type": "Value"
108
- },
109
- "vrouw": {
110
- "dtype": "int64",
111
- "_type": "Value"
112
- },
113
- "url": {
114
- "dtype": "string",
115
- "_type": "Value"
116
- },
117
- "text_url": {
118
- "dtype": "string",
119
- "_type": "Value"
120
- },
121
- "maand": {
122
- "dtype": "string",
123
- "_type": "Value"
124
- },
125
- "genre": {
126
- "dtype": "string",
127
- "_type": "Value"
128
- },
129
- "Unnamed: 28": {
130
- "dtype": "string",
131
- "_type": "Value"
132
- },
133
- "revision_date": {
134
- "dtype": "timestamp[s]",
135
- "_type": "Value"
136
- },
137
- "edition": {
138
- "dtype": "string",
139
- "_type": "Value"
140
- },
141
- "language": {
142
- "dtype": "string",
143
- "_type": "Value"
144
- },
145
- "chapter": {
146
- "dtype": "int64",
147
- "_type": "Value"
148
- },
149
- "section": {
150
- "dtype": "int64",
151
- "_type": "Value"
152
- }
153
- },
154
- "text": {
155
- "dtype": "string",
156
- "_type": "Value"
157
- },
158
- "id": {
159
- "dtype": "string",
160
- "_type": "Value"
161
- }
162
- },
163
- "homepage": "",
164
- "license": "",
165
- "size_in_bytes": 27405779,
166
- "splits": {
167
- "validation": {
168
- "name": "validation",
169
- "num_bytes": 12249133,
170
- "num_examples": 5768,
171
- "dataset_name": "json"
172
- }
173
- },
174
- "version": {
175
- "version_str": "0.0.0",
176
- "major": 0,
177
- "minor": 0,
178
- "patch": 0
179
- }
180
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
data/validation/state.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "_data_files": [
3
- {
4
- "filename": "data-00000-of-00001.arrow"
5
- }
6
- ],
7
- "_fingerprint": "cda191967f8bb0a5",
8
- "_format_columns": null,
9
- "_format_kwargs": {},
10
- "_format_type": null,
11
- "_output_all_columns": false,
12
- "_split": "validation"
13
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/create_nl_dataset.py CHANGED
@@ -81,13 +81,13 @@ if __name__ == '__main__':
81
  train_df = meta_df.iloc[:num_train]
82
  val_df = meta_df.iloc[num_train:]
83
 
84
- with open('tmp/train.jsonl', 'w') as train_file:
85
- with open('tmp/val.jsonl', 'w') as val_file:
86
- for item, split in tqdm(yield_file_contents('../origin/xml_pd.zip', train_df, val_df)):
87
- if split == 'train':
88
- train_file.write('{}\n'.format(json.dumps(item)))
89
- if split == 'validation':
90
- val_file.write('{}\n'.format(json.dumps(item)))
91
 
92
- datasets.Dataset.from_json('tmp/train.jsonl', split='train').save_to_disk('../data/train')
93
- datasets.Dataset.from_json('tmp/val.jsonl', split='validation').save_to_disk('../data/validation')
 
81
  train_df = meta_df.iloc[:num_train]
82
  val_df = meta_df.iloc[num_train:]
83
 
84
+ # with open('tmp/train.jsonl', 'w') as train_file:
85
+ # with open('tmp/val.jsonl', 'w') as val_file:
86
+ # for item, split in tqdm(yield_file_contents('../origin/xml_pd.zip', train_df, val_df)):
87
+ # if split == 'train':
88
+ # train_file.write('{}\n'.format(json.dumps(item)))
89
+ # if split == 'validation':
90
+ # val_file.write('{}\n'.format(json.dumps(item)))
91
 
92
+ datasets.Dataset.from_json('tmp/train.jsonl', split='train').to_parquet('../data/train.parquet')
93
+ datasets.Dataset.from_json('tmp/val.jsonl', split='validation').to_parquet('../data/validation.parquet')