Skip to content

Instantly share code, notes, and snippets.

@varvara-l
varvara-l / williams_test.py
Last active Aug 16, 2018
Williams significance test for WMT-18 sentence-level submissions
View williams_test.py
from __future__ import division
from argparse import ArgumentParser
import sys
from scipy.stats import pearsonr, t
from math import sqrt
########################################################################################
# Williams significance test to define significance of Pearson correlation scores
# Implemented as described in [1]. The final significance level is modified
# with Bonferroni correction for multiple comparisons
View randomization_test_multiple.py
from __future__ import division
import sys
import numpy as np
import math
from argparse import ArgumentParser
from multiprocessing import Pool
##########################################################################
#
View randomization_test.py
from __future__ import division
import sys
import numpy as np
import math
from argparse import ArgumentParser
from multiprocessing import Pool
##########################################################################
#
View sequence_correlation.py
from __future__ import print_function
from argparse import ArgumentParser
from sklearn.metrics import accuracy_score
###########################################################################################################
#
# Script to compute Sequence Correlation score for word-level binary QE system output in WMT-15 format:
# <METHOD NAME> <SEGMENT NUMBER> <WORD INDEX> <WORD> <BINARY SCORE>
#
###########################################################################################################
View parse_pra.py
import sys
'''
Parse TERCOM .pra files
'''
def parse_sentence(line_array):
hyp, ref = [], []
align, sentence_id = "", ""
for line in line_array:
View evaluate_wmt15.py
from __future__ import division, print_function
import os
import numpy as np
from argparse import ArgumentParser
from sklearn.metrics import f1_score
#------------------ evaluation for the WMT15 format:------------------------
#
# <METHOD NAME> <SEGMENT NUMBER> <WORD INDEX> <WORD> <BINARY SCORE>
# tab-separated, no empty lines