Skip to content

Instantly share code, notes, and snippets.

import sys
'''
Parse TERCOM .pra files
'''
def parse_sentence(line_array):
hyp, ref = [], []
align, sentence_id = "", ""
for line in line_array:
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>
#
###########################################################################################################
from __future__ import division
import sys
import numpy as np
import math
from argparse import ArgumentParser
from multiprocessing import Pool
##########################################################################
#
from __future__ import division
import sys
import numpy as np
import math
from argparse import ArgumentParser
from multiprocessing import Pool
##########################################################################
#
@varvara-l
varvara-l / williams_test.py
Last active August 16, 2018 14:07
Williams significance test for WMT-18 sentence-level submissions
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
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