@staticmethod
def is_better_result(metric: str, best_result: float, new_result: float
    ) ->bool:
    """Compare new result with previous best result

        :param metric: name of metric
        :type metric: str
        :param best_result: current best result
        :type best_result: float
        :param new_result: new result to be compared with
        :type new_result: float
        :return: True if the new result is better with this metric.
        """
    if metric in ['wer', 'loss', 'err']:
        return new_result < best_result
    elif metric in ['acc', 'bleu', 'f1']:
        return new_result > best_result
    else:
        raise Exception('Result comparison is not defined: %s' % metric)
