DykeF commited on
Commit
aebe23b
1 Parent(s): a42c6b3

Update NCTCRCHE100K.py

Browse files
Files changed (1) hide show
  1. NCTCRCHE100K.py +3 -1
NCTCRCHE100K.py CHANGED
@@ -61,8 +61,10 @@ class NCTCRCHE100K(datasets.GeneratorBasedBuilder):
61
  idx = 0
62
  for filepath, image in images:
63
  # extract text from each item
 
 
64
  yield idx, {
65
  "image": {"path": filepath, "bytes": image.read()},
66
- "text": filepath
67
  }
68
  idx += 1
 
61
  idx = 0
62
  for filepath, image in images:
63
  # extract text from each item
64
+ start_index = filepath.find('/') + 1
65
+ end_index = filepath.find('-', start_index)
66
  yield idx, {
67
  "image": {"path": filepath, "bytes": image.read()},
68
+ "text": filepath[start_index: end_index]
69
  }
70
  idx += 1