def __init__(self, **kwargs):
    self.qrel_orig_path = kwargs.get('qrel_orig_path', None)
    self.run_b_orig_path = kwargs.get('run_b_orig_path', None)
    self.run_a_orig_path = kwargs.get('run_a_orig_path', None)
    self.run_b_rep_path = kwargs.get('run_b_rep_path', None)
    self.run_a_rep_path = kwargs.get('run_a_rep_path', None)
    self.run_b_orig = None
    self.run_a_orig = None
    self.run_b_rep = None
    self.run_a_rep = None
    self.run_b_orig_score = None
    self.run_a_orig_score = None
    self.run_b_rep_score = None
    self.run_a_rep_score = None
    if self.qrel_orig_path:
        with open(self.qrel_orig_path, 'r') as f_qrel:
            qrel_orig = pytrec_eval.parse_qrel(f_qrel)
            self.rel_eval = pytrec_eval.RelevanceEvaluator(qrel_orig, pytrec_eval.supported_measures)
    if self.run_b_orig_path:
        with open(self.run_b_orig_path, 'r') as f_run:
            self.run_b_orig = pytrec_eval.parse_run(f_run)
            self.run_b_orig = {t: self.run_b_orig[t] for t in sorted(self.run_b_orig)}
    if self.run_a_orig_path:
        with open(self.run_a_orig_path, 'r') as f_run:
            self.run_a_orig = pytrec_eval.parse_run(f_run)
            self.run_a_orig = {t: self.run_a_orig[t] for t in sorted(self.run_a_orig)}
    if self.run_b_rep_path:
        with open(self.run_b_rep_path, 'r') as f_run:
            self.run_b_rep = pytrec_eval.parse_run(f_run)
            self.run_b_rep = {t: self.run_b_rep[t] for t in sorted(self.run_b_rep)}
    if self.run_a_rep_path:
        with open(self.run_a_rep_path, 'r') as f_run:
            self.run_a_rep = pytrec_eval.parse_run(f_run)
            self.run_a_rep = {t: self.run_a_rep[t] for t in sorted(self.run_a_rep)}
def __init__(self, **kwargs):
    self.qrel_orig_path = kwargs.get('qrel_orig_path', None)
    self.run_b_orig_path = kwargs.get('run_b_orig_path', None)
    self.run_a_orig_path = kwargs.get('run_a_orig_path', None)
    self.run_b_rep_path = kwargs.get('run_b_rep_path', None)
    self.run_a_rep_path = kwargs.get('run_a_rep_path', None)
    self.run_b_orig = None
    self.run_a_orig = None
    self.run_b_rep = None
    self.run_a_rep = None
    self.run_b_orig_score = None
    self.run_a_orig_score = None
    self.run_b_rep_score = None
    self.run_a_rep_score = None
    if self.qrel_orig_path:
        with open(self.qrel_orig_path, 'r') as f_qrel:
            qrel_orig = pytrec_eval.parse_qrel(f_qrel)
            self.rel_eval = pytrec_eval.RelevanceEvaluator(qrel_orig, pytrec_eval.supported_measures)
    if self.run_b_orig_path:
        with open(self.run_b_orig_path, 'r') as f_run:
            self.run_b_orig = pytrec_eval.parse_run(f_run)
            self.run_b_orig = {t: self.run_b_orig[t] for t in sorted(self.run_b_orig)}
    if self.run_a_orig_path:
        with open(self.run_a_orig_path, 'r') as f_run:
            self.run_a_orig = pytrec_eval.parse_run(f_run)
            self.run_a_orig = {t: self.run_a_orig[t] for t in sorted(self.run_a_orig)}
    if self.run_b_rep_path:
        with open(self.run_b_rep_path, 'r') as f_run:
            self.run_b_rep = pytrec_eval.parse_run(f_run)
            self.run_b_rep = {t: self.run_b_rep[t] for t in sorted(self.run_b_rep)}
    if self.run_a_rep_path:
        with open(self.run_a_rep_path, 'r') as f_run:
            self.run_a_rep = pytrec_eval.parse_run(f_run)
            self.run_a_rep = {t: self.run_a_rep[t] for t in sorted(self.run_a_rep)}