code: def finish_chunck(self):
      if len(self.text) == 0:
          return
  
      codec = self.compute_codec()
  
      filename = "{}_{:03d}{}".format(
          self.output_filename, self.current_chunk, ".h5"
      )
      self.files.append(filename)
      file = h5py.File(filename, "w")
      dti32 = h5py.special_dtype(vlen=np.dtype("int32"))
      dtui8 = h5py.special_dtype(vlen=np.dtype("uint8"))
      file.create_dataset(
          "transcripts",
          (len(self.text),),
          dtype=dti32,
          compression="gzip",
      )
      file.create_dataset(
          "images_dims", data=[d.shape for d in self.data], dtype=int
      )
      file.create_dataset(
          "images", (len(self.text),), dtype=dtui8, compression="gzip"
      )
      file.create_dataset("codec", data=list(map(ord, codec)))
      file["transcripts"][...] = [
          list(map(codec.index, d)) for d in self.text
      ]
      file["images"][...] = [d.reshape(-1) for d in self.data]
      file.close()
  
      self.current_chunk += 1
      self.data = []
      self.text = []
  
file_path: calamari/calamari_ocr/ocr/dataset/datareader/hdf5/hdf5_dataset_writer.py
imports: import numpy
  import h5py
  from tfaip import PipelineMode
label_desc: Use image node_id 5 for calling the Hdf5DatasetWriter obj's underlying member method code with example usage: obj.finish_chunck() without return types