Commit
•
45c124f
1
Parent(s):
1786591
Add script
Browse files- lm_en_dummy0.py +40 -0
lm_en_dummy0.py
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import datasets
|
2 |
+
|
3 |
+
|
4 |
+
_DATA = ["One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten"]
|
5 |
+
|
6 |
+
|
7 |
+
class NewDataset(datasets.GeneratorBasedBuilder):
|
8 |
+
# """"""
|
9 |
+
|
10 |
+
VERSION = datasets.Version("1.0.0")
|
11 |
+
|
12 |
+
def _info(self):
|
13 |
+
return datasets.DatasetInfo(
|
14 |
+
# description=_DESCRIPTION,
|
15 |
+
features=datasets.Features(
|
16 |
+
{
|
17 |
+
"text": datasets.Value("string"),
|
18 |
+
# "meta": datasets.Value("string"),
|
19 |
+
}
|
20 |
+
),
|
21 |
+
# homepage=_HOMEPAGE,
|
22 |
+
# license=_LICENSE,
|
23 |
+
# citation=_CITATION,
|
24 |
+
)
|
25 |
+
|
26 |
+
def _split_generators(self, dl_manager):
|
27 |
+
return [
|
28 |
+
datasets.SplitGenerator(
|
29 |
+
name=datasets.Split.TRAIN,
|
30 |
+
gen_kwargs={
|
31 |
+
"data": _DATA,
|
32 |
+
},
|
33 |
+
)
|
34 |
+
]
|
35 |
+
|
36 |
+
def _generate_examples(self, data):
|
37 |
+
key = 0
|
38 |
+
for text in data:
|
39 |
+
yield key, {"text": text} #, "meta": {"file": path}}
|
40 |
+
key += 1
|