class_docstr: information about the beams at specific time-step
class_docstr_tok: ["information","about","the","beams","at","specific","time-step"]
code: def wordsearch(self, classes, ignore_idx, beamWidth, dict_list):
      beams = [v for (_, v) in self.entries.items()]
      sortedBeams = sorted(
          beams, reverse=True, key=lambda x: x.prTotal * x.prText
      )[:beamWidth]
  
      for j, candidate in enumerate(sortedBeams):
          idx_list = candidate.labeling
          text = ""
          for i, l in enumerate(idx_list):
              if l not in ignore_idx and (
                  not (i > 0 and idx_list[i - 1] == idx_list[i])
              ):  # removing repeated characters and blank.
                  text += classes[l]
  
          if j == 0:
              best_text = text
          if text in dict_list:
              print("found text: ", text)
              best_text = text
              break
          else:
              print("not in dict: ", text)
      return best_text
  
imports: import torch
  import pickle
  import numpy
label_desc: Use image node_id 4 for calling the BeamState obj's underlying member method code with example usage: obj.wordsearch(classes, ignore_idx, beamWidth, dict_list) and returns: best_text