AnaChikashua commited on
Commit
35d37c3
·
1 Parent(s): e34a884

Update handwriting_dataset.py

Browse files
Files changed (1) hide show
  1. handwriting_dataset.py +2 -2
handwriting_dataset.py CHANGED
@@ -22,7 +22,7 @@ class HandwritingData(datasets.GeneratorBasedBuilder):
22
  citation=_CITATION,
23
  features=datasets.Features(
24
  {"text": datasets.Value("string"),
25
- "label": datasets.ClassLabel(names=_NAMES),
26
  "image": datasets.Image()
27
  }
28
  ),
@@ -49,7 +49,7 @@ class HandwritingData(datasets.GeneratorBasedBuilder):
49
  # extract the text from the filename
50
  text = [c for c in filepath if not 0 <= ord(c) <= 127][0]
51
  yield idx, {
52
- "text": str(text),
53
  "char": str(idx),
54
  "image": {"path": filepath, "bytes": image.read()}
55
  }
 
22
  citation=_CITATION,
23
  features=datasets.Features(
24
  {"text": datasets.Value("string"),
25
+ "label": datasets.features.ClassLabel(names=_NAMES),
26
  "image": datasets.Image()
27
  }
28
  ),
 
49
  # extract the text from the filename
50
  text = [c for c in filepath if not 0 <= ord(c) <= 127][0]
51
  yield idx, {
52
+ "text": str(filepath),
53
  "char": str(idx),
54
  "image": {"path": filepath, "bytes": image.read()}
55
  }