text: 
  import argparse
  import logging
  import sys
  
  
  sys.path.append('../../../sr2018')
  from components.evaluator.syn_evaluator import SynEvaluator
  
  
  def test(mode='single'):
  
      ref11 = ['I', 'like', 'fresh', 'green', 'apples']
      ref12 = ['I', 'like', 'green', 'apples']
      hyp1 = ['I', 'like', 'fresh', 'spring', 'apples']
  
      ref21 = ['He', 'is', 'my', 'glorious', 'father']
      ref22 = ['He', 'is', 'my', 'glorious', 'brother']
      hyp2 = ['He', 'is', 'my', 'beloved', 'father']
  
      all_hyps = [hyp1, hyp2]
  
      if mode == 'single':
          logging.debug('Single-reference mode')
          all_refs = [[ref12], [ref22]]
  
      elif mode == 'multi':
          logging.debug('Multi-reference mode')
          all_refs = [[ref11, ref12], [ref21, ref22]]
  
      else:
          raise NotImplementedError()
  
      scores = SynEvaluator.compute_metric_scores(all_refs, all_hyps)
      SynEvaluator.output_scores(scores)
  
  
  def parse_args():
      argparser  = argparse.ArgumentParser()
      argparser.add_argument('--ref', help='References file')
      argparser.add_argument('--hyp', help='Hypotheses file')
      argparser.add_argument('--test', help='Run tests', action='store_true')
      argparser.add_argument('--mode', help='Mode: single or multi-reference', choices=['single', 'multi'])
  
      args = argparser.parse_args()
      return args
  
  def main():
      logging.basicConfig(level=logging.DEBUG)
      argvs = parse_args()
  
      if argvs.test:
          logging.info('Running tests')
          mode = argvs.mode
          test(mode)
  
      else:
          ref_fn = argvs.ref
          hyp_fn = argvs.hyp
  
          scores = SynEvaluator.read_predictions_and_eval(ref_fn, hyp_fn, normalise=True)
          SynEvaluator.output_scores(scores)
  
  if __name__ == '__main__':
      main()