code: def store_text_prediction(self, prediction, sample_id, output_dir):
      sample = self.sample_by_id(sample_id)
      codec = self.prediction[sample["filename"]]["codec"]
      self.prediction[sample["filename"]]["transcripts"].append(
          list(map(codec.index, prediction.sentence))
      )
  
imports: from copy import deepcopy
  from dataclasses import dataclass, field
  from random import shuffle
  from typing import Generator, List
  from paiargparse import pai_dataclass, pai_meta
  from tfaip.data.pipeline.definitions import PipelineMode
  import numpy
  import h5py
  from calamari_ocr.ocr.dataset.datareader.base import CalamariDataGenerator, InputSample, SampleMeta, CalamariDataGeneratorParams
  from calamari_ocr.utils import split_all_ext, glob_all
label_desc: Use image node_id 2 for calling the Hdf5Generator obj's underlying member method code with example usage: obj.store_text_prediction(prediction, sample_id, output_dir) without return types