Datasets:
Tasks:
Image Classification
Sub-tasks:
multi-class-classification
Languages:
English
Size:
10K<n<100K
License:
Francisco Castillo
commited on
Commit
•
5b44395
1
Parent(s):
9fe0261
wip
Browse files- fashion_mnist_label_drift.py +20 -16
fashion_mnist_label_drift.py
CHANGED
@@ -17,6 +17,7 @@
|
|
17 |
|
18 |
|
19 |
import csv
|
|
|
20 |
import datasets
|
21 |
|
22 |
|
@@ -158,22 +159,25 @@ class FashionMNISTLabelDrift(datasets.GeneratorBasedBuilder):
|
|
158 |
def _generate_examples(self, filepath):
|
159 |
# This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
160 |
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
"
|
175 |
-
|
176 |
-
|
|
|
|
|
|
|
177 |
#def _generate_examples(self, filepath, split):
|
178 |
# """This function returns the examples in the raw form."""
|
179 |
# # Images
|
|
|
17 |
|
18 |
|
19 |
import csv
|
20 |
+
import pandas as pd
|
21 |
import datasets
|
22 |
|
23 |
|
|
|
159 |
def _generate_examples(self, filepath):
|
160 |
# This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
161 |
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
162 |
+
df = pd.read_hdf(filepath)
|
163 |
+
print(len(df))
|
164 |
+
print(df.columns)
|
165 |
+
|
166 |
+
# with open(filepath) as csv_file:
|
167 |
+
# csv_reader = csv.reader(csv_file, delimiter='\t')
|
168 |
+
# for id_, row in enumerate(csv_reader):
|
169 |
+
# prediction_ts,language,text,ner_tags = row
|
170 |
+
# ner_tags_list = list(ner_tags.strip('[]').split(' '))
|
171 |
+
# tokens = text.split(":-:")
|
172 |
+
# if id_==0:
|
173 |
+
# continue
|
174 |
+
# yield id_, {
|
175 |
+
# "prediction_ts":prediction_ts,
|
176 |
+
# "language":language,
|
177 |
+
# "split_text": tokens,
|
178 |
+
# "ner_tags":ner_tags_list,
|
179 |
+
# }
|
180 |
+
#
|
181 |
#def _generate_examples(self, filepath, split):
|
182 |
# """This function returns the examples in the raw form."""
|
183 |
# # Images
|