AnaChikashua commited on
Commit
48f0f22
·
1 Parent(s): 331df98

Update handwriting_dataset.py

Browse files
Files changed (1) hide show
  1. handwriting_dataset.py +1 -1
handwriting_dataset.py CHANGED
@@ -44,7 +44,7 @@ class HandwritingData(datasets.GeneratorBasedBuilder):
44
  # Iterate through images
45
  for idx, filepath, image in enumerate(images):
46
  # extract the text from the filename
47
- text = filepath.split("/")[-1].split(".")[0]
48
  yield idx, {
49
  "text": text,
50
  "image": {"path": filepath, "bytes": image.read()}
 
44
  # Iterate through images
45
  for idx, filepath, image in enumerate(images):
46
  # extract the text from the filename
47
+ text = [c for c in filepath if not 0 <= ord(c) <= 127][0]
48
  yield idx, {
49
  "text": text,
50
  "image": {"path": filepath, "bytes": image.read()}