cyrilzhang
commited on
Commit
·
67727ac
1
Parent(s):
c6bc00f
Create ace.py
Browse files
ace.py
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
15 |
+
|
16 |
+
import csv
|
17 |
+
import json
|
18 |
+
import os
|
19 |
+
|
20 |
+
import datasets
|
21 |
+
|
22 |
+
|
23 |
+
_CITATION = """\
|
24 |
+
"""
|
25 |
+
|
26 |
+
_DESCRIPTION = """\
|
27 |
+
Online dataset mockup.
|
28 |
+
"""
|
29 |
+
|
30 |
+
_HOMEPAGE = ""
|
31 |
+
|
32 |
+
_LICENSE = ""
|
33 |
+
|
34 |
+
_URLS = {}
|
35 |
+
|
36 |
+
class MockupDataset(datasets.GeneratorBasedBuilder):
|
37 |
+
"""TODO: Short description of my dataset."""
|
38 |
+
|
39 |
+
VERSION = datasets.Version("0.0.0")
|
40 |
+
BUILDER_CONFIGS = []
|
41 |
+
|
42 |
+
def _info(self):
|
43 |
+
features = datasets.Features(
|
44 |
+
{
|
45 |
+
"x": datasets.Value("null"),
|
46 |
+
"y": datasets.Value("null")
|
47 |
+
}
|
48 |
+
)
|
49 |
+
|
50 |
+
return datasets.DatasetInfo(
|
51 |
+
description=_DESCRIPTION,
|
52 |
+
features=features,
|
53 |
+
homepage=_HOMEPAGE,
|
54 |
+
license=_LICENSE,
|
55 |
+
citation=_CITATION,
|
56 |
+
)
|
57 |
+
|
58 |
+
def _split_generators(self, dl_manager):
|
59 |
+
return [
|
60 |
+
datasets.SplitGenerator(
|
61 |
+
name=datasets.Split.TRAIN,
|
62 |
+
gen_kwargs={
|
63 |
+
"split": "train",
|
64 |
+
},
|
65 |
+
)
|
66 |
+
]
|
67 |
+
|
68 |
+
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
69 |
+
def _generate_examples(self, split):
|
70 |
+
for i in range(10):
|
71 |
+
yield key, {
|
72 |
+
"x": [0,1,0,1,0],
|
73 |
+
"y": [1,0,1,0,1]
|
74 |
+
}
|