class_docstr: Postprocess raw prediction of the model (logits) to a list of words using CTC decoding
  
  Args:
  ----
      vocab: string containing the ordered sequence of supported characters
      ignore_case: if True, ignore case of letters
      ignore_accents: if True, ignore accents of letters
class_docstr_tok: ["Postprocess","raw","prediction","of","the","model","(","logits",")","to","a","list","of","words","using","CTC","decoding","Args",":","--","--","vocab",":","string","containing","the","ordered","sequence","of","supported","characters","ignore_case",":","if","True",",","ignore","case","of","letters","ignore_accents",":","if","True",",","ignore","accents","of","letters"]
docstr: Performs decoding of raw output with CTC and decoding of CTC predictions
  with label_to_idx mapping dictionnary
  
  Args:
  ----
      logits: raw output of the model, shape BATCH_SIZE X SEQ_LEN X NUM_CLASSES + 1
      beam_width: An int scalar >= 0 (beam search beam width).
      top_paths: An int scalar >= 0, <= beam_width (controls output size).
  
  Returns:
  -------
      A list of decoded words of length BATCH_SIZE
docstr_tok: ["Performs","decoding","of","raw","output","with","CTC","and","decoding","of","CTC","predictions","with","label_to_idx","mapping","dictionnary","Args",":","--","--","logits",":","raw","output","of","the","model",",","shape","BATCH_SIZE","X","SEQ_LEN","X","NUM_CLASSES","+","1","beam_width",":","An","int","scalar",">","=","0","(","beam","search","beam","width",")",".","top_paths",":","An","int","scalar",">","=","0",",","<","=","beam_width","(","controls","output","size",")",".","Returns",":","--","--","--","-","A","list","of","decoded","words","of","length","BATCH_SIZE"]
code: def __call__(
      self,
      logits: tf.Tensor,
      beam_width: int = 1,
      top_paths: int = 1,
  ) -> Union[
      List[Tuple[str, float]], List[Tuple[List[str], List[float]]]
  ]:
      """Performs decoding of raw output with CTC and decoding of CTC predictions
      with label_to_idx mapping dictionnary
  
      Args:
      ----
          logits: raw output of the model, shape BATCH_SIZE X SEQ_LEN X NUM_CLASSES + 1
          beam_width: An int scalar >= 0 (beam search beam width).
          top_paths: An int scalar >= 0, <= beam_width (controls output size).
  
      Returns:
      -------
          A list of decoded words of length BATCH_SIZE
  
  
      """
      # Decode CTC
      _decoded, _log_prob = tf.nn.ctc_beam_search_decoder(
          tf.transpose(logits, perm=[1, 0, 2]),
          tf.fill(tf.shape(logits)[:1], tf.shape(logits)[1]),
          beam_width=beam_width,
          top_paths=top_paths,
      )
  
      _decoded = tf.sparse.concat(
          1,
          [tf.sparse.expand_dims(dec, axis=1) for dec in _decoded],
          expand_nonconcat_dims=True,
      )  # dim : batchsize x beamwidth x actual_max_len_predictions
      out_idxs = tf.sparse.to_dense(
          _decoded, default_value=len(self.vocab)
      )
  
      # Map it to characters
      _decoded_strings_pred = tf.strings.reduce_join(
          inputs=tf.nn.embedding_lookup(
              tf.constant(self._embedding, dtype=tf.string), out_idxs
          ),
          axis=-1,
      )
      _decoded_strings_pred = tf.strings.split(
          _decoded_strings_pred, "<eos>"
      )
      decoded_strings_pred = tf.sparse.to_dense(
          _decoded_strings_pred.to_sparse(), default_value="not valid"
      )[
          :, :, 0
      ]  # dim : batch_size x beam_width
  
      if top_paths == 1:
          probs = tf.math.exp(
              tf.squeeze(_log_prob, axis=1)
          )  # dim : batchsize
          decoded_strings_pred = tf.squeeze(
              decoded_strings_pred, axis=1
          )
          word_values = [
              word.decode()
              for word in decoded_strings_pred.numpy().tolist()
          ]
      else:
          probs = tf.math.exp(_log_prob)  # dim : batchsize x beamwidth
          word_values = [
              [word.decode() for word in words]
              for words in decoded_strings_pred.numpy().tolist()
          ]
      return list(zip(word_values, probs.numpy().tolist()))
  
imports: from copy import deepcopy
  from typing import Any, Dict, List, Optional, Tuple, Union
  import tensorflow
  from tensorflow.keras import layers
  from tensorflow.keras.models import Model, Sequential
  from doctr.datasets import VOCABS
  from ...classification import mobilenet_v3_large_r, mobilenet_v3_small_r, vgg16_bn_r
  from ...utils.tensorflow import _bf16_to_float32, load_pretrained_params
  from ..core import RecognitionModel, RecognitionPostProcessor
label_desc: Use image node_id 1 for calling the CTCPostProcessor obj's underlying member method code with example usage: obj.__call__(logits, beam_width, top_paths) and returns: list