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
Applies Chu-Liu-Edmonds algorithm to the matrix of head probabilities.
        probs: a 3D-array of probabilities of shape B*L*(L+1)
        
deeppavlov/models/morpho_syntax_parser/dependency_decoding.py