This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
''' | |
Parse TERCOM .pra files | |
''' | |
def parse_sentence(line_array): | |
hyp, ref = [], [] | |
align, sentence_id = "", "" | |
for line in line_array: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | |
# | |
########################################################################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
import sys | |
import numpy as np | |
import math | |
from argparse import ArgumentParser | |
from multiprocessing import Pool | |
########################################################################## | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
import sys | |
import numpy as np | |
import math | |
from argparse import ArgumentParser | |
from multiprocessing import Pool | |
########################################################################## | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |