Update GenMix50k.py
Browse files- GenMix50k.py +16 -2
GenMix50k.py
CHANGED
@@ -1,7 +1,9 @@
|
|
1 |
-
import os
|
2 |
-
import json
|
3 |
import datasets as ds
|
4 |
|
|
|
|
|
|
|
5 |
_DESCRIPTION = """
|
6 |
Description of the dataset.
|
7 |
"""
|
@@ -14,11 +16,15 @@ _LICENCE = """
|
|
14 |
License information for the dataset.
|
15 |
"""
|
16 |
|
|
|
17 |
_FEATURES = ds.Features({
|
18 |
"x": ds.Value(dtype="string"),
|
19 |
"y": ds.Value(dtype="string")
|
20 |
})
|
21 |
|
|
|
|
|
|
|
22 |
class GenMix50kConfig(ds.BuilderConfig):
|
23 |
def __init__(self, **kwargs):
|
24 |
super(GenMix50kConfig, self).__init__(**kwargs)
|
@@ -26,13 +32,18 @@ class GenMix50kConfig(ds.BuilderConfig):
|
|
26 |
self.features = _FEATURES
|
27 |
self.citation = _CITATION
|
28 |
|
|
|
|
|
|
|
29 |
class GenMix50k(ds.GeneratorBasedBuilder):
|
|
|
30 |
BUILDER_CONFIGS = [
|
31 |
GenMix50kConfig(name="translation"),
|
32 |
GenMix50kConfig(name="dialogue"),
|
33 |
GenMix50kConfig(name="summarization")
|
34 |
]
|
35 |
|
|
|
36 |
def _info(self) -> ds.DatasetInfo:
|
37 |
"""Returns the dataset metadata."""
|
38 |
return ds.DatasetInfo(
|
@@ -43,8 +54,10 @@ class GenMix50k(ds.GeneratorBasedBuilder):
|
|
43 |
supervised_keys=None
|
44 |
)
|
45 |
|
|
|
46 |
def _split_generators(self, dl_manager: ds.DownloadManager):
|
47 |
"""Returns SplitGenerators"""
|
|
|
48 |
base_url = "https://huggingface.co/datasets/moon23k/GenMix50k/resolve/main/"
|
49 |
data_files = {
|
50 |
"translation": {
|
@@ -81,6 +94,7 @@ class GenMix50k(ds.GeneratorBasedBuilder):
|
|
81 |
),
|
82 |
]
|
83 |
|
|
|
84 |
def _generate_examples(self, filepath):
|
85 |
with open(filepath, encoding="utf-8") as f:
|
86 |
data = json.load(f)
|
|
|
1 |
+
import os, json
|
|
|
2 |
import datasets as ds
|
3 |
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
_DESCRIPTION = """
|
8 |
Description of the dataset.
|
9 |
"""
|
|
|
16 |
License information for the dataset.
|
17 |
"""
|
18 |
|
19 |
+
|
20 |
_FEATURES = ds.Features({
|
21 |
"x": ds.Value(dtype="string"),
|
22 |
"y": ds.Value(dtype="string")
|
23 |
})
|
24 |
|
25 |
+
|
26 |
+
|
27 |
+
|
28 |
class GenMix50kConfig(ds.BuilderConfig):
|
29 |
def __init__(self, **kwargs):
|
30 |
super(GenMix50kConfig, self).__init__(**kwargs)
|
|
|
32 |
self.features = _FEATURES
|
33 |
self.citation = _CITATION
|
34 |
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
class GenMix50k(ds.GeneratorBasedBuilder):
|
39 |
+
|
40 |
BUILDER_CONFIGS = [
|
41 |
GenMix50kConfig(name="translation"),
|
42 |
GenMix50kConfig(name="dialogue"),
|
43 |
GenMix50kConfig(name="summarization")
|
44 |
]
|
45 |
|
46 |
+
|
47 |
def _info(self) -> ds.DatasetInfo:
|
48 |
"""Returns the dataset metadata."""
|
49 |
return ds.DatasetInfo(
|
|
|
54 |
supervised_keys=None
|
55 |
)
|
56 |
|
57 |
+
|
58 |
def _split_generators(self, dl_manager: ds.DownloadManager):
|
59 |
"""Returns SplitGenerators"""
|
60 |
+
|
61 |
base_url = "https://huggingface.co/datasets/moon23k/GenMix50k/resolve/main/"
|
62 |
data_files = {
|
63 |
"translation": {
|
|
|
94 |
),
|
95 |
]
|
96 |
|
97 |
+
|
98 |
def _generate_examples(self, filepath):
|
99 |
with open(filepath, encoding="utf-8") as f:
|
100 |
data = json.load(f)
|