class_docstr: Implements text match metric (word-level accuracy) for recognition task.
  
  The raw aggregated metric is computed as follows:
  
  .. math::
      \forall X, Y \in \mathcal{W}^N,
      TextMatch(X, Y) = \frac{1}{N} \sum\limits_{i=1}^N f_{Y_i}(X_i)
  
  with the indicator function :math:`f_{a}` defined as:
  
  .. math::
      \forall a, x \in \mathcal{W},
      f_a(x) = \left\{
          \begin{array}{ll}
              1 & \mbox{if } x = a \\
              0 & \mbox{otherwise.}
          \end{array}
      \right.
  
  where :math:`\mathcal{W}` is the set of all possible character sequences,
  :math:`N` is a strictly positive integer.
  
  >>> from doctr.utils import TextMatch
  >>> metric = TextMatch()
  >>> metric.update(['Hello', 'world'], ['hello', 'world'])
  >>> metric.summary()
class_docstr_tok: ["Implements","text","match","metric","(","word-level","accuracy",")","for","recognition","task",".","The","raw","aggregated","metric","is","computed","as","follows",":","..","math",":",":","\\forall","X",",","Y","\\in","\\mathcal","{","W","}","^N",",","TextMatch","(","X",",","Y",")","=","\\frac","{","1","}","{","N","}","\\sum\\limits_","{","i=1","}","^N","f_","{","Y_i","}","(","X_i",")","with","the","indicator","function",":","math",":","`","f_","{","a","}","`","defined","as",":","..","math",":",":","\\forall","a",",","x","\\in","\\mathcal","{","W","}",",","f_a","(","x",")","=","\\left\\","{","\\begin","{","array","}","{","ll","}","1","&","\\mbox","{","if","}","x","=","a","\\\\","0","&","\\mbox","{","otherwise",".","}","\\end","{","array","}","\\right",".","where",":","math",":","`","\\mathcal","{","W","}","`","is","the","set","of","all","possible","character","sequences",",",":","math",":","`","N","`","is","a","strictly","positive","integer",".",">",">",">","from","doctr.utils","import","TextMatch",">",">",">","metric","=","TextMatch","(",")",">",">",">","metric.update","(","[","'Hello","'",",","'world","'","]",",","[","'hello","'",",","'world","'","]",")",">",">",">","metric.summary","(",")"]
docstr: Computes the aggregated metrics
  
  Returns
  -------
      a dictionary with the exact match score for the raw data, its lower-case counterpart, its unidecode
      counterpart and its lower-case unidecode counterpart
docstr_tok: ["Computes","the","aggregated","metrics","Returns","--","--","--","-","a","dictionary","with","the","exact","match","score","for","the","raw","data",",","its","lower-case","counterpart",",","its","unidecode","counterpart","and","its","lower-case","unidecode","counterpart"]
code: def summary(self) -> Dict[str, float]:
      """Computes the aggregated metrics
  
      Returns
      -------
          a dictionary with the exact match score for the raw data, its lower-case counterpart, its unidecode
          counterpart and its lower-case unidecode counterpart
      """
      if self.total == 0:
          raise AssertionError(
              "you need to update the metric before getting the summary"
          )
  
      return dict(
          raw=self.raw / self.total,
          caseless=self.caseless / self.total,
          unidecode=self.unidecode / self.total,
          unicase=self.unicase / self.total,
      )
  
imports: from typing import Dict, List, Optional, Tuple
  import cv2
  import numpy
  from scipy.optimize import linear_sum_assignment
  from unidecode import unidecode
label_desc: Use image node_id 3 for calling the TextMatch obj's underlying member method code with example usage: obj.summary() and returns: dict