Datasets:
Upload build_dataset.py
Browse files- build_dataset.py +8 -4
build_dataset.py
CHANGED
@@ -59,13 +59,14 @@ class EMBERConfig(datasets.GeneratorBasedBuilder):
|
|
59 |
if self.config.name == "text_classification":
|
60 |
features = datasets.Features(
|
61 |
{
|
|
|
|
|
62 |
"x": datasets.features.Sequence(
|
63 |
datasets.Value("float32")
|
64 |
),
|
65 |
"y": datasets.Value("float32"),
|
66 |
"appeared": datasets.Value("string"),
|
67 |
"avclass": datasets.Value("string"),
|
68 |
-
"label": datasets.Value("string"),
|
69 |
"subset": datasets.Value("string"),
|
70 |
"sha256": datasets.Value("string")
|
71 |
}
|
@@ -73,13 +74,14 @@ class EMBERConfig(datasets.GeneratorBasedBuilder):
|
|
73 |
else:
|
74 |
features = datasets.Features(
|
75 |
{
|
|
|
|
|
76 |
"x": datasets.features.Sequence(
|
77 |
datasets.Value("float32")
|
78 |
),
|
79 |
"y": datasets.Value("float32"),
|
80 |
"appeared": datasets.Value("string"),
|
81 |
"avclass": datasets.Value("string"),
|
82 |
-
"label": datasets.Value("string"),
|
83 |
"subset": datasets.Value("string"),
|
84 |
"sha256": datasets.Value("string")
|
85 |
}
|
@@ -131,21 +133,23 @@ class EMBERConfig(datasets.GeneratorBasedBuilder):
|
|
131 |
key += 1
|
132 |
if self.config.name == "text_classification":
|
133 |
yield key, {
|
|
|
|
|
134 |
"x": data["x"],
|
135 |
"y": data["y"],
|
136 |
"appeared": data["appeared"],
|
137 |
"avclass": data["avclass"],
|
138 |
-
"label": data["label"],
|
139 |
"subset": data["subset"],
|
140 |
"sha256": data["sha256"]
|
141 |
}
|
142 |
else:
|
143 |
yield key, {
|
|
|
|
|
144 |
"x": data["x"],
|
145 |
"y": data["y"],
|
146 |
"appeared": data["appeared"],
|
147 |
"avclass": data["avclass"],
|
148 |
-
"label": data["label"],
|
149 |
"subset": data["subset"],
|
150 |
"sha256": data["sha256"]
|
151 |
}
|
|
|
59 |
if self.config.name == "text_classification":
|
60 |
features = datasets.Features(
|
61 |
{
|
62 |
+
"input": datasets.Value("string"),
|
63 |
+
"label": datasets.Value("string"),
|
64 |
"x": datasets.features.Sequence(
|
65 |
datasets.Value("float32")
|
66 |
),
|
67 |
"y": datasets.Value("float32"),
|
68 |
"appeared": datasets.Value("string"),
|
69 |
"avclass": datasets.Value("string"),
|
|
|
70 |
"subset": datasets.Value("string"),
|
71 |
"sha256": datasets.Value("string")
|
72 |
}
|
|
|
74 |
else:
|
75 |
features = datasets.Features(
|
76 |
{
|
77 |
+
"input": datasets.Value("string"),
|
78 |
+
"label": datasets.Value("string"),
|
79 |
"x": datasets.features.Sequence(
|
80 |
datasets.Value("float32")
|
81 |
),
|
82 |
"y": datasets.Value("float32"),
|
83 |
"appeared": datasets.Value("string"),
|
84 |
"avclass": datasets.Value("string"),
|
|
|
85 |
"subset": datasets.Value("string"),
|
86 |
"sha256": datasets.Value("string")
|
87 |
}
|
|
|
133 |
key += 1
|
134 |
if self.config.name == "text_classification":
|
135 |
yield key, {
|
136 |
+
"input": data["input"],
|
137 |
+
"label": data["label"],
|
138 |
"x": data["x"],
|
139 |
"y": data["y"],
|
140 |
"appeared": data["appeared"],
|
141 |
"avclass": data["avclass"],
|
|
|
142 |
"subset": data["subset"],
|
143 |
"sha256": data["sha256"]
|
144 |
}
|
145 |
else:
|
146 |
yield key, {
|
147 |
+
"input": data["input"],
|
148 |
+
"label": data["label"],
|
149 |
"x": data["x"],
|
150 |
"y": data["y"],
|
151 |
"appeared": data["appeared"],
|
152 |
"avclass": data["avclass"],
|
|
|
153 |
"subset": data["subset"],
|
154 |
"sha256": data["sha256"]
|
155 |
}
|