class_docstr: Confidence Mixin class.
  
  It is responsible for confidence estimation method initialization and high-level confidence score calculation.
class_docstr_tok: ["Confidence","Mixin","class",".","It","is","responsible","for","confidence","estimation","method","initialization","and","high-level","confidence","score","calculation","."]
docstr: Implementation of token confidence aggregation for character-based models.
  
  Args:
      words: List of words of a hypothesis.
      token_confidence: List of token-level confidence scores of a hypothesis.
  
  Returns:
      A list of word-level confidence scores.
docstr_tok: ["Implementation","of","token","confidence","aggregation","for","character-based","models",".","Args",":","words",":","List","of","words","of","a","hypothesis",".","token_confidence",":","List","of","token-level","confidence","scores","of","a","hypothesis",".","Returns",":","A","list","of","word-level","confidence","scores","."]
code: def _aggregate_token_confidence_chars(
      self, words: List[str], token_confidence: List[float]
  ) -> List[float]:
      """Implementation of token confidence aggregation for character-based models.
  
      Args:
          words: List of words of a hypothesis.
          token_confidence: List of token-level confidence scores of a hypothesis.
  
      Returns:
          A list of word-level confidence scores.
      """
      word_confidence = []
      i = 0
      for word in words:
          word_len = len(word)
          word_confidence.append(
              self._aggregate_confidence(
                  token_confidence[i : i + word_len]
              )
          )
          # we assume that there is exactly one space token between words and exclude it from word confidence
          i += word_len + 1
      return word_confidence
  
imports: import math
  from abc import ABC, abstractmethod
  from dataclasses import dataclass, field
  from functools import partial
  from typing import List, Optional
  import torch
  from omegaconf import DictConfig, OmegaConf
  from nemo.collections.asr.parts.utils.rnnt_utils import Hypothesis
  from nemo.utils import logging
label_desc: Use image node_id 4 for calling the ConfidenceMixin obj's underlying member method code with example usage: obj._aggregate_token_confidence_chars(words, token_confidence) and returns: word_confidence