class_docstr: A wrapper for Chu-Liu-Edmonds algorithm for maximum spanning tree
docstr: Applies Chu-Liu-Edmonds algorithm to the matrix of head probabilities.
  probs: a 3D-array of probabilities of shape B*L*(L+1)
code: def __call__(self, probs: List[np.ndarray]) -> List[List[int]]:
      """Applies Chu-Liu-Edmonds algorithm to the matrix of head probabilities.
      probs: a 3D-array of probabilities of shape B*L*(L+1)
      """
      answer = []
      for elem in probs:
          m, n = elem.shape
          if n == m + 1:
              elem = np.log10(
                  np.maximum(self.min_edge_prob, elem)
              ) - np.log10(self.min_edge_prob)
              elem = np.concatenate(
                  [np.zeros_like(elem[:1, :]), elem], axis=0
              )
              # it makes impossible to create multiple edges 0->i
              elem[1:, 0] += np.log10(self.min_edge_prob) * len(elem)
              heads, _ = chu_liu_edmonds(elem.astype("float64"))
              answer.append(heads[1:])
          else:
              raise ValueError(
                  "First and second axis lengths m, n of probs should satisfy the condition n == m + 1"
              )
      return answer
  
file_path: DeepPavlov/deeppavlov/models/morpho_syntax_parser/dependency_decoding.py
imports: from typing import List
  import numpy
  from ufal.chu_liu_edmonds import chu_liu_edmonds
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.models.component import Component
label_desc: Use image node_id 2 for calling the ChuLiuEdmonds obj's underlying member method code with example usage: obj.__call__(probs) and returns: answer