Francisco Castillo commited on
Commit
47bd1fc
1 Parent(s): bceaaea
Files changed (1) hide show
  1. fashion_mnist_label_drift.py +1 -34
fashion_mnist_label_drift.py CHANGED
@@ -172,37 +172,4 @@ class FashionMNISTLabelDrift(datasets.GeneratorBasedBuilder):
172
  "prediction_ts":pred_ts[idx],
173
  "label":labels[idx],
174
  "image":images[idx]
175
- }
176
- # with open(filepath) as csv_file:
177
- # csv_reader = csv.reader(csv_file, delimiter='\t')
178
- # for id_, row in enumerate(csv_reader):
179
- # prediction_ts,language,text,ner_tags = row
180
- # ner_tags_list = list(ner_tags.strip('[]').split(' '))
181
- # tokens = text.split(":-:")
182
- # if id_==0:
183
- # continue
184
- # yield id_, {
185
- # "prediction_ts":prediction_ts,
186
- # "language":language,
187
- # "split_text": tokens,
188
- # "ner_tags":ner_tags_list,
189
- # }
190
- #
191
- # def _generate_examples(self, filepath, split):
192
- # """This function returns the examples in the raw form."""
193
- # # Images
194
- # with open(filepath[0], "rb") as f:
195
- # # First 16 bytes contain some metadata
196
- # _ = f.read(4)
197
- # size = struct.unpack(">I", f.read(4))[0]
198
- # _ = f.read(8)
199
- # images = np.frombuffer(f.read(), dtype=np.uint8).reshape(size, 28, 28)
200
- #
201
- # # Labels
202
- # with open(filepath[1], "rb") as f:
203
- # # First 8 bytes contain some metadata
204
- # _ = f.read(8)
205
- # labels = np.frombuffer(f.read(), dtype=np.uint8)
206
- #
207
- # for idx in range(size):
208
- # yield idx, {"image": images[idx], "label": int(labels[idx])}
 
172
  "prediction_ts":pred_ts[idx],
173
  "label":labels[idx],
174
  "image":images[idx]
175
+ }