INNER CODE UNIT · Python

pearson

linzhiqiu/t2v_metrics · dataset.py:15

    pearson = 100*np.corrcoef(metric1_scores, metric2_scores)[0, 1]
    return pearson

# The original Kendall-Tau is not robust against ties. 
# We adopt the pairwise accuracy with tau optimization as proposed in EMNLP'23 Best paper
# Code borrowed from: 
# https://github.com/google-research/mt-metrics-eval/blob/main/mt_metrics_eval/ties_matter.ipynb

def _MatrixSufficientStatistics(
    x,
    y,
    epsilon: float,
    ) -> Tuple[int, int, int, int, int]:
    """Calculates tau sufficient statistics using matrices in NumPy.

    An absolute difference less than `epsilon` in x pairs is considered to be
    a tie.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…