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
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"]
docstr: Implements best path decoding as shown by Graves (Dissertation, p63), highly inspired from
  <https://github.com/githubharald/CTCDecoder>`_.
  
  Args:
  ----
      logits: model output, shape: N x T x C
      vocab: vocabulary to use
      blank: index of blank label
  
  Returns:
  -------
      A list of tuples: (word, confidence)
docstr_tok: ["Implements","best","path","decoding","as","shown","by","Graves","(","Dissertation",",","p63",")",",","highly","inspired","from","<","https",":","\/\/github.com\/githubharald\/CTCDecoder",">","`","_",".","Args",":","--","--","logits",":","model","output",",","shape",":","N","x","T","x","C","vocab",":","vocabulary","to","use","blank",":","index","of","blank","label","Returns",":","--","--","--","-","A","list","of","tuples",":","(","word",",","confidence",")"]
code: def ctc_best_path(
      logits: torch.Tensor,
      vocab: str = VOCABS["french"],
      blank: int = 0,
  ) -> List[Tuple[str, float]]:
      """Implements best path decoding as shown by Graves (Dissertation, p63), highly inspired from
      <https://github.com/githubharald/CTCDecoder>`_.
  
      Args:
      ----
          logits: model output, shape: N x T x C
          vocab: vocabulary to use
          blank: index of blank label
  
      Returns:
      -------
          A list of tuples: (word, confidence)
      """
      # Gather the most confident characters, and assign the smallest conf among those to the sequence prob
      probs = (
          F.softmax(logits, dim=-1).max(dim=-1).values.min(dim=1).values
      )
  
      # collapse best path (using itertools.groupby), map to chars, join char list to string
      words = [
          decode_sequence(
              [k for k, _ in groupby(seq.tolist()) if k != blank], vocab
          )
          for seq in torch.argmax(logits, dim=-1)
      ]
  
      return list(zip(words, probs.tolist()))
  
imports: from copy import deepcopy
  from itertools import groupby
  from typing import Any, Callable, Dict, List, Optional, Tuple
  import torch
  from torch import nn
  from torch.nn import functional
  from doctr.datasets import VOCABS, decode_sequence
  from ...classification import mobilenet_v3_large_r, mobilenet_v3_small_r, vgg16_bn_r
  from ...utils.pytorch import 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.ctc_best_path(logits, vocab, blank) and returns: list