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, maxCandidate, dict_list):
      beams = [v for (_, v) in self.entries.items()]
      sortedBeams = sorted(
          beams, reverse=True, key=lambda x: x.prTotal * x.prText
      )
      if len(sortedBeams) > maxCandidate:
          sortedBeams = sortedBeams[:maxCandidate]
  
      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])
              ):
                  text += classes[l]
  
          if j == 0:
              best_text = text
          if text in dict_list:
              # print('found text: ', text)
              best_text = text
              break
          else:
              pass
              # print('not in dict: ', text)
      return best_text
  
imports: from __future__ import print_function
  import torch
  import pickle
  import numpy
  import math
  import cv2
  from PIL import Image, JpegImagePlugin
  from scipy import ndimage
  import hashlib
  import sys, os
  from zipfile import ZipFile
  from .imgproc import loadImage
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, maxCandidate, dict_list) and returns: best_text